Skip to content

inspect_proc: capture additional memory fields to aid OOM diagnosis #3182

@erfrimod

Description

@erfrimod

Problem

inspect_proc in openhcl/underhill_core/src/inspect_proc.rs captures memory telemetry
from /proc/meminfo and per-process /proc/<pid>/status, used both for on-demand
inspection and periodic telemetry logging.

I had to investigate an OOM error recently and had to rely on the inspect_proc output. I think it would be worth collecting additional fields for future investigations. These are just a couple suggestions, maybe there are other fields that would be better?

/proc/meminfo captures 11 fields (MemTotal, MemFree, Mapped, Slab,
AnonPages, SUnreclaim, KernelStack, PageTables, Shmem, Percpu,
Committed_AS) but is missing:

Field OOM relevance
MemAvailable Pairs with MemTotal and MemFree.
SReclaimable Paired with the existing SUnreclaim.
Mlocked Memory locked via mlock() — non reclaimable memory.

/proc/<pid>/status captures 5 fields (VmSize, VmPeak, VmRSS, VmHWM,
RssAnon) but is missing:

Field OOM relevance
RssFile File-backed RSS (reclaimable). Completes the RSS breakdown.
RssShmem Shared memory RSS. RssAnon + RssFile + RssShmem = VmRSS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions