<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:"Arial Unicode MS";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"\@Arial Unicode MS";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white lang=NL link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Hi Adrian,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>You are correct that the resources are released when the page
reloads. Problem for me there was that I needed to ‘save’ a lot of data to
present the user with the same view. (think of layers visible or not etc.)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Cheers Kris<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'>From:</span></b><span lang=EN-US
style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>
Adrian Popa [mailto:adrian_gh.popa@romtelecom.ro] <br>
<b>Sent:</b> Thursday, September 03, 2009 10:27 AM<br>
<b>To:</b> Kris Geusebroek<br>
<b>Cc:</b> Hendrik Nibbrig; users@openlayers.org<br>
<b>Subject:</b> Re: [OpenLayers-Users] Need help with memory leak in IE<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>My solution to this problem (only for ie) was to reload the
whole page after a number of layer refreshes, because apparently IE doesn't
free the used objects untill the page is reloaded...<br>
<br>
<br>
Kris Geusebroek wrote: <o:p></o:p></p>

<pre>Hi Hendrik,<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>A few months ago i posted a partial solution to this list.<o:p></o:p></pre><pre>Original mail is attached.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Hope this helps. If you make any improvements on this solution please let me know I'm still very interested in this topic.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Cheers Kris<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>-----Original Message-----<o:p></o:p></pre><pre>From: <a
href="mailto:users-bounces@openlayers.org">users-bounces@openlayers.org</a> [<a
href="mailto:users-bounces@openlayers.org">mailto:users-bounces@openlayers.org</a>] On Behalf Of Hendrik Nibbrig<o:p></o:p></pre><pre>Sent: Thursday, September 03, 2009 9:43 AM<o:p></o:p></pre><pre>To: <a
href="mailto:users@openlayers.org">users@openlayers.org</a><o:p></o:p></pre><pre>Subject: [OpenLayers-Users] Need help with memory leak in IE<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre> <o:p></o:p></pre><pre>Hi,<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>My name is Hendrik and I'm currently evaluating OSM with OpenLayers to see if this is the way to go for our company. I have been developing in C++ and Java for the last 5 years to please go easy on me with Javascript as this is new to me. <o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Our application will be displaying a list of vehicles on one side of the screen and then the user can pick one. We will then show the route of the vehicle on the map (e.g. using markers) along with a heap of other information. The Javascript will do a refresh every minute and so the map will be updated every minute as well. The user is free to switch to another vehicle at any time so I need to delete all current markers and then insert the new ones.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>The current map system (by Infoware) has lots of issues which is why we want to change to OSM and OpenLayers. Therefore I made a little showcase where I can run some tests. The tests have showed that everything is fine using Firefox but in IE the memory steadily increases. IE7 is tolerable, but IE8 will be unbearable. <o:p></o:p></pre><pre>I attached the showcase so you can have a look at the sourcecode. The data is anonym so don't worry about that. The best test to run is &quot;Show whole trip every 5 seconds&quot;. This will insert 500 markers every 5 seconds and it will clear the existing markers before. As you can see in the showcase I tried using a vector as well but that wasn't any better. I'm open to any suggestions or even better solutions :)  <o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Oh btw: Except for the memory problem (which might be an issue of IE itself) I think OpenLayers is a great tool and on the right way.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Sorry if this gets double posted, but the first post was too large and I couldn't cancel it.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Kind regards/Mit freundlichen Gr<span
style='font-family:"Arial Unicode MS","sans-serif"'>��</span>en<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Hendrik Nibbrig<o:p></o:p></pre><pre>Systemanalytiker Java<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>T +49. 3375. 528 30 204<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>F +49. 3375. 528 30 19<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><a
href="mailto:hendrik.nibbrig@enovation-btc.de">hendrik.nibbrig@enovation-btc.de</a>  <span
style='font-family:"Arial Unicode MS","sans-serif"'>�</span>  <a
href="http://www.enovation-btc.de">www.enovation-btc.de</a> <o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre> <o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>E.Novation BTC GmbH   <o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Freiheitstra<span
style='font-family:"Arial Unicode MS","sans-serif"'>�</span>e 120 B  <span
style='font-family:"Arial Unicode MS","sans-serif"'>�</span>  15745 Wildau<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Managing Director: Walther Bernard<o:p></o:p></pre><pre>Registered Court: Amtsgericht Potsdam HRB 12345<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>This E-Mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this E-Mail in error) please notify the sender immediately and destroy this email. Any unauthorized copying, disclosure or distribution of the material in this email is strictly forbidden.<o:p></o:p></pre><pre>  <o:p></o:p></pre>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div class=MsoNormal align=center style='text-align:center'>

