Memory Leak Profiling and Pinpointing for Node.js
We identified and fixed a memory leak in a Nest.js application running on Kubernetes, which was caused by open handles not being properly closed during proxy requests to Grafana. Using Prometheus and Grafana for monitoring, along with custom modifications to the wtf-node dependency, we pinpointed the issue and adjusted the middleware to prevent the memory leak. Key steps include integrating prom-client with Grafana and using wtf-node to diagnose active handle issues.