1847329 Members
2288 Online
110264 Solutions
New Discussion

Re: ulimit

 
Mervyn Stephens
Occasional Advisor

ulimit

When using ulimit to change the data size limit (or any other limit), where is this new information stored and will the change be permanent
4 REPLIES 4
Jonathan Small
New Member

Re: ulimit

This parameter is defined within a user's shell evironment. Depending on the shell used (e.g. ksh,csh,sh) will determine how you set the variable. To make the setting permanent, simply add the setting to the shell's respective startup file. BTW - I believe the default setting is "unlimited". Also, the name of the command using "csh" is "limit" instead of "ulimit". Check out the man page for whichever shell you use for more info.

Hope this helps.
Those who play the game do not see it as clearly as those who watch.
A. Clay Stephenson
Acclaimed Contributor

Re: ulimit

Hi:

Bear in mind that a regular user can only decrease a ulimit value. If you really need a larger data size you need to increase the kernel tunable maxdsiz and regen a kernel.
If it ain't broke, I can fix that.
Ravi_8
Honored Contributor

Re: ulimit

Hi.
ulimit() provides control over process limits.

Any process can decrease this limit,but only a process with an effective user ID of super-user can increase the limit.
limit must be specified in units of 512-bytes per blocks.
never give up
Bill Hassell
Honored Contributor

Re: ulimit

ulimit is available in ksh and the recommended POSIX shell. ksh has no options and can only contro0l the maximum size of files written by child processes and has no soft or hard value.

However, the POSIX shell (man sh-posix) has a plethora of options (ulimit -a) including the ability to set a soft limit. The advantage in using limit versus maxdsiz or maxfiles in the kernel is that it can be set uniquely for each user when they login.

So one example is to eliminate core files for all users:

ulimit -Sc 0

Now if a specific user must have their core files saved, they can use ulimit to increase the limit. Similarly, the other parameters can be set according to the desired environment.

# ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 524288
stack(kbytes) 16384
memory(kbytes) unlimited
coredump(blocks) 0
nofiles(descriptors) 128


Bill Hassell, sysadmin