[note: I posted this http://dev.jqueryui.com/ticket/4566 but think
this is the right place to post]
In my jQuery UI tests I have been experiencing memory leaks in IE 7
caused by the repeated use of filter: in the theme css which is used
to apply a transparent overlay on modal dialogs or to create shadow
effects such as :
.ui-datepicker-cover { ... filter: mask(); /*must have*/}
.ui-widget-overlay { ... filter:Alpha(Opacity=30);}
.ui-widget-shadow { ... filter:Alpha(Opacity=30);}
IE has a known bug where filter: will claim memory each time it is
used. The memory is only released when the page is navigated away from
or refreshed which is a big problem for single-page dynamic ajax
applications
There is a workaround for this which stops the memory leak; edit the
theme's css file and remove all filter: rules. In the case of the .ui-
widget-overlay rule, which dims the background page during a modal
dialog, I replaced the filter: with this :
background: transparent url(images/GridLattice.gif) top left
repeat;
The grid lattice gif is just a gif with alternative coloured pixels
and transparent pixels. It's ugly but does the job without memory
leaks.
I checked out extJS which uses filter: in the same way for modal
dialogs but it doesn't suffer from increasing memory leaks. This is
because the overlay div is always present so filter: is only
instantiated once. You do get a memory hit on the first dialog but no
more leaks after that because the same filter: element is used for all
subsequent modal dialogs.
I suspect that jQuery UI creates new dom elements each time it needs a
filter: which explains why the memory usage rises continuously on the
same page with use.
A possible fix would be to do what extJS does and leave a filter: dom
element ever present on the screen and just show/hide as necessary,
this would work for modal dialogs at least.
For now I'm happy with the grid lattice gif fix and it's a relief to
see memory usage stable when I open new dialogs as it was making me
wonder if jQuery UI is ready for the kind of app I'm writing. I'd
already had to rule out extJS because it is too slow on the typical
target machines my users will be using, and I was running out of
options other than self-build!
I don't know if this has been reported before but if not then it could
explain some of the other IE memory leaks that have been reported. All
it takes is a filter:
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---