stack space in sol10

we have a solaris 10 box (V440)

we are looking for a way to set the stack size for all processes on the system.

we know we can use ulimit -s

$ ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 8192
coredump(blocks) unlimited
nofiles(descriptors) 256
memory(kbytes) unlimited

$ ulimit -s 16384

$ ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 16384
coredump(blocks) unlimited
nofiles(descriptors) 256
memory(kbytes) unlimited

this is fine but it only effects the current shell.

is there something we can put in to /etc/system that will effect the whole box??

You can change the stack size by setting default_stksize to whatever value you need. Note, however, that it is the minimum size that a stack can have. In other words, no thread can be created with a stack size smaller than this value.

Increasing this value will result in increased kernel memory consumption, so do it only if really required.

yep, i figure that we show several GB of free RAM and many GB of free swap.
if we have 8MB more stack space per PID and about 100 PID's on the box then my math says we may be using about 1GB more RAM if we change the stack size.

we have a strange database program that has been giving a "cant fork" error for some weeks, when we put ulimit -s 16384 in the startup script it solved the problem.

but now when we do a lookup or search using the command line tools we also get a "cant fork", if we put a ulimit -s 16384 before we do the command line stuff we are OK again.