<hr size=4 width="90%" align=center>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%"
 style='width:100.0%'>
 <tr>
  <td style='padding:0cm 0cm 0cm 0cm'>
  <div>
  <p class=MsoNormal>Subject: <o:p></o:p></p>
  </div>
  <p class=MsoNormal>Re: [OpenLayers-Dev] [OpenLayers-Users] Performance and
  Memoryusagemeasuring: How To<o:p></o:p></p>
  </td>
 </tr>
 <tr>
  <td style='padding:0cm 0cm 0cm 0cm'>
  <div>
  <p class=MsoNormal>From: <o:p></o:p></p>
  </div>
  <p class=MsoNormal>&quot;Kris Geusebroek&quot; <a
  href="mailto:kgeusebroek@xebia.com">&lt;kgeusebroek@xebia.com&gt;</a><o:p></o:p></p>
  </td>
 </tr>
 <tr>
  <td style='padding:0cm 0cm 0cm 0cm'>
  <div>
  <p class=MsoNormal>Date: <o:p></o:p></p>
  </div>
  <p class=MsoNormal>Thu, 14 May 2009 09:48:45 +0200<o:p></o:p></p>
  </td>
 </tr>
 <tr>
  <td style='padding:0cm 0cm 0cm 0cm'>
  <div>
  <p class=MsoNormal>To: <o:p></o:p></p>
  </div>
  <p class=MsoNormal><a href="mailto:peter@peterse-uithuizen.com">&lt;peter@peterse-uithuizen.com&gt;</a>,
  &quot;OpenLayers mailinglijst&quot; <a href="mailto:users@openlayers.org">&lt;users@openlayers.org&gt;</a>,
  <a href="mailto:dev@openlayers.org">&lt;dev@openlayers.org&gt;</a><o:p></o:p></p>
  </td>
 </tr>
</table>

<p class=MsoNormal><span style='display:none'><o:p>&nbsp;</o:p></span></p>

<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%"
 style='width:100.0%'>
 <tr>
  <td style='padding:0cm 0cm 0cm 0cm'>
  <div>
  <p class=MsoNormal>To: <o:p></o:p></p>
  </div>
  <p class=MsoNormal><a href="mailto:peter@peterse-uithuizen.com">&lt;peter@peterse-uithuizen.com&gt;</a>,
  &quot;OpenLayers mailinglijst&quot; <a href="mailto:users@openlayers.org">&lt;users@openlayers.org&gt;</a>,
  <a href="mailto:dev@openlayers.org">&lt;dev@openlayers.org&gt;</a><o:p></o:p></p>
  </td>
 </tr>
</table>

<p class=MsoNormal><br>
<br>
<o:p></o:p></p>

