Memory Leak in OpenLayers + IE

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Memory Leak in OpenLayers + IE

Christopher Schmidt-2
So, after some investigation this morning, I've discovered a source of a
memory leak in Internet Explorer + OpenLayers:


Currently, when creating Tile.Image images, we bind a load/error
listener:

 OpenLayers.Event.observe(image, "load",
               OpenLayers.Util.onImageLoad.bindAsEventListener(image));
 OpenLayers.Event.observe(image, "error",
               OpenLayers.Util.onImageLoadError.bindAsEventListener(image));

(Util.js, line ~180)

This is how we prevent tiles from displaying in the wrong location.
Unfortunately, this closure on the image is never cleaned up, so IE
doesn't destroy the images, even when the page is navigated away from,
resulting in a memory leak.

No fix yet, just documenting this so that if anyone has an obvious 'oh,
just do $foo', they can feel free to offer it up :)  

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev