<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Memory Leak on ArcGISDynamicMapServiceLayer?! in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/memory-leak-on-arcgisdynamicmapservicelayer/m-p/193896#M4523</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thank you odoe!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did remove a lot of stuff, but it still increase even in this simple code. However, I will keep monitor the memory and see if it will reduce after map loaded. At least mine is not free in couple of seconds.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Jul 2010 10:58:33 GMT</pubDate>
    <dc:creator>tommywang</dc:creator>
    <dc:date>2010-07-14T10:58:33Z</dc:date>
    <item>
      <title>Memory Leak on ArcGISDynamicMapServiceLayer?!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/memory-leak-on-arcgisdynamicmapservicelayer/m-p/193894#M4521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm developing an application through the Sample Flex Viewer, and found a weird memory leak. I made a simple test application to test it out, and re-generate the problem. It's like every time I update the dynamicMapServiceLayer, 4MB memory will be added into the browser.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to update the layer visibility and layer definition on the fly through the code, and every time this function is called, I got the image back and everything looks good except the memory the leak. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Check the code below, hope someone can help me figure out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map1.visible=true;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //create the Dynamic Map service object
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var myDLayer:ArcGISDynamicMapServiceLayer = map1.layers[0] as ArcGISDynamicMapServiceLayer;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Change the layers visibility, I have 3 layers in this service
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var myVisLayers:ArrayCollection = new ArrayCollection();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myVisLayers.addItem("0");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myVisLayers.addItem("1");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myVisLayers.addItem("2");

&amp;nbsp;&amp;nbsp; //initial layer definition array
&amp;nbsp;&amp;nbsp; var myLayerDefinitions:Array = new Array();
&amp;nbsp;&amp;nbsp; myLayerDefinitions.push("");
&amp;nbsp;&amp;nbsp; myLayerDefinitions.push("");
&amp;nbsp;&amp;nbsp; myLayerDefinitions.push("");
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; myDLayer.visibleLayers= myVisLayers;
&amp;nbsp;&amp;nbsp; myVisLayers=null;
&amp;nbsp;&amp;nbsp; myDLayer.layerDefinitions = myLayerDefinitions;
&amp;nbsp;&amp;nbsp; myLayerDefinitions=null;
&amp;nbsp;&amp;nbsp; myDLayer.alpha = 1;
&amp;nbsp;&amp;nbsp; myDLayer.visible=true;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myDLayer.Refresh()

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jul 2010 19:04:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/memory-leak-on-arcgisdynamicmapservicelayer/m-p/193894#M4521</guid>
      <dc:creator>tommywang</dc:creator>
      <dc:date>2010-07-13T19:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Memory Leak on ArcGISDynamicMapServiceLayer?!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/memory-leak-on-arcgisdynamicmapservicelayer/m-p/193895#M4522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can reproduce this, but in my case the memory is freed up after a few seconds. Turning a Dynamic Map Service visbility from false to true does add about 4MB of load to the memory. But like I said, when I monitor my app, it clears up after a few seconds.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I imagine it has to do with Flash reloading the cached tiles from browser memory, but that's just a guess. Flash Garbage collection can be a bit tricky, you can never really determine when it will happen, you can't force it in a production environment. Best you can do is make sure you remove listeners and unused objects and cross your fingers. &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jul 2010 20:01:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/memory-leak-on-arcgisdynamicmapservicelayer/m-p/193895#M4522</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2010-07-13T20:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Memory Leak on ArcGISDynamicMapServiceLayer?!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/memory-leak-on-arcgisdynamicmapservicelayer/m-p/193896#M4523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thank you odoe!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did remove a lot of stuff, but it still increase even in this simple code. However, I will keep monitor the memory and see if it will reduce after map loaded. At least mine is not free in couple of seconds.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jul 2010 10:58:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/memory-leak-on-arcgisdynamicmapservicelayer/m-p/193896#M4523</guid>
      <dc:creator>tommywang</dc:creator>
      <dc:date>2010-07-14T10:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Memory Leak on ArcGISDynamicMapServiceLayer?!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/memory-leak-on-arcgisdynamicmapservicelayer/m-p/193897#M4524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's a good blog post on this subject:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://blogagic.com/163/flex-memory-management-and-memory-leaks"&gt;http://blogagic.com/163/flex-memory-management-and-memory-leaks&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jul 2010 17:39:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/memory-leak-on-arcgisdynamicmapservicelayer/m-p/193897#M4524</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2010-07-14T17:39:51Z</dc:date>
    </item>
  </channel>
</rss>

