2016-11-03 3 views
0

내 상황을 덤프 :자바 힙입니다 프로그래밍 방식

  • 자바 1.3 또는 1.8
  • 윈도우 CE 또는 Windows Mobile
  • PDA가 아닌 데스크탑을 사용할 수 없습니다
  • jmap.exe

프로그래밍 방식으로 힙 덤프를 얻으려면 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 
  • 어떻게 힙이 모두 다른 Javas에 프로그래밍 방식으로 덤프 만드는 방법이 더 많은 방법이 있습니까? ... 사용자가 메뉴를 클릭하면 덤프가 만들어집니다.
  • 힙 덤프를 얻기 위해 내 자신의 범용 알고리즘을 작성할 수 있습니까?
+1

시도해보십시오. https://blogs.oracle.com/sundararajan/entry/programmatically_dumping_heap_from_java –

답변

0

확인. 따라서이 질문과 언급에서 언급 된 2 가지 접근법은 일부 장치에서만 작동하는 것으로 보입니다. 그 중 하나가 작동하면 다른 하나는 작동하지 않습니다. 당신은 그들을 결합해야하고 그것은 작동합니다.