Tracing Low Memory event

Trace events have also been added to trace memory pressure situations. It helps to identify pressure on page cache or pinned memory heap.

While performing read/write operations on page cache, 'lowmem' thresholds is calculated. If the number of client free pages goes below this threshold, VxFS starts its own pager. The trace entries provide details about free client pages and whether the low memory condition is detected.

In this example, the trace hook identifier for VxFS memory pressure situations is 0E5. For tracing memory pressure:

# trace -a -j 0E5 &
# trcon
# cat script.sh (file on VxFS file system)
# trcoff
# trcstop
# trcrpt > trace.out

Sample output with entries for low page cache:

0E1 0.000619916 VxFS lowpgcache: numclientframes AA96, trigger_limit CC880, 
lowmem detected 0000

VxFS checks the available pinned heap and calculates the limitalloc, limitsuff, and limitfree thresholds. If pinnable memory goes below the 'limitalloc' threshold, pinned memory allocation for new inodes and buffers is allowed in certain scenarios only. The 'limitsuff' threshold is limit to decide whether in-sufficient pinned memory situation has reached. If 'limitfree' threshold is hit then VxFS starts freeing allocations which are not in use currently. Basically there are pools or caches for various types of data structures. Whenever VxFS needs any of these data structures, memory from theses pools or caches are taken instead of asking the operating system every time. When VxFS is done with the data structure, the memory is returned back to pool or cache as the case may be. If memory pressure is noticed and this threshold is hit then VxFS looks at these pools, caches and see whether any memory can be given back to system. The trace entries provide details about these thresholds and pinnable memory left.

The trace entries provide details about these thresholds and pinnable memory left.

Sample output with entries for low pinned heap:

0E1 0.926113776 0.118139 VxFS lowpinnedheap: limitalloc = 17B8E, 
limitsuff = 14C1C, limitfree = 11CAA, pinnable_left = 71E55