Repository navigation
Idle sessions never release heap, and there is no way to unload one (host climbs to OOM) #12021
Replies: 2 comments
|
Follow-up 3 days later, re-verified against Still nothing to call. The 0.2.2-rc.1 checkout exposes:
So the only real lever remains: quit the app and relaunch. Today, on this machine:
Concrete proposal (smallest thing that would fix the user-visible problem)
Question for the maintainers: can a bundle-level plugin do step 1 today, or does it need core support? From outside, the per-agent teardown is the owner's |
|
Adding a headless
The heap composition matches this thread's thesis (loaded sessions are never released):
Net effect is the same as the Desktop reports: on a long-lived host the heap is monotonic in the number of sessions ever opened, until the V8 cap; restart is the only reclaim. +1 for |
Uh oh!
There was an error while loading. Please reload this page.
What I see
Desktop host (
@deepseek-ai/dsh-desktop0.2.1-rc.5, node v24.21.0,--max-old-space-size=8192, 24 GB RAM), ~11 loaded sessions.process.memoryUsage()).DiagnosticReports/node-2026-11-03-183820.ips(pid 54070) andnode-2026-11-03-184335.ips(pid 27735)SIGABRT→node::OOMErrorHandler→v8::internal::V8::FatalProcessOutOfMemory, parentDeepSeek Harnesskind: 'out-of-memory',signature: 'out-of-memory · heap 8226 MB'/'... heap 8202 MB', cap 8384 MBThis is not a classic leak: GC collects the garbage, the plateau is live state (each loaded session keeps its agent, message log and projections referenced). It just has no upper bound other than the wall.
Why an in-process plugin cannot fix it
I went through the Host service catalog looking for a way to release one session:
ctx.sessions:create / prepare / fork / get / list— nodelete, nounload.ctx.agents:get / list / register / enter. Per-agent teardown is thectx.effectdisposer returned to whoever registered the agent; another plugin has no handle on it, and there is noagents.dispose(id).sessionController(ctx.remote.session.*):list / search / create / prompt / cancel / rename / fork / archive / projections / follow / control— noclose, norelease.archiveonly rewrites the workspace registry; the agent stays live.agent/disposedexists as an event, but only that owner-frame disposer fires it.So the only ways left from a plugin are host restart (kills every session, including the one calling it) or reaching into another agent's
ctxfiber and disposing it behind the host's back — both unacceptable.Ask
session.release(id)/agents.unload(id)in the public surface.idleMinutes: 15,maxLoadedSessions: N— after that the least-recently-used idle session is unloaded automatically. Anything that bounds the plateau without a restart.heapUsed(or even just "loaded / not loaded" plus an ordinal) would make it possible to tell the user which sessions to close and to verify that closing actually helps.Environment
--max-old-space-size=8192(wall 8384 MB)All reactions