Android 内存 - 获取单个应用内存限制


方法一:

adb shell  getprop | grep dalvik.vm.heapgrowthlimit
 [dalvik.vm.heapgrowthlimit]: [64m]


方法二:

ActivityManager activityManager =(ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
activityManager.getMemoryClass();
activityManager.getLargeMemoryClass();


方法三:

adb shell cat /system/build.prop
dalvik.vm.heapstartsize=8m 
dalvik.vm.heapgrowthlimit=64m 
dalvik.vm.heapsize=256m


方法四:

Runtime.getRuntime().maxMemory()

 

posted @ 2019-03-11 14:18  技术新高度  阅读(755)  评论(0编辑  收藏  举报