using the map control inside an updatepanel causes memory leak

Jan 30, 2008 at 2:43 PM
Hello,

I am trying to use the map control inside an AJAX update panel, with a timer control (AJAX) set to auto refresh the panel every 10 seconds.
A snapshot of the code would like this:

<asp:updatepanel ID="Updatepanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<cc2:GoogleMap ID="GoogleMap1" runat="server" Width="100%" Height="680px" Key="ABQIAAAA7e1LsvQ4v7zTuVX0n9fNnRQkP9T5LM5FcH4ngklwY-vyRnEFyBQSVBDshNS1-Rdn2NYFsPx1NrpA7Q"
Latitude="45.398" Longitude="-75.698" Zoom="13"
ShowMapTypeControl="False" ZoomPanType="Large">
</cc2:GoogleMap>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer2" EventName="Tick"/>
</Triggers>
</asp:updatepanel>
<asp:Timer ID="Timer2" runat="server" Interval="10000" ontick="Timer2_Tick">
</asp:Timer>

After a couple of hours of update I get a 'Out of Memory' message in IE 6.0 and the browser stops executing the script.

I noticed on startup or loading of the page, the memory usage by the browser just keeps increasing, and never decreases.

Looking up the Google Map API documentation led me to this:

The Google Maps API encourages the use of function closures, and the API event handling system GEvent attaches events to DOM nodes in such a way that almost inevitably causes some browsers to leak memory, particularly Internet Explorer. Version 2 of the Maps API introduces a new method, GUnload(), that will remove most of the circular references that cause these leaks. You should call GUnload() in the onunload event of your page to reduce the potential that your application leaks memory:

<body onunload="GUnload()">

I did try using the above, but it did not help.

Any help would be appreciated.

Thanks

Coordinator
Jan 31, 2008 at 6:39 AM
Issue is accepted.
I'm going to fix it ASAP.
Jan 31, 2008 at 2:22 PM
Thank you.


velio wrote:
Issue is accepted.
I'm going to fix it ASAP.

Coordinator
Jan 31, 2008 at 8:22 PM
This was fixed.
Get latest release files.
Regards,
Velio
Coordinator
Feb 10, 2008 at 7:58 PM
Google Maps API code disposing was improved in latest realease 2.7 and this have to be fixed.
Regards,
Velio
Feb 11, 2008 at 2:00 PM
Thank you Velio, I will try it out.



velio wrote:
Google Maps API code disposing was improved in latest realease 2.7 and this have to be fixed.
Regards,
Velio