Linked Questions
34 questions linked to/from How to solve java.lang.OutOfMemoryError trouble in Android
1393 votes
44 answers
654k views
Strange OutOfMemory issue while loading an image to a Bitmap object
I have a ListView with a couple of image buttons on each row. When the user clicks the list row, it launches a new activity. I have had to build my own tabs because of an issue with the camera layout. ...
6 votes
2 answers
19k views
Android Studio: java.lang.OutOfMemoryError [duplicate]
I am trying to get my application to display different views when Image buttons are clicked. Its a fairly simple application, but I cant test to see if it works because I keep getting an Out of Memory ...
-1 votes
2 answers
5k views
Caused by: java.lang.reflect.InvocationTargetException [duplicate]
my activity is continuously crashing, this just shows only text on UI, please tell me what I am doing wrong.This is showing error in XML file but according to me the XML file is fine, I am not able to ...
3 votes
1 answer
888 views
OutOfMemoryError when loading ~200mb file from assets fodler [duplicate]
Android fails to allocate enough memory when I run application and want to load java.lang.OutOfMemoryError: Failed to allocate a 202728962 byte allocation with 14422192 free bytes and 171MB until ...
-3 votes
3 answers
592 views
Android Studio terminates app instantly [duplicate]
I am a beginner to Android and java programming. I have created a simple image slider app of 13(12 images are of 5 MB size and 1 is of 91 Kb) images with previous and next buttons. And when i try to ...
0 votes
3 answers
220 views
Out of Memory Error Image Loader [duplicate]
I have this application that loads images from a web service using the image loader 1.9.3 library and with having phones with low memory the image loader gives out of memory exception that is only ...
447 votes
32 answers
590k views
Android:java.lang.OutOfMemoryError: Failed to allocate a 23970828 byte allocation with 2097152 free bytes and 2MB until OOM
I want to show the Bitmap image in ImageView from sd card which is stored already. After run my application is crash and getting OutOfMemoryError error of: (java.lang.OutOfMemoryError: Failed to ...
840 votes
10 answers
356k views
How do I discover memory usage of my application in Android?
How can I find the memory used on my Android application, programmatically? I hope there is a way to do it. Plus, how do I get the free memory of the phone too?
224 votes
21 answers
237k views
Resize a large bitmap file to scaled output file on Android
I have a large bitmap (say 3888x2592) in a file. Now, I want to resize that bitmap to 800x533 and save it to another file. I normally would scale the bitmap by calling Bitmap.createBitmap method but ...
155 votes
9 answers
117k views
Detect application heap size in Android
How do you programmatically detect the application heap size available to an Android app? I heard there's a function that does this in later versions of the SDK. In any case, I'm looking for solution ...
56 votes
2 answers
29k views
When should I recycle a bitmap using LRUCache?
I'm using an LRUCache to cache bitmaps which are stored on the file system. I built the cache based on the examples here: http://developer.android.com/training/displaying-bitmaps/cache-bitmap.html ...
15 votes
5 answers
38k views
Android Throwing OutOfMemoryError "Failed to allocate a 164 byte allocation with 44 free bytes and 44B until OOM" (recursive case)
This app worked yesterday, but when starting to work this morning, I get the following error Throwing OutOfMemoryError "Failed to allocate a 164 byte allocation with 44 free bytes and 44B until OOM" (...
13 votes
6 answers
51k views
Android : java.lang.OutOfMemoryError:
I developed an application that uses lots of images on Android. There are lots of images present in drawable folder say more then 100, I am developing application for animation of images. I used ...
52 votes
1 answer
35k views
How to use JNI bitmap operations for helping to avoid OOM when using large images? [closed]
Background most of the times, getting OOM on android is due to using too many bitmaps and/or creating large bitmaps. recently i've decided to try out JNI in order to allow avoiding OOM by storing ...
39 votes
2 answers
25k views
How to cache bitmaps into native memory
For my 10,000 points, i've decided to contibute something with this cool website: a mechanism to cache bitmaps on native memory. Background Android devices have a very limited amount of memory for ...