// use HeapHprofBinWriter to write the heap dump
public void run() {
System.out.println("Dumping heap to " + dumpFile + " ...");
try {
new HeapHprofBinWriter().write(dumpFile);
System.out.println("Heap dump file created");
} catch (IOException ioe) {
System.err.println(ioe.getMessage());
}
}