First, the cause of outofmemeryerror?
Androd memory limit for each application
Second, get the Android phone app memory size phone different performance is also different, the phone itself memory may be small, so the memory size for each app is not the same.
Method One:
[Email protected]:/# adb Shell Getprop | grep dalvik.vm.heapgrowthlimit
[Dalvik.vm.heapgrowthlimit]: [96m]
Method Two:
Activitymanager Activitymanager = (activitymanager) context.getsystemservice (Context.activity_service);
Activitymanager.getmemoryclass ();
Activitymanager.getlargememoryclass ();
Method Three:
[Email protected]:/# adb Shell Cat/system/build.prop | grep heap
dalvik.vm.heapsize=256m
Dalvik.vm.heapstartsize=8m
dalvik.vm.heapgrowthlimit=96m
dalvik.vm.heaptargetutilization=0.75
Dalvik.vm.heapminfree=2m
Dalvik.vm.heapmaxfree=8m
Method Four:
Runtime.getruntime (). MaxMemory ()
Memory limits for Android individual apps