<pre>Hi all,<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Sadly i didn't get any replies on this mail so I investigated further<o:p></o:p></pre><pre>myself and found a partial solution.<o:p></o:p></pre><pre>It seems that IE leaves a reference to the element which is removed with<o:p></o:p></pre><pre>the removeChild method.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Since this method is heavily used in OpenLayers refreshing a layer often<o:p></o:p></pre><pre>will add Dom elements to the memory all the time.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>I created a patch to replace the removeChild method (at least the cases<o:p></o:p></pre><pre>where an element can be removed really) by a utility method which really<o:p></o:p></pre><pre>removes an element.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>I attached a patch file to this email for those who are in need of a<o:p></o:p></pre><pre>solution.<o:p></o:p></pre><pre>Still there's a small amount of memory added on every refresh (talking<o:p></o:p></pre><pre>about 40-100 kB every refresh) which I'm not able to pinpoint.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>QUESTION: is there any tool which I can use to inspect the memory and<o:p></o:p></pre><pre>see which elements are using memory??<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Cheers Kris<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>-----Original Message-----<o:p></o:p></pre><pre>From: <a
href="mailto:users-bounces@openlayers.org">users-bounces@openlayers.org</a> [<a
href="mailto:users-bounces@openlayers.org">mailto:users-bounces@openlayers.org</a>]<o:p></o:p></pre><pre>On Behalf Of Kris Geusebroek<o:p></o:p></pre><pre>Sent: Friday, May 08, 2009 4:14 PM<o:p></o:p></pre><pre>To: <a
href="mailto:peter@peterse-uithuizen.com">peter@peterse-uithuizen.com</a>; OpenLayers mailinglijst<o:p></o:p></pre><pre>Subject: Re: [OpenLayers-Users] Performance and Memoryusage measuring:<o:p></o:p></pre><pre>How To<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Hi all,<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Ive tied out sIeve to measure leaks and memory usage of my OpenLayers<o:p></o:p></pre><pre>client and see some strange things.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>I have a Vector layer with bbox strategy and wfs protocol that refreshes<o:p></o:p></pre><pre>every 5 seconds.<o:p></o:p></pre><pre>I have points wit h labels and some background image/stroke etc.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>If I zoom in on 1 feature every refresh 7 dom elements are added to the<o:p></o:p></pre><pre>#inUse.<o:p></o:p></pre><pre>If I check the in use elements I can see references to the previous id's<o:p></o:p></pre><pre>marked orphan and some not marked orphan (the reason for them is the<o:p></o:p></pre><pre>removeChild isn't called but they are mostly childs of orphan's).<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>However memory is not freed at all. Memory is only freed as I browse to<o:p></o:p></pre><pre>other page (<a
href="about:blank">about:blank</a> for example). But not all of the used memory is<o:p></o:p></pre><pre>freed.<o:p></o:p></pre><pre>Also when unloading my client a few (23) leaks are reported but not more<o:p></o:p></pre><pre>info.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Few questions:<o:p></o:p></pre><pre>How can I see what the memory is used for? are there other tools to see<o:p></o:p></pre><pre>memory use of the app.<o:p></o:p></pre><pre>Should I care about the orphaned dom elements and children of them?<o:p></o:p></pre><pre>How can I  see what the leaks are about?<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Any help Is much appreciated (been banging my head all day now)<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Cheers Kris<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>Users mailing list<o:p></o:p></pre><pre><a
href="mailto:Users@openlayers.org">Users@openlayers.org</a><o:p></o:p></pre><pre><a
href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a><o:p></o:p></pre><pre>  <o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre
style='text-align:center'>

<hr size=4 width="90%" align=center>

</pre><pre><o:p>&nbsp;</o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>Users mailing list<o:p></o:p></pre><pre><a
href="mailto:Users@openlayers.org">Users@openlayers.org</a><o:p></o:p></pre><pre><a
href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a><o:p></o:p></pre>

<p class=MsoNormal><br>
<br>
<br>
<o:p></o:p></p>

<pre>-- <o:p></o:p></pre><pre>--- <o:p></o:p></pre><pre>Adrian Popa<o:p></o:p></pre><pre>NOC Division<o:p></o:p></pre><pre>Network Engineer<o:p></o:p></pre><pre>Divizia Centrul National de Operare Retea<o:p></o:p></pre><pre>Departament Transport IP &amp; Metro<o:p></o:p></pre><pre>Compartiment IP Core &amp; Backbone<o:p></o:p></pre><pre>Phone: +40 21 400 3099<o:p></o:p></pre></div>

</body>

</html>