EVALUATION
As noted, this is possible in mustang - here's a sample code fragment to demonstrate how an application can create a heap dump of its own heap:
import java.lang.management.ManagementFactory;
import javax.management.ObjectName;
import javax.management.MBeanServer;
:
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
ObjectName oname = new ObjectName("com.sun.management:type=HotSpotDiagnostic");
Object[] params = { "heap.bin" };
String[] sigs= { "java.lang.String" };
mbs.invoke(oname, "dumpHeap", params, sigs);
The HotSpotDiagnosticMXBean was added via 6283436 so I'll this RFE as a dup.
|