1827261 Members
2176 Online
109717 Solutions
New Discussion

ulimit

 
SOLVED
Go to solution
arun_k
Advisor

ulimit

hi all

I have hp-ux 11.23 Itanium system. In 'ulimit -a' I am getting stack value 8192. Is there any way I can increase this value. My application people wants this to be modified.

thanks
arun
11 REPLIES 11
Ivan Krastev
Honored Contributor
Solution

Re: ulimit

The stack size is controlled by the maxssize kernel parameter. You can change it with kmtune ( http://docs.hp.com/en/B9106-90008/kmtune.1M.html) or via SAM.


regards,
ivan
arun_k
Advisor

Re: ulimit

hi

The maxssize value is same in my 2 servers but the ulimit -a . stack value is less in 11.23 system than the other server i have . other one is 11.11 PArisc based

regards
Dennis Handly
Acclaimed Contributor

Re: ulimit

Who wants their maxssiz greater than 8Mb? Some Fortran application?

Note: Don't go crazy and make it too big since that will limit maxdsiz for 32 bit apps.

>The maxssiz value is same in my 2 servers but the ulimit -a stack value is less in 11.23 system

What is your maxssiz_64bit? It must be larger than maxssiz. Also does your maxssiz match your 8 Mb ulimit value?
Yogeeraj_1
Honored Contributor

Re: ulimit

hi arun,

First of all, note that on HP-UX you cannot increase a soft limit above a kernel imposed hard limit.

To raise a kernel imposed hard limit use SAM or kmupdate.


Changing a kernel imposed hard limit requires a reboot.

HP-UX has some different process resource limits for 64bit executables that cannot be modified via 'limit' or 'ulimit'. These parameters, recognizable by their '_64bit' suffix, can only be changed by an OS kernel update.


To display hard limit values from the HP-UX kernel:
# sam
-or-

$ /usr/sbin/kmtune|grep max
...
maxdsiz 0x40000000 - 0X40000000
maxdsiz_64bit 0x80000000 - 0X80000000
maxfiles 2048 - 2048
maxfiles_lim 2048 Y 2048
...
maxssiz 0x8000000 - 0X8000000
maxssiz_64bit 0x40000000 - 0X40000000
..
maxtsiz 0x4000000 Y 0X4000000
maxtsiz_64bit 0x40000000 Y 0X40000000

hope this helps!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Dennis Handly
Acclaimed Contributor

Re: ulimit

>Yogeeraj: Changing a kernel imposed hard limit requires a reboot.

On 11.23, these are dynamic tunables and can be changed with kctune, without a reboot.

It seems only maxrsessiz* needs a reboot.
Yogeeraj_1
Honored Contributor

Re: ulimit

hi arun,

First of all, note that on HP-UX you cannot increase a soft limit above a kernel imposed hard limit.

To raise a kernel imposed hard limit use SAM or kmupdate.


Changing a kernel imposed hard limit requires a reboot.

HP-UX has some different process resource limits for 64bit executables that cannot be modified via 'limit' or 'ulimit'. These parameters, recognizable by their '_64bit' suffix, can only be changed by an OS kernel update.


To display hard limit values from the HP-UX kernel:
# sam
-or-

$ /usr/sbin/kmtune|grep max
...
maxdsiz 0x40000000 - 0X40000000
maxdsiz_64bit 0x80000000 - 0X80000000
maxfiles 2048 - 2048
maxfiles_lim 2048 Y 2048
...
maxssiz 0x8000000 - 0X8000000
maxssiz_64bit 0x40000000 - 0X40000000
..
maxtsiz 0x4000000 Y 0X4000000
maxtsiz_64bit 0x40000000 Y 0X40000000

hope this helps!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Yogeeraj_1
Honored Contributor

Re: ulimit

Thank you Dennis for the correction.
I was not aware of it.

Thanks again
kind regards
yogeeraj

No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
arun_k
Advisor

Re: ulimit

hi

pls find the parameters from both 11.11 and 11.23 below

11.11
-----------
ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 1048576
stack(kbytes) 131072
memory(kbytes) unlimited
coredump(blocks) 4194303

maxdsiz 1073741824 1073741824 Static
maxdsiz_64bit 2415919104 2415919104 Static

on 11.23
----------------
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 1048576
stack(kbytes) 8192
memory(kbytes) unlimited
coredump(blocks) 4194303

maxdsiz 1073741824 1073741824 yes
maxdsiz_64bit 4294967296 4294967296 yes

Pls find that here the stack value is less in 11.23 server. So pls any one tell me if it can be increased.

regards
arun
Don Morris_1
Honored Contributor

Re: ulimit

Yes, it can -- and Dennis already told you how.

You need to check the values of maxssiz and maxssiz_64bit, not maxdsiz [Data != Stack]. Assuming they're lower than what you want, raise whichever is appropriate via kctune. It is important to check both because of the way the system starts up and limits are inherited.. the root-of-all processes is 64-bit, but most shells are 32-bit and the inheritance policy is to inherit the parent's limits where possible... which means the 64-bit limit will override the 32-bit limit if it is lower.

I would ask your application people _why_ they need 128Mb stacks, though. If they aren't running Java or Fortran [both of which have models where large stack arrays are common], then they're more likely to have bad code or coding practices and should do allocations on the heap (or ease off of the recursion). It is important to not just raise this arbitrarily because the virtual address space you're allowing the stack to use is no longer usable by Data or other Private objects... which means that setting maxssiz to 128Mb in the default model limits Data/Private virtual address space to 1Gb - 128Mb, or 896Mb.
Don Morris_1
Honored Contributor

Re: ulimit

Oh -- one other note. max*siz{_64bit} tunables are dynamic in 11.23 -- but as the man pages note, processes already running are not affected by the change, only new processes.

So if the application you want to raise the stack on is already running, you'll want to increase the tunable and restart the application so it gets the larger stack.
arun_k
Advisor

Re: ulimit

hi

thanks DON and DENNIS for info. I was confused with maxssize and maxdsize. Now I corrected it.

thanks for the help once again.