0

I created a single page application using knockout.js and other map, grid opensource libraries.

I notice I have memory leak because when I close a "soft" page I have, the Heap Snapshot of latest Chrome indicates my objects are still in memory.

I have many situation like Object A subscribe Object B, Object B subscribe Object A, objects are referencing each other. Which means, I think, if one of them can't be garbage collected, none of them will be collected.

However, I think even though my Objects are referencing each other "internally", as long as they all inaccessible, they will be collected by garbage collector. The reason my objects are not collected is because I have some "external" reference like $(window).resize(function(){A.something()}) or window.A=A, I believe the key to get rid of memory leak is to find those "external" references.

My questions is how to QUICKLY find those "external" reference using tools like Chrome Heap Snapshot? In other words, how to find the key Retainer, for example, A retains B, B retains A, C retains B, in this case, C is the key Retainer, get rid of relation between B and C will make both A and B get garbage collected.

BTW: Is Dominator View still exist for heap snapshot in Chrome 38 and up?

Morio
  • 8,463
  • 5
  • 25
  • 29

1 Answers1

0

There is the answer to you question Tool to track down JavaScript memory leak

Also you could read the documentation here

Community
  • 1
  • 1
loislo
  • 14,025
  • 1
  • 28
  • 24