'free' command reports misleading "used" value
This document (000020894) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Server 15 SP3
SUSE Linux Enterprise Server 15 SP4
Situation
used Used memory (calculated as total - free - buffers - cache)
However, this formula will result in a too low value.
Resolution
1. Verify whether the patch is marked as needed (hence, not installed):
# zypper patches | grep -i '2022-2944.*needed'
2. If so, proceed with the patch installation by running:
# zypper in -t patch SUSE-SLE-<patch-name-found>-2022-2944
Confirm the libprocps7-3.3.15-150000.7.25.1.x86_64 reports the latest changes for the free command by running:
# rpm -q --changelog libprocps7-3.3.15-150000.7.25.1 | head * Wed Jun 22 2022 werner@suse.de - Add the patches * procps-3.3.17-library-bsc1181475.patch * procps-3.3.17-top-bsc1181475.patch which are backports of current newlib tree to solve bug bsc#1181475 * 'free' command reports misleading "used" value
Important
These packages fix the issue and the way to calculate the used column in the free command output. Note that cache is not of used memory, as cache become immediately recycled if memory is required, whereas memory used for tmpfs are used memory. In other words, now, used = total - available. For example:
sles15-sp3:/var/cache/zypp # free -k total used free shared buff/cache available Mem: 990456 525152 156796 16348 473616 465304 Swap: 1334248 44800 1289448
Total - available
990456 - 465304 = 525152
However, the manual page for the free program still reports the below and old formula instead:
used Used memory (calculated as total - free - buffers - cache)
This has been reported to Engineering and a new Bugzilla case has been raised.
Cause
Shared memory is not taken into account and this can be misleading.
This is not observed in SLES12 where "used" is simply calculated as follows:
used Used memory (calculated as total - free)
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000020894
- Creation Date: 16-Dec-2022
- Modified Date:22-Dec-2022
-
- SUSE Linux Enterprise Server
- SUSE Linux Enterprise Server for SAP Applications
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com