Memory Leak in IE while using Frames

When including the ExtJS v 1.1.1 file with any frame, that frame will leak memory. There does not need to be any content, simply a Frameset containing a single child frame that includes ext-base.js and either ext-all.js ext-all-debug.js.

The cause is the setInterval for, ironically, the garbageCollector thread.

We have a very large web application and our dialogs use frames, and some of those frames are using Ext tables. On closing one of these dialogs, IE would leak upwards of 15MB on each open-close. The setInterval seems to prevent IE from collecting anything that has to do with the window.

This memory is not returned when the opener window navigates away from the web application. The only way to free the memory is to fully close IE and restart it.

To fix this we did two things in ext-all and ext-all-debug: Fixed the incorrect reference to
El.collectorThreadId:
(around line 3940: ) El.collectorThread = setInterval(El.garbageCollect, 30000);

Note that the 'clearInterval' is clearing El.collectorThread, not El.collectorThreadId.

We also clear the interval on window close. To do this we tossed the following line of code in to the _onunload method of the Event class. Probably not the correct place for it, but it works.

A warning: prototype.js 1.5.1 and up has a similar leak, though prototypes leak does not increase memory on refresh, only on a full window open/close cycle.

I personally find it easiest to test this using perfmon, with the counter on 'Process(iexplore)\Working Set.

I do not know if this bug occurs in later version of extJs. I did not do full testing in all browsers; I know that with the broken prototype.js and extJs our application leaked in IE 6, 7 and 8 beta 1.