JDK-4211929 : It would be cool if application could trigger a heap dump
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: java.lang.management
  • Affected Version: 1.2.0,1.3.1
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic,windows_2000
  • CPU: generic,x86
  • Submitted: 1999-02-16
  • Updated: 2005-12-20
  • Resolved: 2005-12-20
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Description
It would be useful if the application being debugged could trigger a JVMPI
heap dump.  It might be the case that a certain point in the program's
execution has a particularly interesting heap topology.  A developer debugging
such an application might find it useful to programmatically trigger a dump
at such a point, by calling a private, VM-specific API (like
sun.debug.jvmpi.Mumble.triggerHeapDump()).

Comments
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.
20-12-2005

EVALUATION This is already possible using the dumpHeap operation on the HotSpotDiagnosticMXBean.
21-11-2005