<?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: Native memory usage keep increasing when activity is recreated in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/native-memory-usage-keep-increasing-when-activity/m-p/604345#M4168</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Patrick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your post and for catching this memory leak!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is to do with not disposing of the MapView on device rotation, which can best be handled in Android's @onDestroy callback as per:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #bbb529;"&gt;@Override 
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;protected void &lt;/SPAN&gt;&lt;SPAN style="color: #ffc66d;"&gt;onDestroy&lt;/SPAN&gt;() {
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832;"&gt;super&lt;/SPAN&gt;.&lt;SPAN style="background-color: #344134;"&gt;onDestroy&lt;/SPAN&gt;()&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #9876aa;"&gt;mMapView&lt;/SPAN&gt;.dispose()&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These samples will be updated accordingly!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Trevor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 01:54:59 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-12T01:54:59Z</dc:date>
    <item>
      <title>Native memory usage keep increasing when activity is recreated</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/native-memory-usage-keep-increasing-when-activity/m-p/604344#M4167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was playing with the samples available on Github (&lt;A class="link-titled" href="https://github.com/Esri/arcgis-runtime-samples-android" title="https://github.com/Esri/arcgis-runtime-samples-android"&gt;GitHub - Esri/arcgis-runtime-samples-android: ArcGIS Runtime SDK for Android Samples&lt;/A&gt;&amp;nbsp;) and while profiling one of the application, I observed that the native memory usage increases everytime I rotate the device (about 10Mb every rotation) as shown in the screenshot below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="raster-image-file-profiling" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/395384_raster-layer-file.png" style="width: 620px; height: 327px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I profiled two (&lt;A href="https://github.com/Esri/arcgis-runtime-samples-android/tree/master/java/raster-layer-file" style="color: #0366d6; background-color: #f6f8fa; text-decoration: none;" title="raster-layer-file"&gt;raster-layer-file&lt;/A&gt;&amp;nbsp;and &lt;A href="https://github.com/Esri/arcgis-runtime-samples-android/tree/master/java/raster-layer-service" style="color: #0366d6; background-color: #f6f8fa; text-decoration: none;" title="raster-layer-service"&gt;raster-layer-service&lt;/A&gt;)applications available in the samples repository and the issue was reproductable in both of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is reproductable in runtime100.1 and 100.2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2018 17:55:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/native-memory-usage-keep-increasing-when-activity/m-p/604344#M4167</guid>
      <dc:creator>PatrickBolduc</dc:creator>
      <dc:date>2018-01-31T17:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Native memory usage keep increasing when activity is recreated</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/native-memory-usage-keep-increasing-when-activity/m-p/604345#M4168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Patrick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your post and for catching this memory leak!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is to do with not disposing of the MapView on device rotation, which can best be handled in Android's @onDestroy callback as per:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #bbb529;"&gt;@Override 
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;protected void &lt;/SPAN&gt;&lt;SPAN style="color: #ffc66d;"&gt;onDestroy&lt;/SPAN&gt;() {
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832;"&gt;super&lt;/SPAN&gt;.&lt;SPAN style="background-color: #344134;"&gt;onDestroy&lt;/SPAN&gt;()&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #9876aa;"&gt;mMapView&lt;/SPAN&gt;.dispose()&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These samples will be updated accordingly!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Trevor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:54:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/native-memory-usage-keep-increasing-when-activity/m-p/604345#M4168</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T01:54:59Z</dc:date>
    </item>
  </channel>
</rss>

