SUSE Support

Here When You Need Us

'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 SP2
SUSE Linux Enterprise Server 15 SP3
SUSE Linux Enterprise Server 15 SP4

Situation

Starting with SLE15, 'free' (and other procps tools) calculates the "used" memory according to its man-page as follows:
  used   Used memory (calculated as total - free - buffers - cache)


However, this formula will result in a too low value.

Resolution

In order to fix this, please install libprocps7-3.3.15-150000.7.25 and procps-3.3.15-150000.7.25 or higher. The below example can be used to install and confirm the affected packages are up-to-date. This can be done by installing the patch SUSE-SLE-<patch-name-and-OS-version>-2022-2944 as described below.

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

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.