| Issue 2712: | Memory Leaks (add/remove markers, show/hide markers, zoom/pan map) testcases attached! | |
| 12 people starred this issue and may be notified of changes. | Back to list |
I've written (and attached) three test pages to demonstrate how the Google API v3.x is producing enormous memory leaks. I'm testing on IE 8.0.6001 and Firefox 3.5.30729. After loading one test page you should see the map and a few buttons at the top of the page. (by the way, if you zoom or pan the map, you can check if this is still producing memory leaks (which is the case with version 3.2.x of the API!!...). After loading one test page, click on "loop" to start the loop test. 1. AddRemoveMarkerTest.htm adds and removes 100 Markers and click event listeners from the map every few seconds. Map Version (3.2.x) - results for IE: Memory Leak: Initial state: ~60MB used After 12 Iterations: ~120MB used and growing, this memory will never be released while working on the page... refreshing the page -> 70MB used, not all memory released... 2. ShowHideMarkerTest.htm creates 100 Markers on page load, the loop will hide and show the markers every few seconds. Map Version (3.2.x) - results for IE: Initial state: ~60MB used After 6 Iterations: ~120MB in use... After 10 Iterations: ~160MB in use... and growing 3. ZoomMarkerTest.htm creates 100 Markers on page load, the loop will zoom in and out every few seconds. Initial state: ~60MB After 5 Iterations: ~120MB After 10 Iterations: (IE freezes on some tests for me...) ~180MB Firefox has the same problems but doesn't use so much memory (and of cause is way faster). Version 3.1 of the maps API behaves extremely differently. It doesn't leak so much memory but is a lot slower overall! But the memory management seems to be much better (but not perfect at all, still memory leaks...). Please fix this!!
Sep 14, 2010
Project Member
#1
[email protected]
Status:
WontFix
Sep 15, 2010
this means we can't use google maps for our projects at all because all our customers use IE7/8. cool, but you will not get any money... Why did this work in version 3.1 of your api and now it doesn't anymore? Btw Firefox has the same behaviour, it is NOT IE ONLY, thanks
Sep 15, 2010
I think you may have misunderstood what I meant. The references were added in 3.2 to help IE leak less memory when the page is refreshed. So when using the map you may see more memory being used compared to 3.1 but on refresh/unload 3.2 cleans up more memory leaks.
Sep 15, 2010
makes sense, but think about ajax applications where you work a lot with the maps WITHOUT reloading the page. Our application doesn't reload the page at all. Zooming + panning alone is enough to get an IE instance with ~200MB memory usage (growing) in a few seconds. I think the current strategy of holding instances to release memory is the wrong one. Or you say you can't use google maps for pure ajax based application without reloading the page to show different maps? As I said, firefox has the same behaviour in terms of memory usage, if you work a lot with the maps I think you'll end up with a browser instance cosuming all your memory at least on a slow/old pc. Our application very often adds/removes or hides/shows different markers (only 50 at a time to keep the performance) and this causes IE to become slower and slower. In addition it makes debugging our own application (in terms of memory leaks) totally impossible because you cannot know if it is google api or something else I will have to use api version 3.1 until the latest version behaves "normally" again I think.
Sep 15, 2010
Ok I've rewritten my testcase to reload the page after 10 iterations and it is looking good in terms of freed memory. But as I said, Ajax apps don't reload ;)
Sep 15, 2010
I've chatted with the team about this and we have some ideas so I've filed a internal bug for this. But we have to account for both AJAX and non AJAX apps in all browsers :)
Status:
Confirmed
Labels: Internal-3005328
Sep 16, 2010
We have the similar results with our ajax style app.
Sep 17, 2010
thanks for the update luke
Sep 27, 2010
We have done some changes to clean up our listeners on polygons when you call setMap. If you can do some more tests to see if this has improved the memory usage of your app. Thanks
Status:
Fixed
Labels: Fixed-3.2
Oct 2, 2010
I cant see the memory leaks in api v.3 is solved yet in 3.2.7. I'm developing an application where I continually need to add and remove a big amount of markers. Googlemaps consumes a lot of memory when doing this. I just did a test: 50 markers added and cleared from map consumes about 5 Mb.
Oct 7, 2010
I encounter even now (oct 7th) memory leak when creating/destroying markers. See my sample code in issue 2730
Jan 17, 2014
There are memory leaks even with pure map creation/destruction (no need do anything "complex" :) like markers or zoom or pan): https://code.google.com/p/gmaps-api-issues/issues/detail?id=3803 Attempt to find a workaround: http://stackoverflow.com/q/21142483/684229 |
|
| ► Sign in to add a comment |