Tuesday, 15 January 2013

android - how to set heap size to minimum when application was closed -



android - how to set heap size to minimum when application was closed -

i developing 1 android application using more images resolution 640*960 approximately. these images loaded bitmaps proper scaling factor.

when loading bitmpas heap size increasing , not decreasing though recycling bitmpas. read few theory's regarding issue maximum says 1 time heap increased not decreased @ all.

my problem if close application when heap size 10mb , , when reopen application heap starts 10mb. causes vm exceeds maximum heap memory , out of memory after time.

what have this, , guarantee application never close out recycling bitmaps.

can 1 please suggest me how minimze heap memory , solve oom.

even faced same problem....you can refer link loading bitmaps http://developer.android.com/training/displaying-bitmaps/load-bitmap.html

once heap size has exceeded limit garbage collector runs...and cleans unwanted object.so improve not phone call garbage collector run automatically.

applications running on api level 11+ can have android:largeheap="true" on element in manifest request larger-than-normal heap size

in oncreate method in activity can utilize this(i did'nt seek this) dalvik.system.vmruntime.getruntime().setminimumheapsize(yournumberhere);

android bitmap out-of-memory heap-memory

No comments:

Post a Comment