OpenClaw
An OpenClaw Matrix gateway retained 4.2 MB of JavaScript heap per minute
A closed OpenClaw report measured GC-bracketed heap growth of about 4.2 MB per minute on an eight-account Matrix gateway, reaching a 4 GB watchdog restart roughly daily. Bounded session storage and flat native memory did not explain the retained object graph.
openclaw/openclaw issue #98938 is the inspected primary source: “[Bug]: Gateway: gradual JS-heap object-graph retention (~4.2 MB/min) -> ~daily OOM on long-lived multi-account Matrix gateways.” The operator ran OpenClaw 2026.4.23 with eight Matrix accounts, E2EE, Node 22.22.2, forced garbage collection, and heap snapshots taken about 35 minutes apart. Heap used rose from 773 MB to 1,386 MB while external memory stayed near 7 MB. A forced full collection freed only about 51 MB of 1,437 MB, and the retained-node diff added 866,944 nodes, including 270,204 concatenated strings, 105,584 objects, roughly 54,000 object-element arrays, and roughly 42,000 contexts or closures. Session maintenance was capped at 200 entries and seven days; alias, skill, handle, request, and listener counts remained stable. The issue was later closed, but the inspected record does not name a merged fix or release boundary.
The facts
- openclaw/openclaw issue #98938 was created 2026-07-02T05:52:21Z and updated 2026-07-27T00:58:24Z; state is closed. - openclaw/openclaw returned 384235 GitHub stars, 7110 open issues, default branch main, and last push 2026-07-27T00:57:18Z. - Latest tagged-release baseline checked: v2026.7.2-beta.3 published 2026-07-18T23:16:53Z. - The operator ran OpenClaw 2026.4.23 with eight Matrix accounts, E2EE, Node 22.22.2, forced garbage collection, and heap snapshots taken about 35 minutes apart. - Heap used rose from 773 MB to 1,386 MB while external memory stayed near 7 MB. - A forced full collection freed only about 51 MB of 1,437 MB, and the retained-node diff added 866,944 nodes, including 270,204 concatenated strings, 105,584 objects, roughly 54,000 object-element arrays, and roughly 42,000 contexts or closures. - Session maintenance was capped at 200 entries and seven days; alias, skill, handle, request, and listener counts remained stable. - The issue was later closed, but the inspected record does not name a merged fix or release boundary.
What changed
The operator ran OpenClaw 2026.4.23 with eight Matrix accounts, E2EE, Node 22.22.2, forced garbage collection, and heap snapshots taken about 35 minutes apart. Heap used rose from 773 MB to 1,386 MB while external memory stayed near 7 MB. A forced full collection freed only about 51 MB of 1,437 MB, and the retained-node diff added 866,944 nodes, including 270,204 concatenated strings, 105,584 objects, roughly 54,000 object-element arrays, and roughly 42,000 contexts or closures. Session maintenance was capped at 200 entries and seven days; alias, skill, handle, request, and listener counts remained stable. The issue was later closed, but the inspected record does not name a merged fix or release boundary. The primary record was inspected with its timestamps, state, body, and adjacent project records. ClawCharts supplied the assignment list; it does not establish the claim.
Why it matters
Long-lived gateways are infrastructure, not disposable command invocations. A steady retained slope turns traffic volume into scheduled downtime and forces operators to trust a watchdog rather than a bounded runtime. The report is unusually useful because it separates allocation churn from retained heap and rules out several convenient suspects. The operational test is whether persisted state, visible control, and runtime behavior agree at the handoff where authority changes.
Current
The measurement came from 2026.4.23 and was updated July 27. The current tagged baseline is v2026.7.2-beta.3, but no inspected release note or linked closure proves that current builds removed this residual Matrix path. A separate open restart-recovery report shows how watchdog restarts can compound into cross-boot retry loops, so the operational consequence remains current even where the exact leak needs remeasurement. Repository metadata, current issues and pull requests, release baseline, Hacker News discovery, and the rendered ranking row were checked. Weak search residue and historically used source spines were not promoted.
Evidence
The primary URL is https://github.com/openclaw/openclaw/issues/98938. Supporting links are inspected current project records that establish implementation, adjacent direction, or boundary conditions. Dates, reproductions, test totals, and deployment observations remain attributed to their authors unless this brief explicitly says they were independently rerun.
Source boundary
Open work is described as open, closed work as closed, and operator reports as reports. Closure can reflect a documentation decision or triage outcome; it is not silently translated into a shipped code fix. Ranking explains why the project was scanned; it does not prove correctness, adoption, or package behavior.
Operator take
Measure heap after forced GC at fixed intervals before changing retention knobs. Track external memory separately, keep snapshots off constrained hosts, and require a linked fix plus current-version slope test before declaring the incident historical. Preserve a before-state receipt and verify the narrowest invariant where state changes. Do not broaden permissions or delete state merely because the visible symptom is inconvenient.
Caveat
Public project records are mutable. Source state was captured at publication time, and later revisions may change status, scope, or evidence. No source here authorizes automatic mutation of a reader’s deployment.
Source inspected; source state, environment, and release boundary remain explicit.