Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nodejs memory profiling

Need to profile node process. i've some memory leaks in production, after some days of running node process.

i've tried node-inspector + v8, but it doesn't work, in new version of node-inspector there is no Profile tab. and in old version when i start profiling error is fired and debugging stopped.

i've also tried nodetime.com, but it doesn't show what i need, also it takes too much memory, it's not for production.

i've also tried dtrace (http://blog.nodejs.org/2012/04/25/profiling-node-js/) but it doesn't give me necessary information.


so what information i need for profiling memory:
get live instances, instances count, size in memory, instance types

do u know how to get that information?

like image 365
PlayerX Avatar asked Dec 27 '22 16:12

PlayerX


2 Answers

You can try to use look module. It based on nodetime but works locally.

like image 160
Vadim Baryshev Avatar answered Jan 05 '23 16:01

Vadim Baryshev


I've found node-memwatch useful.

The downside is you have to embed it in your application and have a bit of code for it, but it's useful for checking the heap at various places to see how much it changed after you did something.

like image 24
PherricOxide Avatar answered Jan 05 '23 15:01

PherricOxide