Require this module to trigger heap dumps on USR2.
Utility to debug memory usage of NodeJS processes.
Based on heapdump.
Requiring the module will activate it. It has no functions.
Now, your process will dump a
.heapsnapshot file to its current directory
if you send it the
Example use, where the program
$ node myserverthing.js & 4955$ kill -s USR2 4955USR2 received - creating .heapdump file in /home/helge/proj/heapdumper$ lsheapdump-3808509.864648.heapsnapshotheapdump-3808509.864648.logmyserverthing.jsnode_modules$
The module is available via NPM.
npm install heapdumper
Chrome/Chromium has a profiling tool to visually inspect the heap: Chrome heap profiling
Quick recipe: Open Chrome, open dev tools, go to "profiles tab", right click in the tool area and select "Load profile". Navigate to the generated
.heapsnapshot file and open it. Enjoy.