Methods Summary |
---|
public long | getCachedSize()Amount of RAM that the kernel is being used for caches, not counting caches
that are mapped in to processes.
return getCachedSizeKb() * 1024;
|
public long | getCachedSizeKb()Amount of RAM that the kernel is being used for caches, not counting caches
that are mapped in to processes.
return mInfos[Debug.MEMINFO_BUFFERS]
+ mInfos[Debug.MEMINFO_CACHED] - mInfos[Debug.MEMINFO_MAPPED];
|
public long | getFreeSize()Amount of RAM that is not being used for anything.
return mInfos[Debug.MEMINFO_FREE] * 1024;
|
public long | getFreeSizeKb()Amount of RAM that is not being used for anything.
return mInfos[Debug.MEMINFO_FREE];
|
public long | getKernelUsedSize()Amount of RAM that is in use by the kernel for actual allocations.
return getKernelUsedSizeKb() * 1024;
|
public long | getKernelUsedSizeKb()Amount of RAM that is in use by the kernel for actual allocations.
return mInfos[Debug.MEMINFO_SHMEM] + mInfos[Debug.MEMINFO_SLAB]
+ mInfos[Debug.MEMINFO_VM_ALLOC_USED] + mInfos[Debug.MEMINFO_PAGE_TABLES]
+ mInfos[Debug.MEMINFO_KERNEL_STACK];
|
public long[] | getRawInfo()
return mInfos;
|
public long | getSwapFreeSizeKb()
return mInfos[Debug.MEMINFO_SWAP_FREE];
|
public long | getSwapTotalSizeKb()
return mInfos[Debug.MEMINFO_SWAP_TOTAL];
|
public long | getTotalSize()Total amount of RAM available to the kernel.
return mInfos[Debug.MEMINFO_TOTAL] * 1024;
|
public long | getTotalSizeKb()Total amount of RAM available to the kernel.
return mInfos[Debug.MEMINFO_TOTAL];
|
public long | getZramTotalSizeKb()
return mInfos[Debug.MEMINFO_ZRAM_TOTAL];
|
public void | readMemInfo()
// Permit disk reads here, as /proc/meminfo isn't really "on
// disk" and should be fast. TODO: make BlockGuard ignore
// /proc/ and /sys/ files perhaps?
StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskReads();
try {
Debug.getMemInfo(mInfos);
} finally {
StrictMode.setThreadPolicy(savedPolicy);
}
|