![]() | ![]() |
Home |
|
|
Troubleshooting and Error Messages Guide |
|
| Chapter 3 Error Message Writeups |
|
| Error and Exception Handling Errors |
|
| Error 3626 |
17
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
At start-up, Adaptive Server allocates one stack for each configured user connection. These stacks are in contiguous areas of memory, with a guard area at the end of each stack. Adaptive Server periodically checks to determine whether the stack point for a user connection has entered the stack guard area adjacent to that connection's stack. Error 3626 occurs when this has happened.
Because Error 3626 occurs before any stack corruption, Adaptive Server does not shut down. Instead, it aborts the user process and rolls back any transactions that existed for that process.
An Adaptive Server process usually encounters this error for one of two reasons:
The stack size is too small. The information placed on the stack is valid but its total size exceeds the specified stack size. This is often caused by a single, complex query which requires more than the average amount of stack space. Long where clauses, long select lists, and deeply nested stored procedures can contribute to this type of stack overflow and Error 3626.
An incorrectly handled error results in recursive calls which eventually fill the stack, regardless of its size.
If this error occurs frequently, there is increased risk a process may overflow its stack area and corrupt another process' stack. This situation will cause Adaptive Server to shutdown with the error:
kernel: *** Stack guardword corrupted.
See Stack Guardword Error for more information.
If this error occurs with a transaction which contains a where or where-in clause, you may need to rewrite the query. See Error 404 for additional actions which may be required.
If this error occurs because a complex query has run out of stack area, you can resolve it in one of two ways:
Break up the query into smaller pieces.
Use the following query to increase the stack size:
1> sp_configure "stack size", new_value 2> go
Shut down and restart Adaptive Server to make these changes take effect.
When changing the stack size on Adaptive Server, consider the following facts:
The stack size should always be an even increment of 2K (2,048 bytes). If a specified stack size is not divisible by 2K, sp_configure will round it up to the next 2K increment.
Increase the stack size in small increments to avoid making it too large. If the stack size is too large, you will lose cache space and you may be unable to start Adaptive Server.
Adaptive Server requires more memory for each configured user connection and device when the stack size increases. Therefore, increasing the stack size without increasing the total memory configuration parameter will result in less total cache space for Adaptive Server. This can affect performance.
Refer to "sp_configure" in the Reference Manual and "Setting Configuration Parameters" in the System Administration Guide for information about sp_configure and stack size and stack guard size configuration parameters.
Refer to the Performance and Tuning Guide and "Configuring Memory" in the System Administration Guide for information about configuring Adaptive Server memory.
All versions
|
|