node.js heapdump ... how to understand the memorydump ?

320 views
Skip to first unread message

Balaganesh Krishnamoorthy

unread,
Nov 9, 2014, 5:47:02 PM11/9/14
to nod...@googlegroups.com
http://i.stack.imgur.com/bb5C4.png


Hi,

     I am having memory leak in my node application which i am running as a service. I took memory dump using heapdump node_module
     after that i put it on a chrome profiler module. but the problem is i cant understand memory dump information

     Please check the attachment. i will post more screenshot or memory dump file asap......
    



bb5C4.png
DyR5u.png

Ben Noordhuis

unread,
Nov 10, 2014, 10:27:32 AM11/10/14
to nod...@googlegroups.com
The shallow size is the size of the object itself, the retained size
is the shallow size + the size of all objects this object directly or
indirectly points to. Example:

var a = { /* empty */ };
var b = { a: a };
var c = { b: b };

The shallow size for all three is (for example) 24 bytes. The
retained size for |a| is its shallow size because it doesn't contain
references to other objects. For |b|, it's |a + b|'s shallow size and
for |c|, it's |a + b + c|.

The summary view gives you a breakdown on a per-constructor basis
(i.e. the class name.)

The comparison view lets you see heap growth (or shrinkage, as the
case may be) between snapshots. Note that you need node-heapdump
v0.3.0 for that to work properly.

The comparison view is indirectly also part of the summary view: you
can get a summary of objects created between two snapshots.

The containment view is a breakdown of allocations per subsystem.
It's not that interesting for node.js applications, although it can
give you a quick estimate of how much memory is locked up in buffer
objects.

Hope that helps. I will add the above to the README someday. :-)
Reply all
Reply to author
Forward
0 new messages