Plugin calculates free memory usage on Linux incorrectly

Bug #1547918 reported by Dirk Porezag on 2016-02-20
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
xfce4-systemload-plugin (Ubuntu)
Undecided
Unassigned

Bug Description

The plugin calculates the memory usage on Linux as (MemTotal - (MemFree+Buffers+Cached)). This is not quite correct since:
* Shared memory (Shmem in /proc/meminfo) is contained in the "cached" memory figure yet not reclaimable in most cases
* SReclaimable is slab memory that may be reclaimed in principle

So a much more realistic figure for the actual memory usage is (Total - (Free+Buffers+Cached-Shmem+SReclaimable)). With the current (old) setting the plugin displays a memory usage that is far too low for systems that run applications with significant shared memory usage - a prominent example would be virtual machines running in VMware player / workstation.

In principle one would also need to subtract HugePages_Rsvd but since this is mostly used on servers with big databases it's probably not such a big issue for desktop systems.

This issue should most likely be fixed upstream.

Package: xfce4-systemload-plugin
Package version: 1:1.1.1-1ubuntu2 (but issue is present in Ubuntu 15.10 as well)
Release: Ubuntu 14.04.4 LTS

Dirk Porezag (dirk-porezag) wrote :

Addendum: Arguably this might be considered a feature request rather than a bug and the fix possibly isn't the final answer since there may be situations where some shared memory pages are actually reclaimable. However, in most cases shared memory pages will actually be used heavily and IMHO it's better to over-estimate memory usage than to display a memory usage that is too low.

The attachment "proof of concept patch for fixing the issue" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xfce4-systemload-plugin (Ubuntu):
status: New → Confirmed

>This issue should most likely be fixed upstream.

Please let them know. Thanks.

https://bugzilla.xfce.org/

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers