Heap fragmentation measurement (Android)?

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.

+4
source share
1 answer

I would consider a bunch through MAT . The Eclipse Memory Analyzer helps you determine which of the problems you suggest you really have.

There was a conversation at Google I / O 2011 that covered some of the basics of memory management and debugging. You can watch it here: http://www.youtube.com/watch?v=_CruQY55HOk&feature=relmfu

+1
source

Source: https://habr.com/ru/post/1384413/


All Articles