The author investigates a persistent memory leak and CPU spikes in a Node.js application following a migration to SQLite. By analyzing metrics and isolating components, the author discovers the leak originated from an image proxy utility rather than their own application code, leading to significant memory stabilization and successful downscaling of server resources.
Key points
Node.js memory spikes can often be caused by third-party dependencies or utility libraries rather than custom application logic.
The V8 engine's memory management policy often consumes available RAM aggressively, which can mask memory usage patterns.
Profiling and isolating external dependencies (like image proxies) is a critical step when debugging resource exhaustion in production.
System-level monitoring metrics are essential for identifying the correlation between memory growth and CPU-intensive garbage collection cycles.