Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node.js heap memory dump, why the String memory is too high?

I am having some memory leak in my code. so i took memory snapshot using heapdump nodemodule. using heapdump i have fixed something then its fine. But why string buffer size is still too high and its keep on increasing ?

I have attached screen shot of the memory heapdump for my component. the heapdump file size is 139MB so i cant attach here. i dont know what other information you guys need to help on this...

String memory list

Overall memory list

like image 288
balaphp Avatar asked Nov 06 '14 05:11

balaphp


1 Answers

The memwatch module might help provide some more insight. It will allow you to subscribe to leak events

memwatch.on('leak', function(info) { 
console.error('Memory leak detected: ', info); 
});

Have a read of this tutorial which does a great job of explaining how to detect the reasons for memory leaks in node.

like image 156
Philip O'Brien Avatar answered Oct 18 '22 10:10

Philip O'Brien