How to find non-destroyed but GC'ed Javascript objects in Chrome? How to find non-destroyed but GC'ed Javascript objects in Chrome? google-chrome google-chrome

How to find non-destroyed but GC'ed Javascript objects in Chrome?


If the purpose of this is to check for memory leaks, then why cant you just run a chrome profile instead?

The Object allocation tracker can be used to find memory leaks at runtime, also the heap profiler can analyze memory graphs and compare snapshots to discover what objects are not being cleaned up by the gc.

Also the timeline memory view can help identify if you are forcing garbage collection too often by allocating too often (if thats of interest)

For more info, see:https://developer.chrome.com/devtools/docs/javascript-memory-profiling

Also not sure if its helpful, but if you want to look at memory stats then you can enable memory info in chrome by running with the --enable-memory-info param, then you have access to window vars:

window.performance.memory.jsHeapSizeLimitwindow.performance.memory.totalJSHeapSizewindow.performance.memory.usedJSHeapSize