SReclaimable should not be included in system memory usage

Issue #71 resolved
Michael Schürig created an issue

Say I have a check for my system like this

check system myserver
  if memory > 10 GB for 5 cycles
    then alert

Then monit complains if the limit is exceeded due to filesystem memory usage. This is not very helpful; I want the filesystem to use all memory for caching unless it is otherwise needed. What I want to monitor is the amount of memory used by processes. Monit ought to keep these two kinds of memory usage apart.

Comments (10)

  1. Tildeslash repo owner

    Monit subtracts the buffer/cache from the system memory usage ... for example on Linux it takes the system memory informations from /proc/meminfo and computes the usage as: (MemTotal - MemFree - Buffers - Cached). Similarly on other platforms.

    What platform is it related to?

  2. Michael Schürig reporter

    Sorry, for leaving this out. This is monit 5.8.1 on Linux (Debian/testing) and apparently Cached was not subtracted.

  3. Tildeslash repo owner

    Please can you post output from /proc/meminfo?

    Was Monit installed from the official source code or precompiled binary or using some 3rd party package? (possibly with some modifications)

    Monit always subtracts Cached as you can see in src/process/sysdep_LINUX.c => if there are no 3rd party modifications of memory usage formula, your kernel most probably presents memory usage in some unexpected format ... which kernel version it is?

  4. Michael Schürig reporter
    • changed status to open

    I've tracked down the cause for the memory consumption. It was the kernel's Slab allocation. I think monit should subtract SReclaimable from the consumed memory.

    Sorry for the mess.

  5. Michael Schürig reporter

    Also, for a system check it is possibly more useful not to check against memory consumption, but instead check against MemAvailable.

  6. Log in to comment