- final ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
- Android.os.Debug.MemoryInfo[] memoryInfoArray = am.getProcessMemoryInfo(new int[]{android.os.Process.myPid()});
其中MemoryInfo類提供了API接口幫助我們獲取內存數據
USS: getTotalPrivateDirty()
RSS: getTotalSharedDirty()
PSS: getTotalPss()