josepdcs / kubectl-prof

kubectl-prof is a kubectl plugin to profile applications on kubernetes with minimum overhead
Apache License 2.0
47 stars 5 forks source link

Support for heapsnapshot in NodeJS #54

Open josepdcs opened 3 days ago

josepdcs commented 3 days ago

If node app is enabled with heapsnapshot signals, it could be used for retrieving the memory snapshots, which can be visualized with speedscope

https://nodejs.org/api/cli.html#--heapsnapshot-signalsignal

josepdcs commented 2 days ago

When creating a snapshot, all other work in your main thread is stopped. Depending on the heap contents it could even take more than a minute. The snapshot is built in memory, so it can double the heap size, resulting in filling up entire memory and then crashing the app.

https://nodejs.org/en/learn/diagnostics/memory/using-heap-snapshot#warning