Session memory
The database server uses the virtual portion of shared memory mainly for user sessions. Most of the memory that each user session allocates is for SQL statements. You can determine which session and which statements are using large amounts of memory. If necessary, you can set the SESSION_LIMIT_MEMORY configuration parameter to limit the amount of memory available to a session.
- onstat -g mem
- onstat -g stm
14
, 16
, 17
in the names output column. The heapsz column in the output in onstat -g stm output shows the amount of memory that is used by the statement. An asterisk (*) precedes the statement text if a cursor is open on the statement. The output does not show the individual SQL statements in an SPL routine.
To display the memory for only one session, specify the session ID in the onstat -g stm option. For an example, see Monitor session memory with onstat -g mem and onstat -g stm output.
Set the SESSION_LIMIT_MEMORY configuration parameter to limit how much memory a session can allocate, and can prevent individual sessions from monopolizing system resources. This limit does not apply to a user who holds administrative privileges, such as user informix or a DBSA user.
For example, to limit each session to 10 MB of memory, set SESSION_LIMIT_MEMORY 102400
in the ONCONFIG file.