Operating System - HP-UX
1849273 Members
6957 Online
104042 Solutions
New Discussion

how to set stack size when link with aCC ?

 
cuipeng_guid
Occasional Contributor

how to set stack size when link with aCC ?

thanks.
any advice will be appreciated!!!
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor

Re: how to set stack size when link with aCC ?

The size of the stack is not a function of linking but rather of the kernel tunable maxssiz (or its 64-bit counterpart maxssiz_64bit) and is determined at run-time.
If it ain't broke, I can fix that.
T G Manikandan
Honored Contributor

Re: how to set stack size when link with aCC ?

Yes,

the process data,stack and text area are determined by the three kernel parameters

maxdsiz
maxssiz
maxtsiz
and their 64 bit equivalents.

These parameters will specify the upper limit for any process for the usage.
By default the size would be 64M.

check this for more info

http://docs.hp.com/hpux/onlinedocs/939/KCParms/KCparams.OverviewAll.html
Mike Stroyan
Honored Contributor

Re: how to set stack size when link with aCC ?

In addition to the maxssiz and maxssiz_64bit kernel limits, a process might reach a process resource limit such as set by setrlimit() or the ulimit shell builtin. You can view that limit in /usr/bin/sh with "ulimit -s".

If you use threads then the maximum stack size for each new thread is determined by the thread attributes passed in to pthread_create. That can be initialized with pthread_attr_setstacksize().

There is also a non-portable pthread_default_stacksize_np() function for setting the default for all future threads.
Nicolas Dumeige
Esteemed Contributor

Re: how to set stack size when link with aCC ?

There is also a user level limitation when you use the shell. ulimit -a for sh/ksh limit for csh.
All different, all Unix