// Debug.MemoryInfo memoryInfo = new Debug.MemoryInfo();
// Debug.getMemoryInfo(memoryInfo);
// String memMessage = String.format(
// "Memory: Pss=%.2f MB, Private=%.2f MB, Shared=%.2f MB",
// memoryInfo.getTotalPss() / 1024.0,
// memoryInfo.getTotalPrivateDirty() / 1024.0,
// memoryInfo.getTotalSharedDirty() / 1024.0);
// Log.e("beryi", "5. "+memMessage);
Double allocated = new Double(Debug.getNativeHeapAllocatedSize())/new Double((1048576));
Double available = new Double(Debug.getNativeHeapSize())/1048576.0;
Double free = new Double(Debug.getNativeHeapFreeSize())/1048576.0;
DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(2);
df.setMinimumFractionDigits(2);
Log.d("TAG", "debug. =================================");
Log.d("TAG", "debug.heap native: allocated " + df.format(allocated)
+ "MB of " + df.format(available)
+ "MB (" + df.format(free)
+ "MB free)");
Log.d("TAG", "debug.memory: allocated: " + df.format(new Double(Runtime.getRuntime().totalMemory()/1048576))
+ "MB of " + df.format(new Double(Runtime.getRuntime().maxMemory()/1048576))
+ "MB (" + df.format(new Double(Runtime.getRuntime().freeMemory()/1048576))
+"MB free)");