iii engine v0.11.2: unbounded in-memory growth under sustained hook writes (5 GB → 11.8 GB in ~4 h, kernel OOM-killed)
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/agentmemory0.9.29 (latest)iiiengine v0.11.2 (~/.agentmemory/bin/iii --config iii-config.yaml)iii-sdk0.11.2 (pinned)- Linux (Ubuntu), 30 GB RAM, kernel OOM killer active
- Agent client: Devin CLI with the official
hooks.devin.jsonhook config — i.e. the shipped template, unmodified (SessionStart,UserPromptSubmit,PreToolUse,PostToolUseon 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
The
iii-observabilityworker withexporter: memoryaccounts for ~80 % of the growth. After removing the observability block fromiii-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 acrossstate_store.db,stream_store, graph/index files — consistent with the O(n)kv.listbehavior in #814).Cgroup accounting note for anyone reproducing with
MemoryMax: memcg usage counts page cache of the file-based state store, not justiiianon RSS. WithMemoryMax=3Gthe wall arrives at ~30 min while RSS only reads ~1.6 GB.Cannot self-upgrade: replacing the binary with v0.24.2 fails — the new engine expects the
worker-compose.yamlschema and a worker protocol incompatible with the pinned[email protected]. The worker never registers; agentmemory sits in reconnect loops. Rolled back.
Reproduction
- Install
@agentmemory/[email protected], let it fetch iii v0.11.2. - Register hooks with a high-volume agent (Devin
hooks.devin.json, or Claude Code hooks) — per-tool-call writes are the trigger. - Run a session for a few hours; watch
iiiRSS climb monotonically, never plateau.
Current containment (works, but shouldn't be necessary)
# systemd user override for agentmemory.service
MemoryMax=4G
MemoryHigh=3G
RuntimeMaxSec=1800 # graceful recycle before the memcg wall
Restart=alwaysRelated issues
- #204 — crashes under sustained hook writes,
state::settimeouts - #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.yamlcomments) - #814 — graph operations timing out via O(n)
kv.liston 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.
Source: rohitg00/agentmemory