1, 对java的四种引用要了解清楚
2, 调整堆内存。
设置最小堆内存:
private final static int CWJ_HEAP_SIZE = 6* 1024* 1024 ;
VMRuntime.getRuntime().setMinimumHeapSize(CWJ_HEAP_SIZE);
优化Dalvik虚拟机的堆内存分配:
private final static floatTARGET_HEAP_UTILIZATION = 0.75f;
VMRuntime.getRuntime().setTargetHeapUtilization(TARGET_HEAP_UTILIZATION);// call it in onCreate()
3, Bitmap及时回收:
if(bitmapObject.isRecycled()==false)
bitmapObject.recycle();
2, 调整堆内存。
设置最小堆内存:
private final static int CWJ_HEAP_SIZE = 6* 1024* 1024 ;
VMRuntime.getRuntime().setMinimumHeapSize(CWJ_HEAP_SIZE);
优化Dalvik虚拟机的堆内存分配:
private final static floatTARGET_HEAP_UTILIZATION = 0.75f;
VMRuntime.getRuntime().setTargetHeapUtilization(TARGET_HEAP_UTILIZATION);// call it in onCreate()
3, Bitmap及时回收:
if(bitmapObject.isRecycled()==false)
bitmapObject.recycle();