Find what's leaking
Slows down over hours, fine after a restart.
My <app / page / worker> uses more memory the longer it runs, and a restart fixes it. Stack: <stack>. Here's the relevant code: <paste> Look for the usual causes: - Event listeners added and never removed. - Timers and intervals never cleared. - Things pushed into an array or map that's never pruned. - Closures holding references to large objects. - Connections, streams or file handles opened without being closed. - Caches with no eviction. For each candidate: how it leaks, and how I'd confirm it with a heap snapshot or a simple counter.
An unbounded cache is the most common one and the least likely to look like a bug. It reads as an optimisation right up to the point the process dies.