[OpenLayers-Users] Memory leak with markers in open layers 2.4

Glen Stampoultzis gstamp at gmail.com
Wed Oct 31 01:16:47 EDT 2007


For my application I've been going through the joy of performance
improvements and memory leak detection and ran into a nasty problem
with markers.  It seems that markers are leaking memory somewhere.
Run the following code in drip (an IE memory leak detector) and you
quickly notice the memory increasing fairly sharply.

            for (var i = 0; i < 400; i++) {
                var centerIcon = new OpenLayers.Marker(new
OpenLayers.LonLat(137,-32));
                map.markersLayer.addMarker(centerIcon);
                map.markersLayer.removeMarker(centerIcon);
                centerIcon.destroy();
            }

Are there any known problems in this area for 2.4?



More information about the Users mailing list