When Profiling Javascript in Chrome how do I know I've handled Memory Leaks? When Profiling Javascript in Chrome how do I know I've handled Memory Leaks? google-chrome google-chrome

When Profiling Javascript in Chrome how do I know I've handled Memory Leaks?


At the bottom of the profiler window there is an icon that looks like a trash can, it will force a GC pass.

Hit it and see if it clears up the rest of the memory.

It's possible Chrome/V8 just doesn't think the memory situation is bad enough to require garbage collection to run.


Try chrome://memory-redirect/ (or about:memory, both go to the same place). It'll show you the exact amount of memory being used by each tab/etc, plus the memory used by tags/etc in IE, Opera, Firefox, etc. if you have those open at the same time. The raw numbers should be a little more helpful than just the graph at profiling your memory use for potential leaks.


You can compare two heap snapshots and see the delta. You can also directly look at the memory snapshot: https://developers.google.com/chrome-developer-tools/docs/heap-profiling-comparison?hl=pt-PT