Blog dedicated to Oracle Applications (E-Business Suite) Technology; covers Apps Architecture, Administration and third party bolt-ons to Apps

Monday, August 6, 2007

How To Change UNIX Process Resource Limits Via a Bourne or Korn Shell

Which individual resources are available and their soft limit values
can be displayed by entering the ulimit command with the '-a' option:

$ ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 524288
stack(kbytes) 8192
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 60

In some shells on certain platforms, the '-a' option doesn't work so
you will have to specify a specific resource option:

-c Maximum size of core files.
-d Maximum size of data segment or heap.
-f Maximum size for files written by child processes.
-m Maximum size of physical memory.
-n Maximum number of file descriptors.
-s Maximum size for the stack area.
-t Maximum number of seconds to be used by each process.
-v Maximum size of virtual memory.
-w Maximum size of swap area.
-H The limits specified for the resources are hard limits.
-S The limits specified for the resources are soft limits. (the default
if neither '-H' or '-S' is specified.

So to display the soft limit for stack size:

$ ulimit -s
8192

To raise the soft limit for stack size:

$ ulimit -s 8193
sh: ulimit: The specified value exceeds the user's allowable limit.
[this indicates 8192 is also the hard limit]

To check the hard limit for stack size:

$ ulimit -Hs
8192

To increase the hard limit:

$ ulimit -Hs 8193

To see if the change took place:

$ ulimit -Hs
8193

To raise the soft limit:

$ ulimit -Ss 8193
sh: ulimit: The specified value exceeds the user's allowable limit.
[this indicates the kernel imposed limit is 8192]

To set the soft limit to 'unlimited':

$ ulimit -s unlimited

If one of the above commands doesn't work as expected, refer to the
platform specific information below.

Content taken from Metalink Note: 188149.1 How to Display and Change UNIX Process Resource Limits

No comments: