iii engine v0.11.2: unbounded in-memory growth under sustained hook writes (5 GB → 11.8 GB in ~4 h, kernel OOM-killed)

Author: ChillingWombatCreated Sep 22, 2026Updated Sep 29, 2026

Summary

iii engine v0.11.2 (the version pinned by @agentmemory/[email protected]) exhibits unbounded in-memory growth under sustained hook-write load, eventually triggering kernel OOM-kills. On a 30 GB RAM Linux host, iii grew from ~1.3 GB at startup to 11.8 GB over ~4 hours before being OOM-killed — twice in one day.

Environment

  • @agentmemory/agentmemory 0.9.29 (latest)
  • iii engine v0.11.2 (~/.agentmemory/bin/iii --config iii-config.yaml)
  • iii-sdk 0.11.2 (pinned)
  • Linux (Ubuntu), 30 GB RAM, kernel OOM killer active
  • Agent client: Devin CLI with the official hooks.devin.json hook config — i.e. the shipped template, unmodified (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse on all tools, SessionEnd)

Observed behavior

Measured RSS growth under routine agent activity (~1 long Devin session, per-tool-call observations flowing through compress → embed → index → graph):

14:48  iii = 5.0 GB
15:13  iii = 7.9 GB
16:38  iii = 8.3 GB
18:24  iii = 9.4 GB
18:29  iii = 10.3 GB   ← system swap pegged at 100%, RAM 29/30 GB
18:35  kernel OOM-kill: anon-rss 10.8 GB (peak 11.8 GB)

Earlier the same day it was OOM-killed at 6.6 GB anon-rss. Growth rate was roughly ~1.3–2.4 GB/hour depending on LLM provider availability — when the configured provider was in quota-cooldown (HTTP 429 + circuit_breaker_open), the engine still grew, suggesting queued/retrying work accumulates too.

During pressure windows, the logs show state::get / state::set timeouts at 180 s — same failure shape as #204.

What we isolated

  1. The iii-observability worker with exporter: memory accounts for ~80 % of the growth. After removing the observability block from iii-config.yaml, growth dropped from ~2.4 GB/hr to ~0.4 GB/hr. The remaining growth looks like genuine state/index accumulation (store on disk is ~3.7 GB across state_store.db, stream_store, graph/index files — consistent with the O(n) kv.list behavior in #814).

  2. Cgroup accounting note for anyone reproducing with MemoryMax: memcg usage counts page cache of the file-based state store, not just iii anon RSS. With MemoryMax=3G the wall arrives at ~30 min while RSS only reads ~1.6 GB.

  3. Cannot self-upgrade: replacing the binary with v0.24.2 fails — the new engine expects the worker-compose.yaml schema and a worker protocol incompatible with the pinned [email protected]. The worker never registers; agentmemory sits in reconnect loops. Rolled back.

Reproduction

  1. Install @agentmemory/[email protected], let it fetch iii v0.11.2.
  2. Register hooks with a high-volume agent (Devin hooks.devin.json, or Claude Code hooks) — per-tool-call writes are the trigger.
  3. Run a session for a few hours; watch iii RSS climb monotonically, never plateau.

Current containment (works, but shouldn't be necessary)

ini
# systemd user override for agentmemory.service
MemoryMax=4G
MemoryHigh=3G
RuntimeMaxSec=1800   # graceful recycle before the memcg wall
Restart=always

Related issues

  • #204 — crashes under sustained hook writes, state::set timeouts
  • #278 — iii 0.11.2 crash/restart loop writing 129 GB of logs
  • #519 — 137 GB log-flood feedback loop (referenced in shipped iii-config.yaml comments)
  • #814 — graph operations timing out via O(n) kv.list on large corpora

Ask

Is there a known fix or configuration to bound iii's in-memory footprint (queue/pubsub/state buffers) on v0.11.2? And is there a roadmap for agentmemory to move to a current iii engine line — the 0.11.2 → 0.24.x config/protocol migration isn't possible from the client side today.