private void displayBriefMemory () {final ActivityManager activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);ActivityManager.MemoryInfo info = new ActivityManager.MemoryInfo();activityManager.getMemoryInfo(info);Log.i(tag,"系统剩余内存:"+( info.availMem >> 10)+"k");Log.i(tag,"系统是否处于低内存运行:"+ info.lowMemory );Log.i(tag,"当系统剩余内存低于"+ info.threshold +"时就当作低内存运行");}使用 "adb shell procrank"命令
若是你想查看全部进程的内存使用状况,能够使用"adb shell procrank"命令。 shell
通常来讲内存占用大小有以下规律:VSS >= RSS >= PSS >= USS ide
看出每一个应用程序最高可用内存是多少。