runtime_memory

public class RuntimeMemory {
    public void l(Class c) {
        Runtime run = Runtime.getRuntime();
        long max = run.maxMemory();
        long total = run.totalMemory();
        long free = run.freeMemory();
        long usable = max - total + free;
        // Log.e(this.getClass().getSimpleName(), c.getName()+" ::: 最大内存 = " + max + "\t 已分配内存 = " + (total/1024) + "k\t 已分配内存中的剩余空间 = " + free + "\t 最大可用内存 = " + usable +" >> 使用"+((total-free)/1024)+"k ");
        Log.e(this.getClass().getSimpleName(), c.getName()+" 已分配内存 = " + (total/1024) + "k >> 使用"+((total-free)/1024)+"k ");
    }
}

Last updated

Was this helpful?