Display all user threads and session memory usage

Use the onstat -g ses command to display all user sessions and memory usage by session ID.

When the session shares the memory structures in the SSC, the value in the used memory column should be lower than when the cache is turned off. For example, Figure 1 shows sample onstat -g ses output when the SQL statement cache is not enabled. Figure 2 shows output after the SQL statement cache is enabled and the queries in Session 4 are run again. Figure 1 shows that Session 4 has 45656 bytes of used memory. Figure 2 shows that Session 4 has less used bytes (36920) when the SQL statement cache is enabled.
Figure 1. onstat -g ses output when the SQL statement cache is not enabled
session                                      #RSAM    total    used     dynamic
id       user     tty      pid      hostname threads  memory   memory   explain
12       informix -        0        -        0        12288    7632     off
4        informix 11       5158     smoke    1        53248    45656    off
3        informix -        0        -        0        12288    8872     off
2        informix -        0        -        0        12288    7632     off
Figure 2. onstat -g ses output when the SQL statement cache is enabled
session                                      #RSAM    total    used     dynamic
id       user     tty      pid      hostname threads  memory   memory   explain
17       informix -        0        -        0        12288    7632     off
16       informix 12       5258     smoke    1        40960   38784     off
4        informix 11       5158     smoke    1        53248   36920     off
3        informix -        0        -        0        12288    8872     off
2        informix -        0        -        0        12288    7632     off

Figure 2 also shows the memory allocated and used for Session 16, which runs the same SQL statements as Session 4. Session 16 allocates less total memory (40960) and uses less memory (38784) than Session 4 (Figure 1 shows 53248 and 45656) because Session 16 uses the existing memory structures in the SQL statement cache.


Copyright© 2018 HCL Technologies Limited