Has anyone else noticed that if you put a big JPG into a PopupPanel,
show it, and then clean it up, there's a significant memory leak (but
only on IE)? It seems like it should be cleaned up by default, but I
also tried building my on onUnload(), which is being called, and doing
all manner of aggressive things within it to try to tell the browser
that I'm okay with freeing up the content, but to no avail. Sieve
shows that whatever I have inside that panel retains at least one
reference count, and so the item leaks. Issue 2329 sort of tracks
this, but doesn't quite acknowledge that at least in GWT 1.7 the basic
case is as broken as the GWT 2.0 setGlassEnabled() one. I see it with
simply the following:
popup = new PopupPanel(true);
popup.add(popupImage);
popup.show();
However, the leak was really huge earlier, and the GWT team provided a
very effective, very simple workaround that really saved me, so I
thought I should share it here. I have a fairly elaborate dialog in a
PopupPanel(), with nice rounded corners and various icons. To support
transparency, IE was using an offscreen buffer which was getting
pretty huge (50-100MB) and then later got leaked. The leak is still
there, but the hugeness is gone, thanks to the following four lines
added to the myModule.gwt.xml file:
<replace-with
class="com.google.gwt.user.client.ui.impl.ClippedImageImpl">
<when-type-is
class="com.google.gwt.user.client.ui.impl.ClippedImageImpl" />
<when-property-is name="user.agent" value="ie6" />
</replace-with>
Note that this does mean that PNG rendering in IE6 is now ugly, but
for my customers that's not nearly as big an issue as the browser
falling over because it's chewed up all available system memory. YMMV
- you'll want to test your site in IE6 before deploying this change.
Cheers,
Geoff
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" 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/google-web-toolkit?hl=en.