Repository navigation
Description
What happened
Desktop development renderers retain React PerformanceMeasure entries indefinitely. Repeated WorkHub session-list refreshes increase renderer memory even when the resident session count and DOM stay constant. Stopping updates and forcing GC does not release these entries; clearing the performance measures does.
A controlled Electron experiment with the real WorkHubRoot on commit 088fe00 produced:
- Fixed 1,000 session summaries, refreshed at 10 Hz; no messages or attachments added.
- After about 80 seconds / 803 refreshes: 46,060 performance measures retained.
- Renderer working set grew from 285.8 MiB to 444.6 MiB (sampled after HeapProfiler.collectGarbage).
- DOM counters remained at 509 nodes. JavaScript used heap grew much less than process memory.
- After stopping refreshes and calling performance.clearMeasures(), the next GC sample fell to 289.6 MiB; Blink/embedder heap fell from 10.6 MiB to 4.9 MiB.
- Retained entries contain React's
detail.devtools.track = "Components ⚛"and changed-prop diagnostics.
Expected: development performance diagnostics must not accumulate without a lifetime bound in a long-running Desktop renderer.
How to reproduce
- Run Desktop/WorkHub with the development React build. This was isolated using the existing Product/WorkHub Storybook Surface and real WorkHubRoot in an Electron WebContentsView.
- Keep listSessions() at a fixed 1,000 synthetic session summaries and invoke the subscribeSessions callback every 100 ms, returning fresh summaries on each read.
- Sample process memory, Runtime.getHeapUsage and Memory.getDOMCounters after HeapProfiler.collectGarbage every 15 seconds.
- Observe performance.getEntriesByType('measure').length increasing with each render. Stop the refresh source: the measures remain reachable.
- Clear the measures once and collect garbage again: retained native memory drops substantially.
Environment
- Maka commit: 088fe00
- Surface: Desktop development renderer, real WorkHub components with deterministic service fixtures
- OS: Linux, X11/Xvfb
- Electron: 43.4.1; React DOM: 19.2.8
- System Node.js: 26.3.0
Logs, screenshots, or additional context
This investigation began with a separate Windows report of a second renderer growing from about 1 GiB to 3.4 GiB. That report has no PID-to-WebContents URL mapping or confirmed render-process-gone reason. The experiment confirms this specific development-mode retention defect; it does not establish that it is the sole cause of the original Windows incident. No production-build leak is claimed.
Proposed repair: consume and retire React-owned development performance measures at the shared renderer entry, preserving unrelated application measures and DevTools trace emission. Validate steady-state memory under the same refresh load and cleanup across HMR.
Automated investigation and issue text by OpenAI Codex, on behalf of the contributor.
Activity
me2seeks commentedon Sep 10, 2026
take