Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: On Linux hosts without swap, the agents slice MemoryHigh throttles every agent for hours instead of OOM-killing the runaway #39195

Closedmatthias-scale(GitHub profile, opens in a new tab) opened this issue 0 comments

Area

apps/server

Steps to reproduce

  1. Run the T3 server as a systemd user service on a Linux host with 16 GiB RAM and no swap.
  2. Let several agents run builds, type checks and test runners at once, so the agents slice grows past MemoryHigh.
  3. Watch memory.pressure and memory.events (high) of the agents slice.

Expected behavior

A runaway agent or tool is OOM-killed inside its own cgroup, and the rest of the host keeps working.

Actual behavior

agentSliceMemoryLimits in apps/server/src/process/agentScope.ts sets MemoryHigh = max(RAM − 6 GiB, RAM / 2) and MemoryMax = max(RAM − 4 GiB, RAM × 0.75). On 16 GiB that is 10 GiB and 12 GiB.

Without swap, reclaim at MemoryHigh can only drop page cache. Anonymous memory has nowhere to go, so the kernel throttles every process in the slice and keeps throttling. MemoryMax is never reached, so nothing is killed and the stall does not end by itself.

On one 16 GiB host without swap (2026-11-10) the agents slice logged about 68,000 s (about 19 h) of full memory stall. All agents on the host were frozen in that time, with no OOM kill.

The limit is set again at every server start and on every RAM change (#30581), with --runtime drop-ins that outrank user drop-ins, so a host owner cannot turn it off in a lasting way.

Related:

  • #18350: same no-OOM throttling, closed as intended
  • #24708: asks for a host-managed opt-out, closed as completed, but #24717 is still open and main at cfd24da4a7 still sets MemoryHigh unconditionally

Suggested fix

  • When the host has no swap (SwapTotal is 0, or the slice's memory.swap.max is 0), set MemoryHigh=infinity and rely on MemoryMax, so a runaway is killed instead of throttled for hours.
  • Or merge #24717, so a host can manage the slice limits itself.

Workaround

After each server start, run systemctl --user set-property --runtime app-t3code-agents.slice MemoryHigh=infinity (re-applied by a timer), and put hard caps (MemoryMax, MemorySwapMax=0) on each agent scope through a systemd prefix drop-in, so one agent's OOM stays inside its own scope.

Impact

Major degradation or frequent failure

Version or commit

0.1.11-nightly.20261117.4825; code checked on main at cfd24da4a7

Environment

Linux x64, systemd user service, 16 GiB RAM, no swap, many concurrent agents

  1. tanstack-source added labelsbug

  2. juliusmarminge closed this

Sign in to join this conversation.