Here you can find the source of printMemory(String label)
public static void printMemory(String label)
//package com.java2s; public class Main { public static void printMemory(String label) { System.out.println(label); Runtime rt = Runtime.getRuntime(); System.out.println(" Total memory: " + rt.totalMemory()); System.out.println(" Free memory: " + rt.freeMemory()); System.out.println(" Max memory: " + rt.maxMemory()); }// w w w .ja v a 2s . com }