UIM - How does CDM calculate memory usage on Linux

book

Article ID: 118534

calendar_today

Updated On:

Products

DX Infrastructure Management NIMSOFT PROBES

Issue/Introduction

What formula does the cdm probe use to calculate memory usage?

How does CDM calculate memory usage on Linux?

Environment

Any UIM Version

Cdm probe any version above 5.40

Resolution

cdm reads the proc/meminfo file to obtain the memory usage qos data. For example:

# cat /proc/meminfo
MemTotal:        8175444 kB
MemFree:          154404 kB
Buffers:               4 kB
Cached:          1978176 kB
SwapTotal:       8257532 kB
SwapFree:        2962720 kB

 The probe uses the following formulas for the different qos metrics:

 QOS_MEMORY_TOTAL (Total Memory MB) = (MemTotal + SwapTotal) / 1024 QOS_PHYSICAL_MEMORY_TOTAL (Physical Memory MB) = MemTotal / 1024

QOS_MEMORY_SWAP (SwapUsed MB) = (SwapTotal - SwapFree) / 1024
QOS_MEMORY_USAGE (Total Memory Used MB) = (MemTotal - MemFree - Buffers - Cached + SwapUsed) /1024
QOS_MEMORY_PHYSICAL (Physical Memory Used MB) = (MemTotal - MemFree - Buffers - Cached) /1024
QOS_MEMORY_PERC_USAGE (Total Memory Used %) = (Total Memory Used/Total Memory) * 100
QOS_MEMORY_PHYSICAL_PERC (Physical Memory Used %) = (Physical Memory Used/Physical Memory) * 100


Since cdm v5.40, the QOS_MEMORY_PHYSICAL metric, by default, excludes the buffer and cache.

If you follow the resolution in https://knowledge.broadcom.com/external/article?articleId=47141 to include the buffer and cache, the calculation for the metric is

QOS_MEMORY_PHYSICAL (Physical Memory Used MB) = (MemTotal - MemFree) /1024

Additional Information

  • The meminfo file reports the memory in KB and the probes reports the QOS Metric in MB hence we divide by 1024 in the above formulas.
  • You will very likely see a small difference in the values in meminfo and the QOS metric. Memory usage is a constantly shifting value and the probe will have collected at a slightly different time to when you viewed the meminfo file.

 

Related KB's:

Article title: How does CDM calculate memory usage on Linux

Article title: How does CDM calculate Memory Usage in Solaris?

Article title: How is Memory information calculated by cdm probe for HP-UX based systems

Article title: How Is "Swap Usage" activity calculated by the cdm probe in Solaris

Article title: How Is "memory paging" activity calculated by the cdm probe?

Article Title: Monitoring Total Processor / CPU utilization on Windows with UIM

Artike title: CDM Alert showing 100% swap memory used on Linux