<?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: Destruction of objects/graphics does not release memory in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/destruction-of-objects-graphics-does-not-release/m-p/527407#M2669</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One other thing which may be worth trying is to make sure that individual graphics are removed when you loop round and call&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;glm-&amp;gt;removeOne(graphic);&lt;/PRE&gt;&lt;P&gt;The call to remove a Graphic is asynchronous and you should wait for the graphicRemoved signal before removing the next. I'm not sure if that is affecting the work-flow that you use here but it may be worth investigation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Nov 2020 15:32:42 GMT</pubDate>
    <dc:creator>LukeSmallwood</dc:creator>
    <dc:date>2020-11-09T15:32:42Z</dc:date>
    <item>
      <title>Destruction of objects/graphics does not release memory</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/destruction-of-objects-graphics-does-not-release/m-p/527405#M2667</link>
      <description>&lt;P&gt;In your application objects/Graphics are created and destroyed.&lt;BR /&gt;Now we recognize that the memory allocated by Esri::ArcGISRuntime::Graphic is not released.&lt;BR /&gt;So our application runs out of memory is a few hours (instead of running days and weeks)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote a sample to reproduce the issue:&lt;BR /&gt;1) start the program&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;gt; 185MB&lt;/P&gt;&lt;P&gt;2a) I create 100k objects (SimpleMarkerSymbol) -&amp;gt; exisiting objects: 100k:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;gt; 1008MB&lt;/P&gt;&lt;P&gt;2b) I destroy 100k objects (SimpleMarkerSymbol) -&amp;gt; exisiting objects: 0:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt; 1070MB&lt;/P&gt;&lt;P&gt;3a) create 100k objects..&lt;BR /&gt;3b) destroy..&lt;BR /&gt;-&amp;gt; exisiting objects: 0:&lt;BR /&gt;&amp;nbsp; ctc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3981 15.7&amp;nbsp; 7.2 3351616 1186460 pts/8 Sl+&amp;nbsp; 08:07&amp;nbsp;&amp;nbsp; 0:11 ./MemUsageWithManyMarker&lt;BR /&gt;&amp;nbsp; -&amp;gt; 1180MB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4a) create 100k objects..&lt;BR /&gt;4b) destroy..&lt;BR /&gt;-&amp;gt; exisiting objects: 0:&lt;BR /&gt;&amp;nbsp; ctc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3981 16.3&amp;nbsp; 7.5 3404684 1233580 pts/8 Sl+&amp;nbsp; 08:07&amp;nbsp;&amp;nbsp; 0:23 ./MemUsageWithManyMarker&lt;BR /&gt;&amp;nbsp; -&amp;gt; 1223MB&lt;BR /&gt;...&lt;/P&gt;&lt;P&gt;The memory isn´t released even if i destroy the a) the GraphicsOverlay, b) MapView or c) Map.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Following Cases/Bugs are created:&lt;/EM&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;Esri Case #02675513 - Destruction of objects/graphics does not release memory&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt;BUG-000135578: Appending 100,000 graphics to GraphicsOverlay causes memory leak&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;Esri Case #02688296 - increasing memory usage over time&lt;BR /&gt;BUG-000135793 - Creation of an additional 1,000 graphics after initially creating 100,000 graphics causes an increase in memory usage when using dynamic rendering mode&lt;BR /&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 02 Dec 2020 11:38:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/destruction-of-objects-graphics-does-not-release/m-p/527405#M2667</guid>
      <dc:creator>NorbertThoden</dc:creator>
      <dc:date>2020-12-02T11:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Destruction of objects/graphics does not release memory</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/destruction-of-objects-graphics-does-not-release/m-p/527406#M2668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Norbert, I hope you're well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We'll take a look at your repro to try and understand what is going on. In the meantime, one thing which may be of use is to try and avoid creating a new SimpleMarkerSymbol for each Graphic that you allocate:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #c0c0c0;"&gt;        &lt;/SPAN&gt;&lt;SPAN style="color: #55ff55;"&gt;Esri&lt;/SPAN&gt;::&lt;SPAN style="color: #55ff55;"&gt;ArcGISRuntime&lt;/SPAN&gt;::&lt;SPAN style="color: #55ff55;"&gt;SimpleMarkerSymbol&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;*sms&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;=&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN style="color: #c0c0c0;"&gt;          &lt;/SPAN&gt;&lt;SPAN style="color: #ffff55;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #55ff55;"&gt;Esri&lt;/SPAN&gt;::&lt;SPAN style="color: #55ff55;"&gt;ArcGISRuntime&lt;/SPAN&gt;::&lt;SPAN style="color: #55ff55;"&gt;SimpleMarkerSymbol&lt;/SPAN&gt;(&lt;SPAN style="color: #55ff55;"&gt;Esri&lt;/SPAN&gt;::&lt;SPAN style="color: #55ff55;"&gt;ArcGISRuntime&lt;/SPAN&gt;::&lt;SPAN style="color: #55ff55;"&gt;SimpleMarkerSymbolStyle&lt;/SPAN&gt;::&lt;SPAN style="color: #55ff55;"&gt;Circle&lt;/SPAN&gt;,&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #55ff55;"&gt;QColor&lt;/SPAN&gt;(&lt;SPAN style="color: #ff55ff;"&gt;"red"&lt;/SPAN&gt;),&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ff55ff;"&gt;10&lt;/SPAN&gt;,&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;graphic);&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN style="color: #c0c0c0;"&gt;        &lt;/SPAN&gt;graphic-&amp;gt;setSymbol(sms);&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can create a&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/qt/latest/cpp/api-reference/esri-arcgisruntime-simplerenderer.html" title="https://developers.arcgis.com/qt/latest/cpp/api-reference/esri-arcgisruntime-simplerenderer.html"&gt;SimpleRenderer&lt;/A&gt;&amp;nbsp; for the GraphicsOverlay instead, then each Graphic in that overlay will get the same symbol without having to allocate additional memory. This should be a more efficient workflow in general - this sample should give you an idea of how to use that API &lt;A class="link-titled" href="https://github.com/Esri/arcgis-runtime-samples-qt/tree/master/ArcGISRuntimeSDKQt_CppSamples/DisplayInformation/Simple_Renderer" title="https://github.com/Esri/arcgis-runtime-samples-qt/tree/master/ArcGISRuntimeSDKQt_CppSamples/DisplayInformation/Simple_Renderer"&gt;arcgis-runtime-samples-qt/ArcGISRuntimeSDKQt_CppSamples/DisplayInformation/Simple_Renderer at master · Esri/arcgis-runti…&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can see that this is a simplified repro project so if you are already doing that in the real example please ignore.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Luke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Nov 2020 15:10:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/destruction-of-objects-graphics-does-not-release/m-p/527406#M2668</guid>
      <dc:creator>LukeSmallwood</dc:creator>
      <dc:date>2020-11-09T15:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Destruction of objects/graphics does not release memory</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/destruction-of-objects-graphics-does-not-release/m-p/527407#M2669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One other thing which may be worth trying is to make sure that individual graphics are removed when you loop round and call&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;glm-&amp;gt;removeOne(graphic);&lt;/PRE&gt;&lt;P&gt;The call to remove a Graphic is asynchronous and you should wait for the graphicRemoved signal before removing the next. I'm not sure if that is affecting the work-flow that you use here but it may be worth investigation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Nov 2020 15:32:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/destruction-of-objects-graphics-does-not-release/m-p/527407#M2669</guid>
      <dc:creator>LukeSmallwood</dc:creator>
      <dc:date>2020-11-09T15:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: Destruction of objects/graphics does not release memory</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/destruction-of-objects-graphics-does-not-release/m-p/1003387#M3835</link>
      <description>&lt;P&gt;Hi Luke!&lt;BR /&gt;&lt;BR /&gt;Is there an example how to create and &lt;STRONG&gt;destroy&lt;/STRONG&gt; graphics as yopu suggested?&lt;/P&gt;&lt;P&gt;Thx&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 12:31:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/destruction-of-objects-graphics-does-not-release/m-p/1003387#M3835</guid>
      <dc:creator>NorbertThoden</dc:creator>
      <dc:date>2020-11-20T12:31:34Z</dc:date>
    </item>
  </channel>
</rss>

