Dashboard › opencode-lore › OpenCode heap-snapshot isolation
OpenCode heap-snapshot isolation
Category: preference
Confidence: 1.00
ID: 01a0a4f1-783c-7565-93b9-49d7ee0a435d
Project ID: 6f4be9ff-ed84-4cca-a9e7-732a0b0b8677
Cross-project: No
Recalled in other projects: 0
Source session: 0PmP9YZ9Ud34cfjtE
Created: 2026-09-15 10:14:44
Updated: 2026-09-15 12:01:23
Content
Steps:
- Freeze OpenCode PID, start identity, cgroup, snapshot metadata, and hashes—restarts invalidate attribution.
- Keep the service and artifacts read-only: never signal, restart, force GC, use the network, access production data, or load snapshots wholesale in JavaScript/Python.
- Run bounded streaming C/C++ analysis outside
opencode.service with MemoryHigh≤640M, MemoryMax≤768M, and swap disabled.
- Monitor
RssAnon + VmSwap, [heap], isolate committed prefixes, 256 KiB mapping count, and cgroup anon/file/swap—RSS alone hides paging.
- Stop all live captures once reclaim, swap, PSI, or
memory.events high begins; preserve active work and use a planned restart for immediate allocator-high-water reclamation.
Gotchas:
- Snapshot files can remain cgroup-charged as file cache after descriptors close; this raises
memory.current, not anonymous RSS.
- Separate systemd
/tmp namespaces can hide output; use a verified shared path.
Verify:
- [ ] Identity and hashes remain unchanged.
- [ ] Report bounds, peak RSS, cgroup evidence, exact counts, limitations, and confidence.