javascript - Can you find the memory allocated to an object (node.js)? - Stack Overflow

I'm facing a memory leak, and while looking for the problem, wondered if there was some way in Nod

I'm facing a memory leak, and while looking for the problem, wondered if there was some way in Node.js to find the memory allocated to a JavaScript Object. Node provides a way to find the overall heap and stack space, but I couldn't find anything in the documentation or online to find the space for a specific object.

Given the way variables work, it shouldn't be hard to write something within node to find the size, but I was wondering if something, maybe a JavaScript function, already exists to do it?

I'm facing a memory leak, and while looking for the problem, wondered if there was some way in Node.js to find the memory allocated to a JavaScript Object. Node provides a way to find the overall heap and stack space, but I couldn't find anything in the documentation or online to find the space for a specific object.

Given the way variables work, it shouldn't be hard to write something within node to find the size, but I was wondering if something, maybe a JavaScript function, already exists to do it?

Share Improve this question edited Feb 12, 2011 at 2:36 Vanwaril asked Feb 11, 2011 at 17:29 VanwarilVanwaril 7,5787 gold badges35 silver badges47 bronze badges 2
  • 1 There's some kind of memory management plugin for node.js. Maybe in the v8 toolchain – Raynos Commented Feb 11, 2011 at 17:35
  • Chips. I think I pressed the wrong button. This did not deserve down-vote, but upvote! – Alfred Commented Dec 31, 2012 at 1:42
Add a ment  | 

1 Answer 1

Reset to default 5

There's Node-Profiler you could use to take 2 heap snapshot and search for large objects by paring their values.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745100962a4611270.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信