Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is this a MapView Bug?

I am implementing an app that uses Google Maps. During debugging I found an interesting error which you can easily reproduce (I hope). If you test the Hello MapView example from Google:

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

The error: If you slide to any direction fast (try diagonal direction), for a period of time, you will probably get the following error:

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

The map crashes. Any idea how to solve this?

like image 921
user1238247 Avatar asked Feb 28 '12 15:02

user1238247


1 Answers

Think Google Maps crashes with OutOfMemoryError I catched it few times on my HTC Wildfire. It can be easly reproduced on devices with small heap memory. When you slide (resize) fast you will exceed all your heap. Think that garbage collector in some cases can't release memory so fast and you running into out of memory.

like image 57
Saasha Avatar answered Oct 02 '22 07:10

Saasha