TIBCO LogLogic LMI - The free -m command in a ssh session displays a low value for the amount of free physical memory

TIBCO LogLogic LMI - The free -m command in a ssh session displays a low value for the amount of free physical memory

book

Article ID: KB0077067

calendar_today

Updated On:

Products Versions
TIBCO LogLogic Log Management Intelligence all versions

Description

The free -m command can be used to check the amount of free physical memory. In some scenarios even with a high amount of physical RAM allocated to the appliance the free command will show a low free value. This could lead to the impression that the system is running out of memory or cause alerts with SNMP solutions.

Issue/Introduction

When checking the free -m or using an SNMP solution to monitor the free amount of system memory the value will seem to imply the system is low on physical memory

Resolution

The below is an output of the free -m command on a system with 32GB of RAM:

Logapp root:~ 0$ free -m
                   total       used       free       shared    buffers    cached
Mem:               32057      23792       8265       1137        926      12421
-/+ buffers/cache:            10444      21613
Swap:              13311          0      13311


In this example the total amount of available memory is 32GB. 23GB is used by processes and 8gb is free for other applications. Don't be overly alarmed by the first line which shows that only 8GB is free. If you look at the usage figures you can see that most of the memory use is for buffers and cache. Linux (and Windows too) always tries to use RAM to speed up disk operations by using available memory for buffers (file system and metadata) and cache (pages with actual contents of files or block devices). This helps the system to run faster because disk information is already in memory which saves I/O operations. If space in memory is needed by applications then Linux will free up the buffers and cache to yield memory for the applications. The longer the system is running the smaller the number you will see for the free memory. If you observe the -/+ buffers/cache free memory output above you can see that there is 21GB of memory free; this comes from the sum of the free, cache and buffer values on the first line, thus indicating these 3 categories of memory are all considered available memory but in different forms.

If you want to use an SNMP solution to gauge if the system is running out of physical memory then the SNMP counters you can monitor are the Memory Cache (free) and swap space (used). You can't monitor the -/+ buffers/cache free via SNMP because these are 2 separate counters, unless your SNMP solution can combine them.

When the appliance runs out of physical memory then swap space is used. High swap usage is a reliable sign the appliance is actually low on memory.