Is this a MapView bug?

I am using the Google Maps application. During debugging, I found an interesting error that you can easily reproduce (hopefully). If you check the Hello MapView example from Google:

http://developer.android.com/guide/tutorials/views/hello-mapview.html

Error: If you glide in any direction quickly (try the diagonal direction), you will probably get the following error over a certain period of time:

02-28 15:59:45.138: D/dalvikvm(26484): GC_CONCURRENT freed 2K, 13% free 18870K/21639K, paused 2ms+4ms 02-28 15:59:45.911: D/dalvikvm(26484): GC_FOR_ALLOC freed 1603K, 20% free 17396K/21639K, paused 14ms 02-28 15:59:45.911: I/dalvikvm-heap(26484): Grow heap (frag case) to 18.546MB for 1560976-byte allocation 02-28 15:59:45.942: D/dalvikvm(26484): GC_CONCURRENT freed 1K, 13% free 18919K/21639K, paused 2ms+2ms 02-28 15:59:54.271: D/dalvikvm(26484): GC_CONCURRENT freed 2794K, 19% free 17649K/21639K, paused 2ms+2ms 02-28 15:59:58.497: D/dalvikvm(26484): GC_CONCURRENT freed 856K, 18% free 17880K/21639K, paused 5ms+3ms 02-28 16:00:04.341: D/dalvikvm(26484): GC_CONCURRENT freed 1003K, 17% free 18063K/21639K, paused 4ms+4ms 02-28 16:00:11.083: D/skia(26484): ------- imageref_ashmem create failed <(null)> 131072 02-28 16:00:11.091: D/skia(26484): ------- imageref_ashmem create failed <(null)> 131072 02-28 16:00:11.614: D/skia(26484): ------- imageref_ashmem create failed <(null)> 131072 02-28 16:00:11.614: D/skia(26484): ------- imageref_ashmem create failed <(null)> 131072 02-28 16:00:11.638: D/skia(26484): ------- imageref_ashmem create failed <(null)> 131072 02-28 16:00:11.646: D/dalvikvm(26484): GC_CONCURRENT freed 1097K, 16% free 18222K/21639K, paused 2ms+6ms 02-28 16:00:11.646: D/skia(26484): ------- imageref_ashmem create failed <(null)> 131072 02-28 16:00:11.646: D/skia(26484): ------- imageref_ashmem create failed <(null)> 131072 

Card failed. Any idea how to solve this?

+7
source share
2 answers

Suppose Google Maps crashes with OutOfMemoryError I grabbed it several times on my HTC Wildfire. It can be easily played back on devices with small heap memory. When you move (resize) quickly, you exceed your entire pile. Think that the garbage collector in some cases cannot free up memory so quickly and you run out of memory.

+1
source

In many cases, intermittent crash behavior using MapView can be resolved by indicating what you specified with largeHeap in the application element in the manifest of your application, especially on large screen devices (tablets). This attribute is available starting from API level 11 (Android 3.0).

AndroidManifest.xml:

 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.ge.android.app" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="12" /> <application android:icon="@drawable/app" android:label="@string/app_name" android:debuggable="true" android:theme="@style/CustomTheme" android:largeHeap="true"> ... </application> ... </manifest> 

See also: Android Developer's Guide - Android manifest

+1
source

All Articles