-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node-heapdump captures <1% of the heap #95
Comments
node-heapdump can only report about objects from the JS heap. Memory allocations from native modules (C++ add-ons) won't normally be visible in heapdumps, not unless the add-on makes them visible; most don't. It could also be memory fragmentation, see nodejs/node#8871 (comment) for an example; that won't be visible in a heapdump either.
No idea, sorry.
Partial snapshots can happen but it's something you can check. A heapdump is just a big JSON object. Inspect in a text editor and see if it's a complete object. I think Chrome accepts partial snapshots but I'm not 100% sure about that. |
It turns out this was related to transparent huge pages! So yes the memory usage reported by node-heapdump was correct. It might be good to put something in the README explaining what could be the cause if the snapshot doesn't account for everything. |
Hi, I'm running a Node process in a Docker container; it's the only process running in the container.
I observe via
docker stats
that the container is using 1.77GiB of memory. The memory usage is pretty constantly this high; it's not growing.I set it up to take heap snapshots by requiring
heapdump
when the process starts and then sending a USR2 signal to the process (viadocker kill --signal=USR2
). I haven't configured thewriteSnapshot
function to do anything - I just load the heapdump tool by requiring it in the main javascript file that runs.When I do this, for some reason two heap snapshot files get generated:
They seem to have close to identical contents.
When I open up the heap snapshot in Google Chrome, it reports 18.3MB of memory usage. Which is less than 1% of the 1.7GiB usage reported by "docker stats."
I'm running Node 6.9.2. The application pulls data from NSQ, transforms it, and makes HTTP requests to two or three domains in total.
require('heapdump')
twice in my code base).The text was updated successfully, but these errors were encountered: