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
1 Answer
Reset to default 6Please 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.