Script to Generate HPROF

From Observer GigaFlow Support | VIAVI Solutions Inc.
Jump to: navigation, search
var ManagementFactory  = Java.type('java.lang.management.ManagementFactory');
var HotSpotDiagnosticMXBean= Java.type('com.sun.management.HotSpotDiagnosticMXBean');
var server = ManagementFactory.getPlatformMBeanServer();
   var mxBean = ManagementFactory.newPlatformMXBeanProxy(
     server, "com.sun.management:type=HotSpotDiagnostic", HotSpotDiagnosticMXBean.class);
   mxBean.dumpHeap("/tmp/dump1.hprof", true);