lwp_default_stksize

Specifies the default value of the stack size to be used when
a kernel thread is created, and when the calling routine does not provide
an explicit size to be used.

Data Type

Integer

Default

8192 for x86 platforms

24,576 for SPARC platforms

20,480 for AMD64 platforms

Range

Minimum is the default values:

3 x PAGESIZE on SPARC systems

2 x PAGESIZE on x86 systems

5 x PAGESIZE on AMD64 systems

Maximum is 32 times the default value.

Units

Bytes in multiples of the value returned by the getpagesize parameter. For more information, see getpagesize(3C).

Dynamic?

Yes. Affects threads created after the variable is changed.

Validation

Must be greater than or equal to 8192 and less than or equal
to 262,144 (256 x 1024). Also must be a multiple of the system page size.
If these conditions are not met, the following message is displayed:

Illegal stack size, Using N

The value of N is the default value of lwp_default_stksize.

When to Change

When the system panics because it has run out of stack space.
The best solution for this problem is to determine why the system is running
out of space and then make a correction.

Increasing the default stack size means that almost every kernel thread
will have a larger stack, resulting in increased kernel memory consumption
for no good reason. Generally, that space will be unused. The increased consumption
means other resources that are competing for the same pool of memory will
have the amount of space available to them reduced, possibly decreasing the
system's ability to perform work. Among the side effects is a reduction in
the number of threads that the kernel can create. This solution should be
treated as no more than an interim workaround until the root cause is remedied.