Massive jQuery + jQuery-UI memory leaks on IE7 and IE8

Massive jQuery + jQuery-UI memory leaks on IE7 and IE8


I originally reported the problem on another thread (http://
groups.google.com/group/jquery-dev/msg/52927e5708f3e930), but since
the thread discussed different sorts of IE leaks which may not be
related, I'll start a new one for this particular problem.
Problem description from original posting:
--- clip ---
Not sure if this is related, or if the problem is with jquery, jquery-
ui, the way we are using them or just IE, but we too are experiencing
problems with IE and growing memory use. Our application is heavyish,
uses lots of jquery-ui dialogs, and runs within one html page for long
times without reloading. We're starting to have problems with IE (7),
its memory consumption grows quite fast while using the app, and it
quickly becomes sluggish to use.
I've created a simple test page at http://linux.kytomaki.com/jqtest/.
It creates empty jquery-ui dialogs and then immediately destroys them.
The test uses jquery-svn-trunk rev 6320 and jquery-ui 1.7.1.
Monitoring memory usage from Windows XP task manager:
On IE 7 consumption starts from 38M after loading the page. After
creating and destroying a dialog 100 times on one run, the consumption
ends up to 72M. Refreshing the page doesn't seem to have effect on it.
Minimizing and restoring the IE window takes mem to 10M, after which
refresh of the page takes it to 44M. Doing another 100 dialog create-
destroy-cycles takes it to 73M.
With IE 8, mem usage starts from 21M. 100 create-destroy-cycles takes
it to 55M, so again memory seems to be leaked. This time, page reload
frees some memory bringing it to 30M, but now the page minimize-
restore-trick doesn't to do anything. Freeing memory by reload doesn't
help our case, since the app works within one page that shouldn't be
reloaded.
--- clip ---
As suggested in the original thread, I've updated the example (http://
linux.kytomaki.com/jqtest/) with calls to CollectGarbage() and set IE8
compatibility mode to IE=edge, but the problem remains (and obviously
IE8 compatibility mode wouldn't fix the problem on IE7).
This problem might be related to bug http://dev.jquery.com/ticket/4241,
also discussed in http://dev.jqueryui.com/ticket/4188 and more
recently in http://groups.google.com/group/jquery-dev/browse_thread/thread/12ab14b05d3f6cfb.
#4241 hasn't been updated in a while, is it still being investigated?
Anything else we might try to get around this problem?
-Janne