<?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: 4.17 Memory Issue - Angular in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140397#M13057</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fair enough&lt;BR /&gt;&lt;BR /&gt;If the test code looks fine, then there's no reason to assume our production code would have any issue, as the test code is just a simplified version.&amp;nbsp; I'll admit it's not idea to look at system memory, but I think it can be helpful, but as you pointed out that opens up many, many more possible memory issues.&lt;BR /&gt;&lt;BR /&gt;Best thing we can do is a long run test and see how it operates / handles over the next couple weeks. &lt;BR /&gt;&lt;BR /&gt;Thanks for you help &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Oct 2020 20:08:00 GMT</pubDate>
    <dc:creator>AndrewMurdoch1</dc:creator>
    <dc:date>2020-10-21T20:08:00Z</dc:date>
    <item>
      <title>4.17 Memory Issue - Angular</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140389#M13049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Day&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying out 4.17 with the following test repo:&amp;nbsp; &lt;A class="link-titled" href="https://github.com/docmur/angular-esri-memory-test/" title="https://github.com/docmur/angular-esri-memory-test/"&gt;GitHub - docmur/angular-esri-memory-test&lt;/A&gt;, I added in the new view.destroy and map.destroy but the memory is still not getting freed! &lt;BR /&gt;&lt;BR /&gt;Have I taken the correct steps to free the memory? &lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2020 15:49:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140389#M13049</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2020-10-13T15:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: 4.17 Memory Issue - Angular</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140390#M13050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrew, just confirming, is this issue continuation of your &lt;A _jive_internal="true" href="https://community.esri.com/thread/258078-memory-issue-arcgis-414-angular-memory-not-getting-freed"&gt;previous issue&lt;/A&gt;? At 4.17 there is a known issue with view.destroy() not fully releasing memory. Sorry about that, we've tentatively scheduled a fix for 4.18 in December.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your code looks correct, just one small note that when you call view.destroy() you shouldn't need to call map.destroy().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With that said, if Angular attaches any references to the MapView.container that could also cause items to be retained in memory and the ArcGIS JS API has no control over that.&amp;nbsp;Once we have a fix in place for view.destroy() it will be much easier to test for Angular related issues.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2020 17:59:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140390#M13050</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2020-10-13T17:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: 4.17 Memory Issue - Angular</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140391#M13051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey&lt;BR /&gt;&lt;BR /&gt;This would be a continuation, but to prevent from it getting bunched together I made this a new task.&amp;nbsp; To be fair the only change on this test repo is that I changed the version to 4.17 from next.&amp;nbsp;&amp;nbsp; If we need to wait until December that's fine.&lt;BR /&gt;&lt;BR /&gt;We'll wait for a fix, I just wanted to make sure this was known, feel free to use that code I posted for testing.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2020 18:20:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140391#M13051</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2020-10-13T18:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: 4.17 Memory Issue - Angular</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140392#M13052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Andrew, we did a bit more testing&amp;nbsp;in a stand-alone, non-Angular test app&amp;nbsp;and the 4.17 view.destroy() code appears to be working as expected, a few things to know:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;At 4.17, there will still be some items cached in memory after you call destroy(). For the MapView to be memory efficient it reuses the same instances of certain arrays and other objects. They are created once and reused.&lt;/LI&gt;&lt;LI&gt;The important thing is that memory usage does not increase after the first MapView is created.&lt;/LI&gt;&lt;LI&gt;If your user workflows call for a lot of back and forth between map-related pages and non-map-related&amp;nbsp;routes, we still recommend recycling MapViews rather than destroying them. I think I may have mentioned it in the previous issue, some customers with complex workflows have built a pool of MapViews&amp;nbsp;in an array that lets&amp;nbsp;a limited number of views be recycled.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A few things for you to try before you retest:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Remove &lt;A href="https://github.com/docmur/angular-esri-memory-test/blob/master/frontend/src/index.html#L19"&gt;both references to the JS API &lt;/A&gt;in your index.html. Esri-loader will take care of lazy loading the JS API when you call loadModules().&lt;/LI&gt;&lt;LI&gt;Add esri-loader to your package.json file as shown &lt;A href="https://github.com/Esri/angular-cli-esri-map/blob/master/package.json#L23"&gt;here&lt;/A&gt; using some variation of &lt;EM&gt;npm install &lt;A href="mailto:esri-loader@latest"&gt;esri-loader@latest&lt;/A&gt;&lt;/EM&gt;.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Remove this line from your package.json:&amp;nbsp;&lt;A href="https://github.com/docmur/angular-esri-memory-test/blob/master/frontend/package.json#L39"&gt;https://github.com/docmur/angular-esri-memory-test/blob/master/frontend/package.json#L39&lt;/A&gt;&amp;nbsp;and delete&amp;nbsp;esri-module-loader from node_modules. This is to make sure you only have one instance of esri-loader in memory.&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2020 01:01:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140392#M13052</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2020-10-14T01:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: 4.17 Memory Issue - Angular</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140393#M13053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Day&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Sorry for the delay in reply, I integrated your suggestions and added a much bigger data file.&amp;nbsp; This code is roughly laid out to match our production code:&lt;BR /&gt;&lt;BR /&gt;&lt;A class="link-titled" href="https://github.com/docmur/esri-printtask-issue/tree/master/src/app" title="https://github.com/docmur/esri-printtask-issue/tree/master/src/app"&gt;esri-printtask-issue/src/app at master · docmur/esri-printtask-issue · GitHub&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm still seeing the memory climb when I switch back and forth, is there anything else you can recommend? &lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Oct 2020 21:18:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140393#M13053</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2020-10-20T21:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: 4.17 Memory Issue - Angular</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140394#M13054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Andrew,&amp;nbsp;how are you measuring memory usage?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I use Chrome's "Take Snapshot" I'm not seeing any memory leaks. Here's the workflow I'm using:&lt;/P&gt;&lt;P&gt;1. Load app - take snapshot&lt;/P&gt;&lt;P&gt;2.&amp;nbsp;Open map - take snapshot (pan/zoom around a bit)&lt;/P&gt;&lt;P&gt;3.&amp;nbsp;Close map - take snapshot&lt;/P&gt;&lt;P&gt;4.&amp;nbsp;Repeat steps 2 &amp;amp; 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using your repo, I followed this pattern through 12 iterations and everything looks good. You can see the size of the sequential heap snapshots in this screen capture stay fairly consistent in size:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="347" src="https://community.esri.com/legacyfs/online/511435_pastedImage_1.png" style="border: 0px; margin: 2px 20px 0px;" width="157" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2020 18:19:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140394#M13054</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2020-10-21T18:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: 4.17 Memory Issue - Angular</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140395#M13055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Day&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My apologizes, I was exceedingly unclear.&amp;nbsp; When I mentioned I saw the memory climb, I was talking about the system monitor on my OS, the first screenshots are taken using the development repo, then I switched to our production version to get a much bigger network loaded.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The first picture is sitting on the dashboard before loading a map:&lt;BR /&gt;&lt;IMG alt="" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/511501_pastedImage_3.png" /&gt;&lt;BR /&gt;&lt;BR /&gt;After loading 1 map and going back to the dashboard;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/511505_pastedImage_4.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;After cycling that 5 more times, so I've loaded the map 6 times, and I'm back at the dashboard, this is after forced garbage collection:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/511506_pastedImage_5.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifically I'm referencing Brave, although I'll see the same activity from any Chromium based browser.&amp;nbsp; Oddly enough Firefox is stable and doesn't throw the memory around,&amp;nbsp;&amp;nbsp;&amp;nbsp; When I view the heap through the memory tab in the console, that's staying stable, it's the system memory that seems to be all over the board.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I run this same kind of test on our production version using the following network, which is 7000+ segments 45 Feature Layers, 10 of them having meaningful data :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-4" src="https://community.esri.com/legacyfs/online/511507_pastedImage_6.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I cycle through ~20 maps, and land back at the dashboard, after a forced garbage collection I'm setting at:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-5 jive-image" src="https://community.esri.com/legacyfs/online/511511_pastedImage_7.png" /&gt;&lt;/P&gt;&lt;P&gt;To be fair, this is much better then it was in 4.16, where that number would commonly go over 2 GiB+, but it seems something is still kicking around.&amp;nbsp; I've been sitting at the Dashboard for ~10+ minutes and that number is fairly stable.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2020 19:06:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140395#M13055</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2020-10-21T19:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: 4.17 Memory Issue - Angular</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140396#M13056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for clarifying.&amp;nbsp;Based on your additional info it sounds like things are working correctly in the JS API. And, we'll continue to make improvements. Just looking at total system memory usage&amp;nbsp;of an app, it's impossible to see what's really going on. For example, even the&amp;nbsp;browsers themselves can leak memory.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The definitive way to test&amp;nbsp;if the JS API is leaking memory is to run it in a stand-alone app.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2020 20:02:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140396#M13056</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2020-10-21T20:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: 4.17 Memory Issue - Angular</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140397#M13057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fair enough&lt;BR /&gt;&lt;BR /&gt;If the test code looks fine, then there's no reason to assume our production code would have any issue, as the test code is just a simplified version.&amp;nbsp; I'll admit it's not idea to look at system memory, but I think it can be helpful, but as you pointed out that opens up many, many more possible memory issues.&lt;BR /&gt;&lt;BR /&gt;Best thing we can do is a long run test and see how it operates / handles over the next couple weeks. &lt;BR /&gt;&lt;BR /&gt;Thanks for you help &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2020 20:08:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-17-memory-issue-angular/m-p/140397#M13057</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2020-10-21T20:08:00Z</dc:date>
    </item>
  </channel>
</rss>

