Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Node.js Heap Snapshots and Google Chrome Snapshot Viewer

Node.js Heap Snapshots and Google Chrome Snapshot Viewer

Problem

Is there any way to take a heap snapshot from a running Node.js process and then load it into the Google Chrome profiles viewer? It would be very awesome to be able to use the really useful Chrome profiles tab to view Node.js snapshots.

If it is possible to do, can someone provide a step-by-step of how to produce a snapshot in Node.js and then load it into Chrome?

Problem courtesy of: Rob Evans

Solution

There is an NPM module to do this.

https://github.com/bnoordhuis/node-heapdump

Just require() the module and then you can send kill -USR2 to the node process. It creates a V8 heap dump that you can view in Chrome.

Solution courtesy of: Brandon

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

Node.js Heap Snapshots and Google Chrome Snapshot Viewer

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×