Get Free Memory Size
import java.text.DecimalFormat; class Main{ /*** * * @return */ public static long getFreeMemorySize() { long size = -1L; try { Runtime info = Runtime.getRuntime(); size = info.freeMemory(); } catch (Exception e) { e.printStackTrace(); } return size; } }