Closed jwalton closed 7 years ago
I have this issue too. Example heapsnapshot from a testcase app: http://oserv.org/bugs/node-heapdump/heapdump-194314979.440694.heapsnapshot.xz
Look at Test or Array objects, for example.
@jwalton Sorry for the delay, I must have missed the notification email for this issue.
I looked into it and there are at least two issues:
It's not a bug in Chrome's .heapsnapshot loader; it works fine when you take an in-browser snapshot and save+load it.
I observe that the postorder index step takes a hell of a long time with snapshots created with node-heapdump compared to in-browser snapshots of roughly the same size.
I'm not sure what to make of that. node-heapdump takes the data from V8 pretty much as-is and the version of V8 in io.js is almost identical to the one in Chrome 41.
@vietkute02 mentioned in IRC that a combination of Chrome 37, node-heapdump 0.3.5 (current) and node 0.11.x does not have this bug.
I observe that the postorder index step takes a hell of a long time with snapshots created with node-heapdump compared to in-browser snapshots of roughly the same size.
I'm not sure what to make of that. node-heapdump takes the data from V8 pretty much as-is and the version of V8 in io.js is almost identical to the one in Chrome 41.
I forgot to mention it here but I did eventually figure out what the issue is - or at least, what I believe the issue is - and it's perhaps also responsible for the self_size == retained_size issue.
Heap snapshots from io.js and node.js processes seem to have much deeper and more cyclic object graphs than in-browser ones. I speculate that DevTools' snapshot loader bails out after it reaches a certain depth but it takes a lot of time and it doesn't figure out what the real retained size is.
@bnoordhuis is there any ticket to watch in node/io/chrome or we'd need to report it?
I will say that by using Chromium 37 downloaded from here - http://sourceforge.net/projects/osxportableapps/files/Chromium/
I saw self size !== retained size. However, the full size of the heap dump (60MB for me) was still incorrect.
@jspavlick What's your rss
/heapTotal
/heapUsed
? It looks like that the graphs you posted to #62 measure rss
and heapdump measures heapUsed
. Do Buffer
s have self size === retained size
, btw?
Buffers do not have self_size === retained_size
in Chromium 37. Not sure about rss/heapTotal/heapUsed, I just took a screenshot of whatever New Relic gave me.
I'm also having this issue, on iojs 2.3.4 (don't ask).
self size seems correct; it's just retained size that isn't getting calculated.
I was facing the same problem of shallow size == retained size, which is solved by enabling "Show advanced heap snapshot properties" check box in the DevTools settings panel.
@ChuntaoLu This works for me for my testcase heapdump linked above.
@bnoordhuis The issue could be closed with documenting that «Show advanced heap snapshot properties» should be enabled in Chrome, I suppose.
«Show advanced heap snapshot properties»
@ChALkeR Do you know if that option still exists in Chrome 56? I can't find it anymore. FWIW, I haven't received more reports so I suspect this has been fixed upstream.
Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=455374
I'm fairly sure this has been fixed in Chromium so I'll go ahead and close this out.
I'll prefix this by saying I suspect this isn't actually node-heapdump at fault, but I was wondering if you had some insight into what is going on here? :)
If I generate a heap dump from my app (on Linux, using node 0.10.31), then load this dump into Chrome 40.0.2214.94 (64-bit), in the dev tools every single object has a shallow size which is identical to the retained size:
If I go to the "Containment" view, I see:
If I open one of these up, I see the retained size is smaller than the objects inside: