[webkit-help] Fwd: Using HeapSnapshot tools for Node.js

Brandon Mason brandon at torchlightsoftware.com
Tue Feb 5 16:16:01 PST 2013


I would like to use the functionality of HeapSnapshot.js for profiling
Node.js.  I'm just not quite sure how to require and use it.

There are existing projects such as v8-profiler and node-memwatch that can
take snapshots.  However, we're not able to access any of the
dominator/retainer info.  According to this, Google removed that code from
V8 a while back:

https://github.com/dannycoates/v8-profiler/issues/16#issuecomment-9099768


Without the dominator code it's pretty difficult to extract useful info
from the heap dump.  This code appears to contain the functionality I'm
looking for:

https://trac.webkit.org/browser/trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js#L1342


I would like to either:

   - Use this code to wrap an existing snapshot taken by node-memwatch or
   v8-profiler.
   - Reference the webkit code as a module which can perform the snapshot
   and return javascript objects that I can further manipulate.

I'm a bit over my head dealing with C++ and V8 internals, but it seems like
an adaptation should be possible.  I'm happy to share whatever solution I
arrive at.  Better tools to troubleshoot memory leaks would benefit the
Node.js community at large.

Can anyone help me find the right way to do this?

Thanks,
Brandon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20130205/ea91c904/attachment.html>


More information about the webkit-help mailing list