app获取整个应用程序分配的内存是多大

    int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024);  
        Log.e("TAG", "Max memory is " + maxMemory + "KB");  
        Log.e("TAG", "Max memory is " + maxMemory /1024 + "MB");  
        Log.e("TAG", "Max memory is " + maxMemory /1024/1024 + "GB");                              
//执行结果如下:
/*
    TAG    Max memory is 65536KB
    TAG    Max memory is 64MB
    TAG    Max memory is 0GB
*/

该应用程序被分配的内存大小为 64M

原文地址:https://www.cnblogs.com/jss4j/p/4387098.html