long total = Runtime.getRuntime().totalMemory(); long free = Runtime.getRuntime().freeMemory(); long max = Runtime.getRuntime().maxMemory();