获取Android系统默认给每个app分配的内存上限

来源:互联网 发布:java集合结构图 编辑:程序博客网 时间:2024/05/21 22:50
ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);int memorySize = activityManager.getMemoryClass();

测试结果:
华为mate7:192m
小米4:128m
红米:128m
三星SM-N7508v:96m

Android4.0以后,可以通过在application节点中设置属性android:largeHeap=”true”来突破这个上限。

0 0
原创粉丝点击