The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
File size limit exceeded... SCO ulimit? rm -r * UNIX for Dummies Questions & Answers 1 10-22-2007 02:52 PM
/tmp: File system full, swap space limit exceeded frustrated1 SUN Solaris 5 03-18-2007 01:38 PM
Error, Login Limit Exceeded by 1 user nchrocc UNIX for Dummies Questions & Answers 1 08-14-2006 06:21 AM
File Size Limit HaidoodFaulkauf UNIX for Advanced & Expert Users 2 07-25-2006 05:24 AM
file size limit vjm AIX 2 09-27-2005 06:46 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 02-22-2006
Registered User
 

Join Date: Feb 2006
Posts: 8
File size limit exceeded

When i run my C program which dynamically creates the output file, the program stops after sometime and gives the error "File size limit exceeded" even though my working directory has space.Can anyone plz help me out.
Reply With Quote
Forum Sponsor
  #2  
Old 02-22-2006
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
it seems that you have not handled SIGXFSZ,

check with the following program to find the max size allowed on your system,
if needed increase the limits by setrlimit,

Code:
# include<stdio.h>
# include <sys/resource.h>

int main()
{
struct rlimit limitbuf;
getrlimit(RLIMIT_FSIZE, &limitbuf);
fprintf(stderr, "Minimum Limit in bytes: %d\n", limitbuf.rlim_cur);
fprintf(stderr, "Maximum Limit in bytes: %d\n", limitbuf.rlim_max);
return 0;
}
if this is the case of dumping logs,
i would suggest to change the logging filename after monitoring for a threshold time or file size value.

hope this helps.
Reply With Quote
  #3  
Old 02-22-2006
Registered User
 

Join Date: Feb 2006
Posts: 8
Thanks for your reply.I got the min and max byte limit.But from what I've read there are limits that can be set using ulimit but when I do a "ulimit -a" the "file size" is already set to unlimited. Is it that the signal SIGXFSZ has already some size defined because of which it is throwing this error?
Reply With Quote
  #4  
Old 02-22-2006
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,274
This sounds like maybe it is a "large file" problem.

UNIX has actual physical limits to file size determined by the number of bytes a 32 bit file pointer can index, about 2.4 GB. For older filesystems or runtimes.

Depending on your system, you may or may not have large file support. Try
Code:
 man fopen64
if you have an older unix.

If you can't find how or if large file support exists for your box, consider closing the first file just before it reaches 0x7fffffff bytes in length, and opening an additional new file.
Reply With Quote
  #5  
Old 02-22-2006
Registered User
 

Join Date: Feb 2006
Posts: 8
Thanks Jim.
Now i am printing my ouput in 5 files.This is the size status of my output files

-rw-rw-rw- 1 usr users 53296243 Feb 23 11:09 output
-rw-rw-rw- 1 usr users 191 Feb 23 11:09 error
-rw-rw-rw- 1 usr users 2701503 Feb 23 11:09 pipe
-rw-rw-rw- 1 usr users 255 Feb 23 11:09 summary
-rw-rw-rw- 1 usr users 2147483647 Feb 23 11:09 debug

The size of the debug file is same as the maximum bytes i got i.e 2147483647(7FFFFFFF)
Eventhough the debug file occupies all the max bytes then also other files are created which are pretty large in size.That means the physical limit is exceeded here.
Then it should give me that message in unix.
But i get this error on linux now.
Reply With Quote
  #6  
Old 02-23-2006
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,274
You debug file is the problem. You are exceeding the file size limit, just like the error message said. The error message is not the issue, the issue is your code. It is trying to do something it is not able to do.

If you have to have one super-large file, then see if your flavor of linux supports 64 bit file pointers - large files. And change your code accordingly. It may involve using a different linux filesystem as well , I do not know.

Otherwise, stop writing to the file "debug" when its big, and open a second one "debug2", then when it gets big, write to "debug3" and so on.
Reply With Quote
  #7  
Old 02-24-2006
Registered User
 

Join Date: Feb 2006
Posts: 8
Thanks Jim.
Actually my code is too big to make any changes now. But i have tried your other suggestion to create more debug files.
But I seriously don't know whether my linux flavour supports 64 bit file pointers or not. My system is redhat linux 7.3 version. Can you please tell me whether it supports or not?
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:05 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0