最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Understanding Chrome Heap Profile - Stack Overflow

programmeradmin0浏览0评论

I am trying to diagnose an SPA. I took two snapshots, one right after another, while the app was idle. Here is a snapshot below. As you can see, the shallow size of these objects is huge. But I have no idea what they are, or where in the code they e from. The (piled code) does not make sense to me, nor do deoptimization_data or relocation_info.

Does anyone know how to use this information to actually track down leaks in a sizable app?

I am trying to diagnose an SPA. I took two snapshots, one right after another, while the app was idle. Here is a snapshot below. As you can see, the shallow size of these objects is huge. But I have no idea what they are, or where in the code they e from. The (piled code) does not make sense to me, nor do deoptimization_data or relocation_info.

Does anyone know how to use this information to actually track down leaks in a sizable app?

Share Improve this question asked Dec 20, 2013 at 6:03 Daniel WilliamsDaniel Williams 9,32416 gold badges78 silver badges117 bronze badges 1
  • The Chrome Dev Tools make uncovering memory leaks possible, but still hard. There is an inherent level of difficulty, and no easy answers. :P I hope you find your answer. – Paul Draper Commented Dec 20, 2013 at 6:19
Add a ment  | 

1 Answer 1

Reset to default 6

Please use the technique described here: Tool to track down JavaScript memory leak

Javacript engine in Chrome, called v8, does number of things for executing scripts fast. Actually it piles on the fly all your js code (JIT). The piled code may bee unnecessary if you removes all the calls and references to it. ie you may have an element in the DOM tree with event listener and at some moment you may remove this element from the DOM tree. As a result the code for the event listener will bee unnecessary and v8 should be able to delete that code. So, v8 keeps the piled code in the same managed heap as for your objects, arrays, strings etc.

When you are looking into the heap snapshot you see everything that was in the heap including everything related to the code like code relocation info, deoptimization data, arrays with line-ends, the script texts etc.

发布评论

评论列表(0)

  1. 暂无评论