1819866 Members
2855 Online
109607 Solutions
New Discussion юеВ

ulimit usage

 
Jojo Castro
Regular Advisor

ulimit usage

Hi all,

how would I know if value of ulimit already reached its limit? Can someone tell me how to monitor usage in ulimit? below is the current values of ulimit.

# ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 1048576
stack(kbytes) 131072
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 5000


Thanks!
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor

Re: ulimit usage

It depends upon which ulimit you are talking about. For example, if a write() system call results in a file trying to grow beyond the filesize ulimit for a process, the system call sets the global variable errno = EFBIG. If a process reaches the memory limit, malloc() would set errno = ENOMEM. If the number of files exceeds the per-process limit, open() sets errno = EMFILE. This occurs within a process and it is up to the process to report these errors. Well-written applications with suitable permissions will first hit the soft ulimit and request to increase it up to the hard ulimit --- and lof a warning that ulimit was (temporarily) increased.
If it ain't broke, I can fix that.
Dennis Handly
Acclaimed Contributor

Re: ulimit usage

You can monitor some of these with top and glance.
top will give an estimate of data and time.
glance will give nofiles, stack, data, time and file.
For nofiles, you may have to add up the entries. ;-)
For stack & data you need to look at the memory regions.
For file, you need to look at the current pointer for each open (for write) file.