我的情况是:
要以编程方式获取堆转储,我需要类com.ibm.jvm.Dump,但此类通常不可用,因此我收到ClassNotFoundException。
// Has to be run like this:
// cmd> javaPath -Xdump -Xmn5m -jar myJarPath
Class dump = Class.forName("com.ibm.jvm.Dump");
dump.getMethod("JavaDump", new Class[] {}).invoke(null, null);
dump.getMethod("HeapDump", new Class[] {}).invoke(null, null);
dump.getMethod("SystemDump", new Class[] {}).invoke(null, null);
// On some devices may occur ClassNotFoundException com.ibm.jvm.Dump
// or is missing j9dmp24 (but I don't understand this as all DLLs are in the device)
// do not forget to add parameter -Xdump when you are running your app. This parameter should probably be the 1st.
// I had error UTE437: Unable to load formatStrings for j9mm .. So I had to add parameter -Xmn5m
答案 0 :(得分:0)
确定。因此,本问题和评论中提到的2种方法似乎只适用于某些设备。如果其中一个有效,另一个则无效。你必须将它们结合起来才能发挥作用。