Tool to track down JavaScript memory leak
update: Lets use Record Heap Allocations profile type.
- open devtools profiler
- do a warm-up action
- start profiler
- repeat action a few times
- if the action has a leak you will see the same number of groups of blue bars in the overview pane
- stop the profiler
- select one group of these blue bars in the overview
- look into the list of objects
See screencast Javascript Memory Leak detection (Chrome DevTools)
was: You can use the next scenario for fining memory leaks.
- open devtools profiler
- do an action that makes a leak
- take a heap snapshot
- repeat steps 2 and 3 tree times
- select the latest heap snapshot
- change filter "All Object" to "Objects between Snapshot 1 and 2"
After that you will see objects a set of leaked objects. You can select an object and look at the list of retainers in Object's retaining tree
Use the innerHTML and outerHTML values of the element in the Detached DOM tree view of the Heap Profiler to map objects in memory to your code and track down memory leaks.