Operating System - HP-UX
1748122 Members
3441 Online
108758 Solutions
New Discussion

Re: set ulimit stack unlimited

 
1221
Advisor

set ulimit stack unlimited

Hi,

We want to modify the ulimit stack value to unlimited,

Version: HP-UX 11.31

 

> ulimit -s unlimited
sh: ulimit: The specified value exceeds the user's allowable limit.

 

>ulimit -Sa
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 1048576
stack(kbytes) 16384
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 1024

 

fomhrtst:/home/oracle:central>kctune |grep maxs
maxssiz 134217728 134217728 Immed
maxssiz_64bit 1073741824 1073741824 Immed
pa_maxssiz_32bit 83648512 Default Immed
pa_maxssiz_64bit 536870912 Default Immed
vol_maxspecialio 256 Default
vol_maxstablebufsize 256 Default


fomhrtst:/home/oracle:central>kctune |grep maxd
maxdsiz 1073741824 1073741824 Immed
maxdsiz_64bit 2147483648 2147483648 Immed

 

fomhrtst:/home/oracle:central>/usr/sbin/sysdef|grep max
maxdsiz 16384 - 0-655360 Pages -
maxdsiz_64bit 32768 - 256-1048576 Pages -
maxfiles 1024 - 30-2048 -
maxfiles_lim 63488 - 30-2048 -
maxssiz 2048 - 0-655360 Pages -
maxssiz_64bit 16384 - 256-1048576 Pages -
maxswapchunks 0 - 1-16384 -
maxtsiz 1536 - 0-655360 Pages -
maxtsiz_64bit 16384 - 256-1048576 Pages -
maxuprc 3686 - 3- -

 

The size of the stack is limited to the corresponding kernel parms  maxssiz, maxssiz_64bit, 

the kernel parameter shows that they are 128MB and 1GB respectively, but we cannot increase it.

ANy help would be aprreciated.

 

Thanks in advance.

 

P.S. This thread has been moved from HP-UX>General to HP-UX > sysadmin. -HP Forum Moderator

5 REPLIES 5
Patrick Wallek
Honored Contributor

Re: set ulimit stack unlimited

You can't set the stack size to unlimited.  The very last message you give states why.

 

**********

The size of the stack is limited to the corresponding kernel parms  maxssiz, maxssiz_64bit

**********

 

You have to try setting the ulimit value for the stack to some specific value that is less than or equal to the kernel parameter.

 

For example, to set the stack limit to 128 MB (131,072 KB):

 

# ulimit -s 131072

 

 By the way, 128 MB (maxssiz) and 1 GB (maxssiz_64bit) are very high for a stack size.  If you really need a stack that large, then there may be some serious issues with your code.

 

Dennis Handly
Acclaimed Contributor

Re: set ulimit stack unlimited

>We want to modify the ulimit stack value to unlimited

 

As Patrick says, you cannot.  You can just make it as big as you need.

 

>the kernel parameter shows that they are 128MB and 1GB respectively, but we cannot increase it.

 

You currently have 16,384 KB and your maxssiz is 134,217,728.  If maxssiz was changed after you logged in, you will have to login again.  But using "ulimit -Ha" will give you the current hard limits for your process.

 

>128 MB (maxssiz) and 1 GB (maxssiz_64bit) are very high for a stack size.  If you really need a stack that large, then there may be some serious issues with your code.

 

I.e. a broken Fortran application.  Or recursion gone wild.

And what's worse is every byte in maxssiz takes it away from maxdsiz.

1221
Advisor

Re: set ulimit stack unlimited

Thanks for replying,

I will check with the Application vendor regarding the "Unlimited" value request.

However, the current value for stack is 16,384 KB, I cannot increase to even 16,385 KB altough the maxssiz is 131,072 KB, and this setting is since beginning.

My question is what is preventing the stack value to increase altough it go until 128MB max.

Thanks.

Patrick Wallek
Honored Contributor

Re: set ulimit stack unlimited

Have you actually tried increasing it with the command I gave?

 

For example:

 

# ulimit -s 131072

 

If so, what is the output?

Dennis Handly
Acclaimed Contributor

Re: set ulimit stack unlimited

>I will check with the Application vendor

 

Is this Oracle?

 

>what is preventing the stack value to increase although it go until 128 MB max.

 

As I mentioned, if the hard limit is 16 MB, you can't increase it unless you are root or you log out.