node.js堆内存转储,为什么String内存太高?

时间:2022-07-11 07:18:48

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 ?

我的代码中有一些内存泄漏。所以我使用heapdump nodemodule获取了内存快照。使用heapdump我已经修复了一些东西然后很好。但为什么字符串缓冲区大小仍然太高而且它会继续增加?

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...

我为我的组件附加了内存heapdump的屏幕截图。 heapdump文件大小是139MB所以我不能在这里附加。我不知道你们需要帮助的其他信息......

node.js堆内存转储,为什么String内存太高?

node.js堆内存转储,为什么String内存太高?

1 个解决方案

#1


0  

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

memwatch模块可能有助于提供更多洞察力。它将允许您订阅泄漏事件

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.

阅读本教程,它可以很好地解释如何检测节点中内存泄漏的原因。

#1


0  

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

memwatch模块可能有助于提供更多洞察力。它将允许您订阅泄漏事件

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.

阅读本教程,它可以很好地解释如何检测节点中内存泄漏的原因。