Skip to content

[Bug]: Memory warning blames agents when a job outside T3 is held at its own cgroup memory limit #45374

Done

Description

@josephv123

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

Server: machine load warnings (apps/server/src/resourceTelemetry/HostResources.ts), web and mobile sidebar warnings

Steps to reproduce

  1. On an otherwise quiet Linux host running the T3 server under systemd (agents in app-t3code-agents.slice), start a job outside T3's cgroups that is held at its own memory limit. For example:
    systemd-run --user --collect -p MemoryHigh=300M -p MemoryMax=900M -p MemorySwapMax=1G python3 -c "
    import time
    b = bytearray(600 * 1024 * 1024)
    t = time.time()
    while time.time() - t < 60:
        for i in range(0, len(b), 4096): b[i] = (b[i] + 1) & 255
    "
  2. Leave the agents idle or lightly busy, then compare /proc/pressure/memory with memory.pressure in the agents slice and in the job's unit.
  3. Look at the sidebar, or at machine.pressure from the t3_environment_read MCP tool.

Expected behavior

T3 says agents are slowed by memory only when agents (or the T3 server) are actually stalling, or when the host itself is short on memory. A job throttled by its own cgroup limit, with free memory left and the agents unaffected, is that job's problem and shouldn't produce "Memory is slowing agents down".

Actual behavior

The warning turns severe and says "Memory is slowing agents down". Each thread row then says "Using … while memory is slowing agents down. Stopping it helps the rest." and offers Force stop. Stopping an agent would change nothing.

Real case on a 16-thread, 14 GB host: a CPU benchmark ran in a user-made batch.slice with MemoryHigh=5G. Readings taken at the same moment:

PSI (pressure stall information) memory full avg10 value
/proc/pressure/memory (whole host) 33.23
batch.slice (the throttled benchmark) 35.45
app-t3code-agents.slice 0.00
t3code.service 0.00

t3_environment_read at the same moment returned "pressure":{"memory":"severe","cpu":"none","io":"none","disk":"none"}, with "cpuUsedPercent":4 and "memoryAvailableGb":2.5.

Why

nextPressureLevels takes the worst of three memory grades. One is the host-wide full avg10 (elevated at 2, severe at 10), and it is graded independently of the agents slice. At the root, full counts time when every non-idle task is stalled. Agents spend most of a turn idle, waiting on the network for the model. So a single task stalled at its own memory.high can push the host-wide full to the level of its own stall, even though nothing else on the machine is waiting. The agents' reading (0.00 here) never gets a chance to overrule it.

Related: #25918 (pressure stall reporting design), #44899 (same kind of false alarm for I/O pressure).

Impact

A false alarm that steers users toward force-stopping healthy agents. Any user who caps a build, training job or container with cgroup limits on the same host can hit it. The machine also looks severely loaded to agents that read machine.pressure to pick the least loaded machine.

Version or commit

0.1.14-nightly.20261128.5399; the grading code is unchanged on main at 6411254.

Environment

Ubuntu 26.04 Server, Linux 7.0, cgroup v2, T3 server running as a systemd user service, zram swap.

Workaround

None in T3. Lowering the job's memory use, or raising its limit, clears the warning.

Possible fix

When the agents slice can be read, use the host-wide full reading to say "slowing agents" only if the agents slice or the server's own cgroup is also stalling, or if available memory is actually low. Otherwise, at most mention that something else on the machine is short of memory, without offering to stop agents.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions