<?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: MapView freezes when leaving Activity (SDK v. 10.2) in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431093#M2922</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have been facing the same issue after upgrading to ArcGIS 10.2 SDK. Any updates to solve this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am testing on a Galaxy s3 running Android 4.3&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Jan 2014 03:43:28 GMT</pubDate>
    <dc:creator>ThomasBinu</dc:creator>
    <dc:date>2014-01-30T03:43:28Z</dc:date>
    <item>
      <title>MapView freezes when leaving Activity (SDK v. 10.2)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431092#M2921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After updating the SDK to version 10.2 we encounter a new problem which causes the app to freeze. The problem appears from time to time when the user the leaves the Activity which has a MapView in its layout. When I managed to investigate is that the problem is caused when the MapView object is removed from memory. Normally removing of MapView should look like this (logs from LogCat):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
 D/ArcGIS.LifeCycle(10955):&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSurface.destroyContext &amp;lt;start&amp;gt;:GLThread 554
 D/ArcGIS.LifeCycle(10955):&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSurface.destroyContext &amp;lt;- release WebMapTask&amp;gt;:GLThread 554
 D/ArcGIS.LifeCycle(10955):&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSurface.destroyContext &amp;lt;- shutdown threadpool&amp;gt;
 D/ArcGIS.LifeCycle(10955):&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSurface.destroyContext &amp;lt;- pause (release)&amp;gt;
 D/ArcGIS.LifeCycle(10955):&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSurface released
 D/ArcGIS.LifeCycle(10955):&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSurface.destroyContext &amp;lt;- recycle layers&amp;gt;
 D/ArcGIS.LifeCycle(10955):&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSurface.destroyContext &amp;lt;- release map&amp;gt;
 D/ArcGIS.LifeCycle(10955):&amp;nbsp; &amp;lt; MapSurface.Context recycled. com.esri.android.map.MapSurface{418e66b0 V.E..... ........ 0,0-640,671}
 D/ArcGIS.LifeCycle(10955):&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSurface.destroyContext &amp;lt;- release done!&amp;gt;
 D/ArcGIS.LifeCycle(10955):&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSurface.destroyContext &amp;lt;done&amp;gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But from time to time it suddenly stops during this process, then the log look like that:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
 D/ArcGIS.LifeCycle(10955):&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSurface.destroyContext &amp;lt;start&amp;gt;:GLThread 554
 D/ArcGIS.LifeCycle(10955):&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSurface.destroyContext &amp;lt;- release WebMapTask&amp;gt;:GLThread 554
 D/ArcGIS.LifeCycle(10955):&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSurface.destroyContext &amp;lt;- shutdown threadpool&amp;gt;
 D/ArcGIS.LifeCycle(10955):&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSurface.destroyContext &amp;lt;- pause (release)&amp;gt;
 D/ArcGIS.LifeCycle(10955):&amp;nbsp;&amp;nbsp;&amp;nbsp; MapSurface released&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Next no further log is printed until the app notifies about the crash. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone encountered the same problem or found any solution to it ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2014 08:06:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431092#M2921</guid>
      <dc:creator>MarekJarzynski</dc:creator>
      <dc:date>2014-01-23T08:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: MapView freezes when leaving Activity (SDK v. 10.2)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431093#M2922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have been facing the same issue after upgrading to ArcGIS 10.2 SDK. Any updates to solve this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am testing on a Galaxy s3 running Android 4.3&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2014 03:43:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431093#M2922</guid>
      <dc:creator>ThomasBinu</dc:creator>
      <dc:date>2014-01-30T03:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: MapView freezes when leaving Activity (SDK v. 10.2)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431094#M2923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;After updating the SDK to version 10.2 we encounter a new problem which causes the app to freeze&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you saying that an app that worked as expected prior to 10.2 and after updating the app to 10.2 the issue started?&amp;nbsp; Has the source code for the app not changed only updating to 10.2 libraries?&amp;nbsp; Can you share any source to reproduce this issue?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Feb 2014 18:55:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431094#M2923</guid>
      <dc:creator>DanO_Neill</dc:creator>
      <dc:date>2014-02-03T18:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: MapView freezes when leaving Activity (SDK v. 10.2)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431095#M2924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have been doing some tests with the hello world map sample to replicate this issue. Well..it seems that the map activity seems to leaking small amounts of memory. I am not sure if this leak is related to the ANR issue we are having occasionally when user leaves the activity.You can replicate this issue by adding a plain android&amp;nbsp; activity before the Esri map activity and opening and closing the map activity couple of times and checking the heap dump. Even after invoking the garbage collector multiple times, we can still see many instances of the map activity in the heap dump. It seems that&amp;nbsp; some ArcgisTiledserviceLayer object is holding a reference to the activity which prevents it from being garbage collected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I followed the steps from the video on the link below to analyse the memory leaks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.youtube.com/watch?v=_CruQY55HOk"&gt;http://www.youtube.com/watch?v=_CruQY55HOk&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My test device was a Galaxy note 8.0 with Android 4.1.2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you verify this issue from your end?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have already tried putting map.recycle/map=null in onDestroy method but it did not work&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2014 05:34:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431095#M2924</guid>
      <dc:creator>ThomasBinu</dc:creator>
      <dc:date>2014-02-04T05:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: MapView freezes when leaving Activity (SDK v. 10.2)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431096#M2925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Are you saying that an app that worked as expected prior to 10.2 and after updating the app to 10.2 the issue started?&amp;nbsp; Has the source code for the app not changed only updating to 10.2 libraries?&amp;nbsp; Can you share any source to reproduce this issue?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Our application looks very similar to an example that tmsbn90 desribed. We've got main activity from which an app user can open new Activity containing MapView. I add three layers to the mapView, OpenStreetMapLayer as the background, ArcGISLocalTiledLayer in the front and Graphic layer for showing graphic markers. When we were using SDK v. 10.1 after entering the activity containing the map it was clearly visible that the application was using much more memory than in the beggining. We conducted tested which clearly shhowed that there are memory leakage problems. Single app used not more than 45-50 MB for RAM, after entering the map activity 10 times app used about 100 MB, it was clearly visible than every time the user entered the activity about 5 MB leaked. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That is why we decided to upgrade the SDK to 10.2 version. The problem with memory leakage disappeared, now the map activity is closed propearly, but from time to time while closing this activity the app crashes. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried various ideas to avoid this, what helped a bit was adding this piece of code before leaving the activity: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; if (mMapView != null) {
&amp;nbsp;&amp;nbsp; if (!mMapView.isRecycled()) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; Layer[] ll = mMapView.getLayers();
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (ll.length &amp;gt; 0) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (Layer layer : ll) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mMapView.removeLayer(layer);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layer.recycle();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; mMapView = null;
&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It removes all layers just before the app would do it. It helped a bit still the problem exists.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:22:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431096#M2925</guid>
      <dc:creator>MarekJarzynski</dc:creator>
      <dc:date>2021-12-11T19:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: MapView freezes when leaving Activity (SDK v. 10.2)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431097#M2926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you marcus0202. Although, I am surprised that after your 10.2 upgrade, the memory leak has disappeared. I did many tests today using the 10.1 and 10.2 SDK, and although the memory leak problem is not as bad as the 10.1 SDK, the leak still exists. If youanalyse the heap dump after some tests , you can see multiple instances of the map activity in the memory.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2014 11:06:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431097#M2926</guid>
      <dc:creator>ThomasBinu</dc:creator>
      <dc:date>2014-02-04T11:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: MapView freezes when leaving Activity (SDK v. 10.2)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431098#M2927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After using eclipse memory analayzer, is seems that i have a memory leak as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have noticed that the leak is happening when i add TPK to the map view (if i remove the TPK's then everything is OK).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also - i have unstoppable calles to GC_Concurrent when i use the TPK.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Feb 2014 05:25:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431098#M2927</guid>
      <dc:creator>teamIgal</dc:creator>
      <dc:date>2014-02-09T05:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: MapView freezes when leaving Activity (SDK v. 10.2)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431099#M2928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We have found the memory leak and it will be fixed in our next release, v10.2.2.&amp;nbsp; Thanks for everyone's help and patience with this issue.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Mar 2014 18:28:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431099#M2928</guid>
      <dc:creator>DanO_Neill</dc:creator>
      <dc:date>2014-03-07T18:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: MapView freezes when leaving Activity (SDK v. 10.2)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431100#M2929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;We have found the memory leak and it will be fixed in our next release, v10.2.2.&amp;nbsp; Thanks for everyone's help and patience with this issue.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;We have upgraded our application to 10.2.2 and can confirm the crashes and memory leaks have been fixed. Keep up the good work android team.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2014 14:02:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431100#M2929</guid>
      <dc:creator>ThomasBinu</dc:creator>
      <dc:date>2014-03-14T14:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: MapView freezes when leaving Activity (SDK v. 10.2)</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431101#M2930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;We have found the memory leak and it will be fixed in our next release, v10.2.2.&amp;nbsp; Thanks for everyone's help and patience with this issue.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;We have upgraded our application to 10.2.2 and can confirm the crashes and memory leaks have been fixed. Excellent work guys!!.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2014 14:03:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-freezes-when-leaving-activity-sdk-v-10-2/m-p/431101#M2930</guid>
      <dc:creator>ThomasBinu</dc:creator>
      <dc:date>2014-03-14T14:03:16Z</dc:date>
    </item>
  </channel>
</rss>

