Memory Leak Fixed in STL Generation
We fixed a retention issue in the conversion worker that could increase memory usage during long batch sessions and abort-heavy traffic.
Symptoms
- Memory usage could grow during long-running sessions, especially with many cancelled conversions.
- Some users observed slower UI responsiveness after many conversions (GC pressure).
- Abort-heavy traffic could leave queued stream chunks longer than expected.
Root cause
- An abort path kept references to large ArrayBuffers (image rasters + intermediate mesh buffers) longer than needed.
- Some streaming responses weren’t releasing back-pressure queues promptly when the client disconnected.
Fix
- Explicit cleanup on abort: intermediate buffers are nulled and GC-friendly within the same tick.
- Stream finalization hardening: we close/tear down streams on disconnect to prevent queued chunks from piling up.
- More aggressive timeouts for hung conversions (without impacting successful long-running jobs).
- If you batch-convert many PNGs to STL, keep the tab open until downloads finish.
- If you cancel conversions frequently, this update prevents memory from creeping over time.
- We also improved abort handling to return faster and free resources sooner.Verification
- Stress tests with repeated convert/abort cycles to ensure buffers are released quickly.
- Disconnect simulations to verify stream teardown and queue cleanup.
- Monitoring memory plateaus instead of unbounded growth during long sessions.
Who was affected
This only became noticeable during heavy, long-lived sessions — for example, converting dozens of PNGs to STL back-to-back without reloading the tab, or repeatedly starting and cancelling conversions. A typical one-off conversion was never affected, and no output files were ever corrupted; the issue was purely about memory that should have been released staying around longer than intended.
How to tell if you were hitting it
- The tab felt progressively slower the longer you kept it open and kept converting.
- Browser task manager showed the tab's memory climbing and not coming back down between jobs.
- Symptoms cleared after a refresh — a classic sign of retained memory rather than a logic bug.
After this fix, memory now plateaus during long sessions instead of growing without bound, so you can keep the tab open across many conversions without a gradual slowdown.
For stable results in long sessions, start from a single high-quality PNG, validate scale/thickness, then repeat with new inputs.
Convert here: PNG / SVG → STL converter.