java - jmap dump not working -
no exception thrown still cant find dump.bin file in desktop folder, path wrong?
public static void dumpheap() { system.out.println("dumping data"); string name = managementfactory.getruntimemxbean().getname(); system.out.println("name :" + name); string pid = name.substring(0, name.indexof("@")); system.out.println("pid :" + pid); string[] cmd = { "jmap", "-dump:file=/users/myname/desktop/dump.bin", pid }; process p; try { p = runtime.getruntime().exec(cmd); } catch (ioexception e) { e.printstacktrace(); }
i had force using -f
public static void dumpheap() { system.out.println("dumping data"); string name = managementfactory.getruntimemxbean().getname(); system.out.println("name :" + name); string pid = name.substring(0, name.indexof("@")); system.out.println("pid :" + pid); string[] cmd = { "jmap", "-dump:file=/users/myname/desktop/dump.bin", "-f", pid }; process p; try { p = runtime.getruntime().exec(cmd); } catch (ioexception e) { e.printstacktrace(); }
Comments
Post a Comment