stack guard size sets the size, in bytes, of the stack guard area, which is an overflow stack of configurable size at the end of each stack.
Summary Information |
|
---|---|
Default value |
4096 |
Range of values |
0–2147483647 |
Status |
Static |
Display level |
Comprehensive |
Required role |
System administrator |
Configuration groups |
Memory Use, User Environment |
SAP ASE allocates one stack for each user connection and worker process when it starts. These stacks are located contiguously in the same area of memory, with a guard area at the end of each stack. At the end of each stack guard area is a guardword, which is a 4-byte structure with a known pattern. The figure below illustrates how a process can corrupt a stack guardword.
The transaction was aborted because it used too much stack space. Either use sp_configure to increase the stack size, or break the query into smaller pieces. spid: %d, suid: %d, hostname: %.*s, application name: %.*s
kernel: *** Stack overflow detected: limit: 0x%lx sp: 0x%lx kernel: *** Stack Guardword corrupted kernel: *** Stack corrupted, server aborting
In the first message, “limit” is the address of the end of the stack guard area, and “sp” is the current value of the stack pointer.
kernel: *** Stack overflow detected: limit: 0x%lx sp: 0x%lx kernel: *** Stack corrupted, server aborting
The default value for stack guard size is appropriate for most applications. However, if you experience server shutdown from either stack guardword corruption or stack overflow, increase stack guard size by a 2K increment. Each configured user connection and worker process has a stack guard area; thus, when you increase stack guard size, you use up that amount of memory, multiplied by the number of user connections and worker processes you have configured.
Rather than increasing stack guard size to avoid stack overflow problems, consider increasing stack size . The stack guard area is intended as an overflow area, not as an extension to the regular stack.
SAP ASE allocates stack space for each task by adding the values of the stack size and stack guard size parameters. stack guard size must be configured in multiples of 2K. If the value you specify is not a multiple of 2K, sp_configure verification routines round the value up to the next highest multiple.