On Wed, Feb 8, 2012 at 5:01 PM, Lidia <[email protected]> wrote:
> Then, Is it possible to defragment the heap memory ?

Not that I am aware of.

> or to avoid heap fragmentation?

The only thing I can think of specifically addressing heap
fragmentation is to try to reuse large buffers rather than free the
memory, if you *know* that you can reuse those large buffers. For
example, on API Level 11 or higher, use inBitmap with
BitmapFactory.Options when reading in bitmaps.

Beyond that, try to use less memory overall, try to use smaller memory
allocations (e.g., smaller bitmaps), etc.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to