views:

1544

answers:

2

What, if anything, do I have to be careful about doing to prevent the infamous IE circular reference memory leak when using ExtJS? I have seen this SO question and this ExtJS forum thread, but I'm hoping for some short checklist of things to do/avoid.

+2  A: 

Crockford has a function that will prevent the memory leak (by breaking the circular references) for you.

YUI has the purgeElement function in the Event utility that does basically the same thing. As long as you attach all listeners through addListener and invoke purgeElement before removing something from the DOM, you should be leak-free.

Hank Gay
Thanks!Will it not even leak memory when the user navigates away from the page?
erikkallen
I would hope so, but I'm not sure. If you measure it and can verify there's a leak (not just IE caching things even though you told it not to), you could try to listen for the window's unload event and invoke the purge function then, but that's so much work I'd only do it if I could verify there was an issue.
Hank Gay
A: 

Apparently ExtJs 3.1 has a lot of memory performance improvements ( I haven't measured but it does appear to be so)
However you need to be very careful on the objects you create and how you dispose them, that was pretty much the bottom line.

Use IeSieve , and there is another tool , but I cant really remember the name ( i ll edit at 3am when I wake up with I got it! :) )

Miau