| Issue 5621: | Bug: OutOfMemoryError | |
| 72 people starred this issue and may be notified of changes. | Back to list |
From time to time while zooming / panning map crashes due to OutOfMemoryError with the following stack trace: FATAL EXCEPTION: GLThread 85277 java.lang.OutOfMemoryError at android.graphics.Bitmap.nativeCreate(Native Method) at android.graphics.Bitmap.createBitmap(Bitmap.java:640) at android.graphics.Bitmap.createBitmap(Bitmap.java:620) at maps.r.l.a(Unknown Source) at maps.y.b.a(Unknown Source) at maps.y.b.a(Unknown Source) at maps.ah.az.a(Unknown Source) at maps.ah.bs.a(Unknown Source) at maps.v.g.a(Unknown Source) at maps.v.g.b(Unknown Source) at maps.p.p.l(Unknown Source) at maps.p.p.run(Unknown Source) I'm not sure what can be the reason of this crash, the only thing that comes to my mind is that application intensively uses ground overlays (adds and removes them quite frequently). Also I'm sure that I'm using the latest Google Play Services library which was released in May.
Jul 22, 2013
Small note, I'm seeing a lot of nested instances of java.lang.ref.FinalizerReference in the dump and they all are referencing on the bitmap which is probably removed from the map by the application. However there are no references on the bitmap from the application's objects, so it does not look like that some of application objects prevents finalization of bitmap.
Jul 22, 2013
Also here is another stack trace, maybe it will be helpful: Out of memory on a 8388624-byte allocation. "GLThread 94756" prio=5 tid=21 RUNNABLE | group="main" sCount=0 dsCount=0 obj=0x42041d38 self=0x573d5370 | sysTid=12004 nice=1 sched=0/0 cgrp=apps handle=1091925192 | schedstat=( 41558938885 9929969074 54140 ) utm=3831 stm=324 core=0 at android.graphics.Bitmap.nativeCreate(Native Method) at android.graphics.Bitmap.createBitmap(Bitmap.java:640) at android.graphics.Bitmap.createBitmap(Bitmap.java:620) at maps.r.l.a((null):-1) at maps.y.b.a((null):-1) at maps.y.b.a((null):-1) at maps.ah.az.a((null):-1) at maps.ah.bs.a((null):-1) at maps.v.g.a((null):-1) at maps.v.g.b((null):-1) at maps.p.p.l((null):-1) at maps.p.p.run((null):-1) And one more, that followed the above stack trace: FATAL EXCEPTION: GLThread 94756 java.lang.OutOfMemoryError at android.graphics.Bitmap.nativeCreate(Native Method) at android.graphics.Bitmap.createBitmap(Bitmap.java:640) at android.graphics.Bitmap.createBitmap(Bitmap.java:620) at maps.r.l.a(Unknown Source) at maps.y.b.a(Unknown Source) at maps.y.b.a(Unknown Source) at maps.ah.az.a(Unknown Source) at maps.ah.bs.a(Unknown Source) at maps.v.g.a(Unknown Source) at maps.v.g.b(Unknown Source) at maps.p.p.l(Unknown Source) at maps.p.p.run(Unknown Source)
Jul 25, 2013
One more note, maybe it will be helpful. I've noticed that instance of class maps.w.a is constantly growing, in one of heap dumps it had almost 12 MB on the heap. What I've also seen is that instance of maps.w.a is holding a lot of instance of maps.i.aw and in the nested HashMap it holds instance of maps.w.d and it is holding the most part of memory. In the case above when maps.w.a instance was 12 MB large this maps.w.d was holding about 1041 objects most of them were instances of maps.ap.i and maps.i.bt classes.
Jul 29, 2013
This exact issue started occurring in my app on July 13th (the date of the most recent release of Google Play Services, I believe). Stack Trace _________________________________ 0 java.lang.OutOfMemoryError 1 at android.graphics.Bitmap.nativeCreate(Native Method) 2 at android.graphics.Bitmap.createBitmap(Bitmap.java:640) 3 at android.graphics.Bitmap.createBitmap(Bitmap.java:620) 4 at maps.r.l.a(Unknown Source) 5 at maps.y.b.a(Unknown Source) 6 at maps.y.b.a(Unknown Source) 7 at maps.ah.az.a(Unknown Source) 8 at maps.ah.bs.a(Unknown Source) 9 at maps.v.g.a(Unknown Source) 10 at maps.v.g.b(Unknown Source) 11 at maps.p.p.l(Unknown Source) 12 at maps.p.p.run(Unknown Source)
Jul 31, 2013
Issue 5616 has been merged into this issue.
Oct 8, 2013
We're seeing the same thing. Looking at the heap dump it looks like it's holding references to map tiles. See attached file.
Oct 21, 2013
Any updates on this issue?
Jul 27, 2014
Issue 6863 has been merged into this issue.
Aug 6, 2014
Any update on this issue? Is still open for more than 1 year. We are having a lot of problems with this, specially on Galaxy S4.
Aug 6, 2014
Hello, I had a lot of problems with Galaxy S4 since I finally added largeHeap="true" in the manifest.
Aug 6, 2014
I am using both Google Maps and Osmdroid (Offline Map version) . I found one function to clear cache immediately from BitmapPool of Osmdroid library using this code: BitmapPool.getInstance().clearBitmapPool(); It is useful for me. You can find it in this link: https://code.google.com/p/osmdroid/source/browse/trunk/osmdroid-android/src/main/java/org/osmdroid/tileprovider/BitmapPool.java?r=1395
Aug 15, 2014
Thanks jepru... I think largeHeap="true" solved our problems also.
Sep 7, 2014
The Problem is, that newer devices (S4 or S5) have large resolutions ( Full HD ). The map-tiles getting resized on this devices and consuming lots of virtual memory. Extreme Example: - Lets say we have 3x4 = 12 tiles - Every tile has a resolution of 512x512px - The tiles getting upscaled to 1024x1024px - 12 X 1024px X 1024px X 4Byte = 50331648 Byte = 48MB(!) onyl for Bitmap Data (In reality it must be less, I think somethin around 35MB) VM heap size is still verry limited on S4 or S5 compared to their resolution, I think it is in fact regularly only 48MB per App (no matter how many intents are opened). So the memory usage for maps are at the cutting edge of what is allowed per process. If you using maps-api in your app and holding additional content in your memmory (e.g. bitmaps of your app-layout , etc...) you are ready to go for an OutOfMemoryError [It will be the initialization of bitmap data of a map-tile that couses the crash -> 'android.graphics.Bitmap.createBitmap']. In addition to support old devices I'm using http://developer.android.com/reference/com/google/android/gms/maps/SupportMapFragment.html . I suppose this rather contributes than reduces the memory-consumption because of old memory-menagement mechanisms. So I see the only opportunity for us developers is, to get larger virtual memory and the only thing WE can do is adding largeHeap="true" to the manifest. (Heap Size grows to 64 MB on S4). But this sometimes still isn't enough, if you want to use the Map embedded in a Fragment and you have some more GUI-Images for layouting your app. At this point we only can tall our USERS to change the behaviour of Android in allocating per-App-heapsize. But this is only possible with ROOT-previliges (e.g. with App RomToolbox, value "heapgrowthlimit" ) Hopefully there is someone who defeated this error, and will share his knowledge with us ...
Jul 30, 2015
Same problem here. We've been trying to track down a memory leak on the SupportMapFragment. We first thought it has to do with our code (did MAT analyzises) but none of our suspections were true. We even added a plain map (SupportMapFragment) that really does nothing. The heap grows every time we rotate the device and finally crashes. Then we thought, okay let's update the Google Play Service library and Android Support Library v4 to the newest version and test again: Same result :( I wonder how google solved this in their own Google Maps app. I tried to rotate there over 100 times and it doesn't crash.
Nov 3, 2015
I am facing the same issue after switching from Google Map V1 to V2. I downloaded the latest Google Play Services 8.3.0. I did all the recommendations by other people, GroundOverlay.remove(), GoogleMap.clear() and still did not help. Here is my stack trace: 11-02 15:39:59.051: E/AndroidRuntime(18046): java.lang.OutOfMemoryError 11-02 15:39:59.051: E/AndroidRuntime(18046): at android.graphics.Bitmap.nativeCreate(Native Method) 11-02 15:39:59.051: E/AndroidRuntime(18046): at android.graphics.Bitmap.createBitmap(Bitmap.java:809) 11-02 15:39:59.051: E/AndroidRuntime(18046): at android.graphics.Bitmap.createBitmap(Bitmap.java:786) 11-02 15:39:59.051: E/AndroidRuntime(18046): at android.graphics.Bitmap.createBitmap(Bitmap.java:753) 11-02 15:39:59.051: E/AndroidRuntime(18046): at com.google.maps.api.android.lib6.gmm6.n.c.i.a(Unknown Source) 11-02 15:39:59.051: E/AndroidRuntime(18046): at com.google.maps.api.android.lib6.gmm6.n.c.l.a(Unknown Source) 11-02 15:39:59.051: E/AndroidRuntime(18046): at com.google.maps.api.android.lib6.gmm6.n.c.l.a(Unknown Source) 11-02 15:39:59.051: E/AndroidRuntime(18046): at com.google.maps.api.android.lib6.gmm6.c.j.a(Unknown Source) 11-02 15:39:59.051: E/AndroidRuntime(18046): at com.google.maps.api.android.lib6.gmm6.c.r.a(Unknown Source) 11-02 15:39:59.051: E/AndroidRuntime(18046): at com.google.maps.api.android.lib6.gmm6.n.l.a(Unknown Source) 11-02 15:39:59.051: E/AndroidRuntime(18046): at com.google.maps.api.android.lib6.gmm6.n.l.b(Unknown Source) 11-02 15:39:59.051: E/AndroidRuntime(18046): at com.google.maps.api.android.lib6.gmm6.n.cj.g(Unknown Source) 11-02 15:39:59.051: E/AndroidRuntime(18046): at com.google.maps.api.android.lib6.gmm6.n.cj.run(Unknown Source)
Jun 1 (3 days ago)
Google seriously? Created Jul 16, 2013 and still Status:New ? it is now June 2016 +- 3 years later If it is invalid/outdated close it, fix it, reject it. Just do something. |
|
| ► Sign in to add a comment |
4.2 MB Download