<?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: Map CPU usage after destroy in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-cpu-usage-after-destroy/m-p/255529#M23722</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes.&amp;nbsp; I referenced that discussion in my post with "This seems related to this discussion...".&amp;nbsp; There definitely does appear to still be issue (or regession) with the map destroying.&amp;nbsp; I was hoping to find some way to force it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Jun 2018 20:23:29 GMT</pubDate>
    <dc:creator>KrisKaplan1</dc:creator>
    <dc:date>2018-06-28T20:23:29Z</dc:date>
    <item>
      <title>Map CPU usage after destroy</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-cpu-usage-after-destroy/m-p/255527#M23720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When a map is&amp;nbsp;displayed, it regularly&amp;nbsp;uses&amp;nbsp;CPU every second or two (timers triggering requestAnimationFrames).&amp;nbsp; In the Chrome task manager, a tab with a map view constantly bounces around 5% (from zero to ten).&amp;nbsp; Unfortunately, even if the window is not active.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I would at least expect to be able to stop this CPU usage by destroying the MapView, and/or the Map.&amp;nbsp; But this does not seem to be the case.&amp;nbsp; Detaching the MapView from it's container and releasing the view and the map does not stop the CPU usage.&amp;nbsp; But perhaps I'm not stopping the map view properly (but I didn't notice any official documentation or sample about this).&amp;nbsp; I can reproduce this with a sample in the sandbox (e.g. &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=intro-mapview" rel="nofollow noopener noreferrer" target="_blank"&gt;intro-mapview&lt;/A&gt;) by adding the following attempt to cleanup code.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;setTimeout(() =&amp;gt; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; view.container = null
&amp;nbsp;&amp;nbsp;&amp;nbsp; view.map = null
&amp;nbsp;&amp;nbsp;&amp;nbsp; view = null
&amp;nbsp;&amp;nbsp;&amp;nbsp; map = null
}, 10000)&lt;/PRE&gt;&lt;P&gt;This seems related to&amp;nbsp;&lt;A _jive_internal="true" href="https://community.esri.com/thread/192190-how-to-remove-the-2d-map-from-the-dom" target="_blank"&gt;this discussion&lt;/A&gt;&amp;nbsp;and the suggestion is that removing the container reference and releasing the references is all it should take.&amp;nbsp; Removing the container reference from the view does do the majority of the detach of the canvas and surface from the dom, but there seems to be a reference keeping the timers firing and reacting.&amp;nbsp; How can we fully release the view?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:15:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-cpu-usage-after-destroy/m-p/255527#M23720</guid>
      <dc:creator>KrisKaplan1</dc:creator>
      <dc:date>2021-12-12T16:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Map CPU usage after destroy</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-cpu-usage-after-destroy/m-p/255528#M23721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you seen this thread?&amp;nbsp;&lt;A href="https://community.esri.com/thread/192190"&gt;How to remove the 2d map from the dom&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There was a bug with mapview at one point, which should have been fixed, per Esri discussions. Is it possible there are still issues with destroying completely?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2018 20:08:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-cpu-usage-after-destroy/m-p/255528#M23721</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2018-06-25T20:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Map CPU usage after destroy</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-cpu-usage-after-destroy/m-p/255529#M23722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes.&amp;nbsp; I referenced that discussion in my post with "This seems related to this discussion...".&amp;nbsp; There definitely does appear to still be issue (or regession) with the map destroying.&amp;nbsp; I was hoping to find some way to force it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2018 20:23:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-cpu-usage-after-destroy/m-p/255529#M23722</guid>
      <dc:creator>KrisKaplan1</dc:creator>
      <dc:date>2018-06-28T20:23:29Z</dc:date>
    </item>
  </channel>
</rss>

