Skip to content

Lab: headroom message marks memory holders that are the caller's own children #91

Done

Description

@mareklangiewicz

Lab issue (luagnd gndx.hoststat headroom message, used by the lab's capped units). Part of #17.

What happened

A capped build waited for headroom. The largest memory holder was the session's own emmylua_ls (1.4 G), a child of the agent. The headroom message listed it like any other process, and auto mode refused to kill it because nothing showed that it belonged to the session (2026-11-24).

Proposed (unprobed)

Mark each process in the headroom message's top holders that is a descendant of the caller's session, for example (ours). Then it is clear which memory the caller can free.

Activity

  1. mareklangiewicz commented on Nov 24, 2026

    @mareklangiewicz
    OwnerAuthor

    Fixed in luagnd 1c2114e (unpushed).

    • Cause. (under claude) already existed (baf0a20, 2026-11-21). But this host runs two claude sessions (pids 48246 and 361746), so the tag didn't say whose emmylua_ls it was. Two sessions' children would also merge into one (under claude) … (2) line, as the red test showed.
    • Fix. With tag_parents, hoststat.holders walks the caller's ancestry from /proc/self (at most 64 hops) to its nearest tagged ancestor. That parent's children read (under claude, ours) and group apart from another session's (under claude). sysunit's headroom refusal and gradle's holder report get it through their existing tag_parents = AGENT_PARENTS, with no new option.
    • Real /proc, from a luajit under this session: emmylua_ls (under claude, ours) 1.3G, claude 862M (2), qs 280M, ….
    • Tests. taggedParents/aChildOfTheCallersOwnAgentIsOurs was red before the change (both merged into (under claude) 1.5G (2)). gndx gate all PASS.
    • Still open, Marek's call. The headroom wait line is a structured ctx.log:i { kind = 'sysunit.headroom.wait', … } record, and gnd.log's default renders it as table: 0x… (Lab and gates (gndx emmylua, Lua-side gates) #17, 7130977942). The holders only appear in the final refusal, not while the unit waits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions