List of usage examples for android.os Debug getNativeHeapAllocatedSize
public static native long getNativeHeapAllocatedSize();
From source file:com.zoffcc.applications.zanavi.Navit.java
private static long calcAvailableMemory() { try {/* www .ja v a 2 s . co m*/ long value = Runtime.getRuntime().maxMemory(); String type = ""; if (android.os.Build.VERSION.SDK_INT >= 11) { value = (value / 1024 / 1024) - (Runtime.getRuntime().totalMemory() / 1024 / 1024); type = "JAVA"; } else { value = (value / 1024 / 1024) - (Debug.getNativeHeapAllocatedSize() / 1024 / 1024); type = "NATIVE"; } Log.i("Navit", "avail.mem size=" + value + "MB, type=" + type); return value; } catch (Exception e) { return 0L; } }