long freeBefore = (Runtime.getRuntime().freeMemory() /1024);
System.gc();
long freeAfter = (Runtime.getRuntime().freeMemory() /1024);
long total = (Runtime.getRuntime().totalMemory() / 1024);

msg =
"Free RAM before garbage collection: " + freeBefore + "K\n" +
"Free RAM after garbage collection: " + freeAfter + "K\n" +
"Total RAM allowed for JAlbum: " + total + "K";

JOptionPane.showMessageDialog(window, msg, "Example tool", JOptionPane.INFORMATION_MESSAGE);
