Memory leak with setCenter()?

136 views
Skip to first unread message

Sander Sturing

unread,
Dec 14, 2011, 6:11:48 AM12/14/11
to google-map...@googlegroups.com
I hope this is not a repost, but I've searched everywhere and couldn't find a clear fix so far.

First I just initialize a very simple map (no markers etc.). I have a script where every couple of seconds I call the setCenter() function like this:

    latlng = new google.maps.LatLng(56.02508 +random_number(-2, 2), 2.39525+random_number(-2, 2));
   map.setCenter(latlng);

Is there any way to clear the memory every time this is called. It is called by the setInterval function and refreshing the whole page is not an option. I've tried re-initializing the whole map everytime instead of just changing position but that doesn't seem to work either.
Thanks in advance!

BTW, the whole script is a little bit more advanced with AJAX-calls which places markers with infoboxes.
But after a couple of time debugging that script it seems to be stuck on the setCenter() part.

I saw this demo in another post and that is basically the same script as I'm describing at the top. (random position-changing on a single map).

robvr

unread,
May 16, 2012, 7:55:13 PM5/16/12
to google-map...@googlegroups.com
Hi Sander

I am having serious memory leaks too.
Did you find a solution yet?
IF so would you share it?

Grtz
Rob

Op woensdag 14 december 2011 12:11:48 UTC+1 schreef Sander Sturing het volgende:

Sander Sturing

unread,
May 23, 2012, 8:33:50 AM5/23/12
to google-map...@googlegroups.com
Hello Rob,

I'm sorry, I never found a solution...
Good luck!

Greetings from,
Sander

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/xTNqjnnlYAQJ.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.



--
www.sandersturing.nl

Rob van Rijen

unread,
May 24, 2012, 10:11:19 PM5/24/12
to google-map...@googlegroups.com

Hoi Sander

 

Bedankt voor je reactie.

Mijn memory leak is v3.8 gerelateerd en verdwijnt als ik er expliciet v3.7 van maak.

Misschien een oplossing voor jouw probleem. Verder enclosures etc vermijden, vooral in IE.

Google pakt hem echter niet op, we wachten af J

 

Grt

Rob


Geen virus gevonden in dit bericht.
Gecontroleerd door AVG - www.avg.com
Versie: 2012.0.1913 / Virusdatabase: 2425/5019 - datum van uitgifte: 05/24/12

Sander Sturing

unread,
May 25, 2012, 5:29:21 AM5/25/12
to google-map...@googlegroups.com
Hallo Rob,

Bedankt voor de tip. Ik ben er slechts die ene keer tegenaan gelopen, en de klant gaf aan dat het uiteindelijk niet zo'n big deal was. Heb er vervolgens niet meer naar gekeken, maar het is goed om te weten. Best een slordige bug van google trouwens, maar goed.

mvg,
Sander
Reply all
Reply to author
Forward
0 new messages