GS_SESSION_MEMORY_DETAIL
GS_SESSION_MEMORY_DETAIL collects statistics about thread memory usage by the memory context. When enable_thread_pool is set to on, this view contains memory usage of all threads and sessions. If the GUC parameter enable_memory_limit is set to off, this view is unavailable.
The memory context TempSmallContextGroup collects information about all memory contexts whose value in the totalsize column is less than 8192 bytes in the current thread, and the number of the collected memory contexts is recorded in the usedsize column. Therefore, the totalsize and freesize columns for TempSmallContextGroup in the view display the corresponding information about all the memory contexts whose value in the totalsize column is less than 8192 bytes in the current thread, and the usedsize column displays the number of these memory contexts.
You can run the SELECT * FROM gs_session_memctx_detail (threadid,''); statement to record information about all memory contexts of a thread into the threadid_timestamp.log file in the $GAUSSLOG/pg_log/${node_name}/dumpmem directory. threadid can be obtained from sessid in the following table.
Table 1 GS_SESSION_MEMORY_DETAIL columns