public static void printMemoryStatus() { System.gc(); Runtime runtime = Runtime.getRuntime(); long l = runtime.freeMemory(); long l1 = runtime.totalMemory(); System.out.println("Total " + l1 + "\t Free " + l + "\t Used " + (l1 - l)); }