Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   Effect of Configuration on Memory Utilization > Configuration Parameters That Affect Memory Utilization >

STACKSIZE

The STACKSIZE parameter indicates the initial stack size for each thread. The database server assigns the amount of space that this parameter indicates to each active thread. This space comes from the virtual portion of database server shared memory.

To reduce the amount of shared memory that the database server adds dynamically, estimate the amount of the stack space required for the average number of threads that your system runs and include that amount in the value that you set for SHMVIRTSIZE. To estimate the amount of stack space that you require, use the following formula:

stacktotal = STACKSIZE * avg_no_of_threads 
avg_no_of_threads
is the average number of threads. You can monitor the number of active threads at regular intervals to determine this amount. Use onstat -g sts to check the stack use of threads. A general estimate is between 60 and 70 percent of the total number of connections (specified in the NETTYPE parameters in your ONCONFIG file), depending on your workload.

The database server also executes user-defined routines (UDRs) with user threads that use this stack. Programmers who write user-defined routines should take the following measures to avoid stack overflow:

If you cannot avoid stack overflow with these measures, use the STACK modifier of the CREATE FUNCTION statement to increase the stack for a particular routine. For more information on the CREATE FUNCTION statement, see the IBM Informix: Guide to SQL Syntax.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]