Is it possible to execute 'jmap' at different spots inside my java-programm to generate dump files. I guess one must get the own process ID and than execute the command via Runtime().exec()
or similar. Didn't succeed though.
Chris
Is it possible to execute 'jmap' at different spots inside my java-programm to generate dump files. I guess one must get the own process ID and than execute the command via Runtime().exec()
or similar. Didn't succeed though.
Chris
Try:
String name = ManagementFactory.getRuntimeMXBean().getName();
String[] str = name.split("@");
Runtime.getRuntime().exec("jmap -dump:file=YOURFILENAME " + str[0]);