File size limit exceeded


 
Thread Tools Search this Thread
Top Forums Programming File size limit exceeded
# 1  
Old 02-22-2006
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.
# 2  
Old 02-22-2006
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.
# 3  
Old 02-22-2006
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?
# 4  
Old 02-22-2006
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.
# 5  
Old 02-23-2006
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.
# 6  
Old 02-23-2006
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.
# 7  
Old 02-25-2006
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?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

httpd count exceeded threshold limit

Hello Everyone, I am new to this forum and also unix/linux. Our application today threw an alert whcih read as "The users active count on host has crossed the threshold limit of 50 and is standing at 65." This was although cleared when I restarted tomcat. But I am not sure why this count... (0 Replies)
Discussion started by: ykhati
0 Replies

2. Shell Programming and Scripting

Problem with awk awk: program limit exceeded: sprintf buffer size=1020

Hi I have many problems with a script. I have a script that formats a text file but always prints the same error when i try to execute it The code is that: { if (NF==17){ print $0 }else{ fields=NF; all=$0; while... (2 Replies)
Discussion started by: fate
2 Replies

3. UNIX for Advanced & Expert Users

file size limit?

hi, how can I find out what the limit of a file size is on unix? thanks (6 Replies)
Discussion started by: JamesByars
6 Replies

4. Shell Programming and Scripting

Logfile Size exceeded ????

Hi, How to write a script which checks the size of a log file? I want that the log file contents to get cleared as soon as it increases 1 KB. Thanks (3 Replies)
Discussion started by: skyineyes
3 Replies

5. UNIX for Dummies Questions & Answers

File size limit exceeded... SCO ulimit?

Hello - O/S is UnixWare 7.1.4 My prefered method of copying files between servers is 'rcp', which does not recognize symbolic links; therefore, files are duplicated many times over. To avoid this duplication, I would like to use 'tar' and/or 'cpio' and pipe them through 'rcp', but... (1 Reply)
Discussion started by: rm -r *
1 Replies

6. Solaris

/tmp: File system full, swap space limit exceeded

Can you help. My server sunning solaris 9 on x86 platform pretty much hung for a few hours... I could not use telnet or ssh to the box - it kept refusing connection. A few hours later - I was able to log in again. The server has not rebooted but here are the first errors in the messages log... (5 Replies)
Discussion started by: frustrated1
5 Replies

7. UNIX for Dummies Questions & Answers

Error, Login Limit Exceeded by 1 user

Would appreciate some help, system was displaying an error regarding the kernal when a "sar" was run, after a reboot we get "WARNING user login limit exceeded by 1 user". We have plenty of licences. any ideas? (1 Reply)
Discussion started by: nchrocc
1 Replies

8. UNIX for Advanced & Expert Users

File Size Limit

Hi, I have a problem writing or copying a file 2GB or larger to either the second or third disk on my C8000. I've searched this forum and found some good information on this but still nothing to solve the problem. I'm running hpux 11i, JFS3.3 and disk version 4 (from fstyp) on all 3 disks. ... (2 Replies)
Discussion started by: HaidoodFaulkauf
2 Replies

9. AIX

file size limit

Can anybody help me? How to increase file size limit in aix 5.2? I have already specified in /etc/security/limits file : default: fsize = -1 core = 2097151 cpu = -1 data = -1 rss = -1 stack = -1 nofiles = 2000 (2 Replies)
Discussion started by: vjm
2 Replies

10. Solaris

File size limit

I want to have a permanent file created - and limit the size that this file can grow.. I want a circular file.. ie max size of file is 10 mb.. and if any new data written to file the oldest data removed.. How can I do this? I am on solaris 9 x86 (3 Replies)
Discussion started by: frustrated1
3 Replies
Login or Register to Ask a Question