We have an application with a lot of bitmaps in memory. He does not work with
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
mistakes. Perhaps we really use too much memory; it is possible that we are a memory leak; itβs also possible that we are not doing anything wrong, and fragmentation of the heap is what kills us. (Since the Android garbage collector does not move live blocks, we can have megabytes for free and cannot allocate 50K.)
Is there any way to eliminate fragmentation? I was looking for something like maxAvail / memAvail, but didn't notice anything suitable.
source share