Applications Systems

How Linux Agent polls memory statistics

This article explains how the Linux Agent polls memory statistics and the difference between Volume memory and CPU & Memory utilization

First published date

2/16/2022 1:53 AM

Last published date

7/23/2025 9:04 PM

Overview

 
  • There are two ways that the SolarWinds Platform shows the memory utilization on Linux devices.

1- CPU & Memory (information stored in CPULoad tables)
2- Physical / Virtual Memory (information stored in Volumes tables)

image.png

 

  • How is Memory utilization polled?


The Agent runs Python scripts using Linux commands to pull the memory information.

The following Linux commands are used:

#free
image.png

#vmstat
image.png

#cat /proc/meminfo
image.png

  • How is the memory utilization shown in the web console ?

Volume Memory utilization is shown in the Disk Volumes widget in Web console.

image.png

CPU & Memory utilization is shown in the Average Memory Usage widget and CPU & Memory.

image.png

Issue: Sometimes, the difference between the memory utilization in "CPU & Memory" x "Volume Memory" is enormous and can confuse some customers. It happens because the way we calculate both methods is different.
 

Product section

Server Application Monitor

Cause

image.png

Total memory = MemTotal
Used memory = MemTotal - (MemFree + Buffers + Cached)

Example:
24607824 - (216736 + 256252 + 18392896)
24607824 - 18865884 = 5,741,940 (5.7 Gb)

image.png


The Volume Memory is the Used

23 Gb

image.png

Resolution

The Linux Agent polls memory statistics from the /proc filesystem (/proc/meminfo) as follows:

ValueCapacityUsed
Physical MemoryMemTotalMemTotal-MemFree
Virtual MemoryMemTotal+SwapTotal(MemTotal+SwapTotal) - (MemFree+SwapFree)
Swap SpaceSwapTotalSwapTotal-SwapFree
Shared MemoryShmemShmem
Cached MemoryCachedCached