Skip to content

[Bug]: MemoryPlugin on Linux uses MemFree only and ignores reclaimable buff/cache (MemAvailable) #226

@mwessman-amd

Description

@mwessman-amd

Summary

On Linux, MemoryPlugin appears to evaluate memory pressure using only MemFree from free -h, and computes used memory as mem_total - mem_free. This ignores reclaimable page cache/buffers that Linux can free under pressure.
As a result, the plugin can report memory usage as too high (or free memory too low) even when MemAvailable indicates there is still sufficient usable memory.

Here is a screenshot of free -h showing low free but much higher available. This is very common for our AMD cluster nodes:

Image

Steps to reproduce

  1. Run on a Linux host with significant page cache (common on long-running systems).
  2. Check memory view:
    free -h
    • free is relatively low
    • buff/cache is high
    • available is significantly higher than free
  3. Run MemoryPlugin:
    node-scraper run-plugins MemoryPlugin --ratio 0.90
  4. Inspect the plugin result/log output for memory values and analysis status.

Version

1.1.6

Install method

Editable install from source (pip install -e .)

Python version

3.12.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions