public void logMem() { DecimalFormat df = new DecimalFormat(); df.setMaximumFractionDigits(0); df.setMinimumFractionDigits(0); String sRAMString = "RAM 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)"; Log.v(TAG, sRAMString);}