Code RoomRSS grows despite stable heap
HardPrep Room Coding #2553

RSS grows despite stable heap

On-callAlgorithms & data structuresSenior–Staff~40 min

A Node.js WebSocket fan-out service's RSS grows ~150MB/hour and the process is recycled by the orchestrator every ~10 hours when it hits 4GB, dropping all live connections at recycle. Heap dashboards from `process.memoryUsage()` show heapUsed climbing slowly but most of the growth is in 'external' and RSS, not heapUsed. GC runs frequently and reclaims little. A v8 heap snapshot taken 2 hours apart shows the retained-size delta dominated by 'system / Context' and a Map keyed by socket id whose size only ever grows. A feature shipped last week added per-connection metrics buffering. Sessions per day are flat. Triage and fix this.

What a strong answer looks like

Stop the bleeding first (mitigate), then form hypotheses from real signals. Separate root cause from symptom, communicate status as you go, and close with what prevents a repeat.

0:00 of about 40 min
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.