Operating System - HP-UX
1830194 Members
7061 Online
109999 Solutions
New Discussion

Increase the stack size limit for a user in hp-unix.

 
GnanaShekar
Regular Advisor

Increase the stack size limit for a user in hp-unix.

Hi,

A user on HP-Unix has requested to increase the stack size limit for him. How do I do that. In Linux and AIX we have a file named /etc/security/limits, in which we could edit. Please suggest.

# uname -a
HP-UX banpchp1 B.11.23 U ia64 1538339006 unlimited-user license

# ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 4194300
stack(kbytes) 8192
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 2048

Thanks & Regards,
-GnanaShekar-
2 REPLIES 2
Don Morris_1
Honored Contributor

Re: Increase the stack size limit for a user in hp-unix.

There are two possibilities:

1) The user's shell (or a parent of that shell) has lowered the hard limit using ulimit -h - at which point you have to find this and modify it. Note, this is very rare -- you are much more likely to have to:

2) The system-wide hard limit is determined by the kernel tunable "maxssiz" and/or "maxssiz_64bit". maxssiz is the limit for 32-bit processes, maxssiz_64bit for 64-bit. Note that maxssiz_64bit trumps maxssiz_32bit (i.e. a lower 64-bit limit will be used instead of the 32-bit limit.. this is a consequence of the parent bitness as the system comes up), so you'll want to consider both.

On 11.23, maxssiz / maxssiz_64bit are dynamic - changes to them take effect immediately for any new processes. So "kctune -u -s maxssiz=" and that should do it.

As a side note - if the user believes they need a very large stack, make sure that they understand why. Fortran and Java are both legitimate use cases -- for normal C programming, large stacks are usually a sign of poor recursion. Not saying there's a problem, but just worth a mention.
Don Morris_1
Honored Contributor

Re: Increase the stack size limit for a user in hp-unix.

Oh, forgot to mention - as with all kernel tunables in 11.23, maxssiz has a man page if you want more information, similar tunables (such as maxdsiz), etc.