[ Usenet FAQs | Web FAQs | Documents | RFC Index ]
    Search the FAQ Archives

Single Page

Top Document: comp.sys.hp.hpux FAQ
Previous Document: 5.10.2 Why do my processes keep dying at 64 MB memory usage?
Next Document: 5.10.4 How can I tell what files, ports, etc.. a process has open?


5.10.3 How do I set per-process limits?



Many system-wide per-process limits can be set by root by modifying kernel
parameters.  Regular users can also set some per-process limits via shell
builtins.  Of course, system-wide limits cannot be exceeded.

In the POSIX and Korn shells, the 'ulimit' builtin command can be used to
set pre-process limits.  Though both builtins have the name ulimit, their
capabilities and syntax are different.

For the Korn shell (ksh), ulimit only affects the filesize limit, which
defaults to 4194303, which ksh interprets to mean unlimited.  See ksh(1).

For the POSIX shell (sh), there are several variables that can be set
with ulimit.  The 'ulimit -a' command lists all the variables that can be
set.  There are soft and hard limits for these variables, and some ulimit
maximum values are based on certain kernel parameters:

     Soft Limit                        Relevant Kernel Params
     ========================================================
     $ ulimit -aS
     time(seconds)        unlimited
     file(blocks)         unlimited
     data(kbytes)         65536        max determined by maxdsiz
     stack(kbytes)        8192         max determined by maxssiz
     memory(kbytes)       unlimited
     coredump(blocks)     4194303
     nofiles(descriptors) 60           max determined by maxfiles

     Hard Limit                        Relevant Kernel Params
     ========================================================
     $ ulimit -aH
     time(seconds)        unlimited
     file(blocks)         unlimited
     data(kbytes)         65536
     stack(kbytes)        8192
     memory(kbytes)       unlimited
     coredump(blocks)     unlimited
     nofiles(descriptors) 1024        max determined by maxfiles_lim

See also sh-posix(1).

The C shell (csh) has similar variables.  These variables can be set using
the csh 'limit' builtin command.  See csh(1).



Top Document: comp.sys.hp.hpux FAQ
Previous Document: 5.10.2 Why do my processes keep dying at 64 MB memory usage?
Next Document: 5.10.4 How can I tell what files, ports, etc.. a process has open?

Single Page


[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
hpux.faq@gmail.com

Last Update October 22 2009 @ 05:25 AM

Some parts © 2009 Advameg, Inc.