ganglia / monitor-core

Ganglia Monitoring core
BSD 3-Clause "New" or "Revised" License
490 stars 246 forks source link

Add Slab memory to linux-specific memory metrics #297

Closed afbjorklund closed 6 years ago

afbjorklund commented 6 years ago

According to later versions of procps, the top(1) value for "buff/cache" memory is supposed in addition to Buffers/Cached to also include Slab.

Interestingly, the biggest impact of this is in the "used" memory shown since that value is not reported but just calculated using the others:

// {"Cached",       &kb_page_cache},
kb_main_cached = kb_page_cache + kb_slab;
kb_swap_used = kb_swap_total - kb_swap_free;
kb_main_used = kb_main_total - kb_main_free - kb_main_cached - kb_main_buffers;

In order to have more accurate memory reporting on Linux, make sure to include this metric in the default configuration for the memory module.