[英]Java Heap Dump programmatically
我的情況是:
要以編程方式獲取堆轉儲,我需要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
好。 因此,似乎該問題和注釋中提到的2種方法僅在某些設備上有效。 如果其中一個有效,則另一個無效。 您必須將它們結合起來,它將起作用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.