In this document you can learn about how to debug memory related issues.
My process runs out of memory
The user observes continuously increasing memory usage (can be fast or slow, over days or even weeks) then sees the process crashing and restarting by the process manager. The process is maybe running slower than before and the restarts cause some requests to fail (load balancer responds with 502).
- Process restarts due to the memory exhaustion and requests are dropped on the floor
- Increased GC activity leads to higher CPU usage and slower response time
- GC blocking the Event Loop causing slowness
- Increased memory swapping slows down the process (GC activity)
- May not have enough available memory to get a Heap Snapshot
My process utilizes memory inefficiently
The application uses an unexpected amount of memory and/or we observe elevated garbage collector activity.
- An elevated number of page faults
- Higher GC activity and CPU usage
Most memory issues can be solved by determining how much space our specific type of objects take and what variables are preventing them from being garbage collected. It can also help to know the allocation pattern of our program over time.