1. Diese Seite verwendet Cookies. Wenn du dich weiterhin auf dieser Seite aufhältst, akzeptierst du unseren Einsatz von Cookies. Weitere Informationen

Mit Debugger interne HotSpot JVM Informationen auslesen in Java 7

Dieses Thema im Forum "Java" wurde erstellt von Thomas Darimont, 30. April 2012.

  1. Thomas Darimont

    Thomas Darimont Administrator

    Interner HotSpot Debugger in Java 7

    Hallo,

    wer schon immer mal in die HotSpot-Innerein der JVM abtauchen wollte hat mit dem Tool HSDB
    die Möglichkeit dazu.

    Seit Java 7 jdk1.7.0_01 gibt es im Verzeichnis %JAVA7_HOME%\lib\ das Jar: sa-jdi.jar

    In diesem Jar befindet sich eine interessante Java Anwendung (HSDB) welche man über folgenden Aufruf starten kann:
    Code (Text):
    1.  
    2. java -cp "C:\Program Files\Java\jdk1.7.0_03\lib\sa-jdi.jar" sun.jvm.hotspot.HSDB
    3.  
    Hat man die Anwendung gestartet kann man sich mit einem HotSpot JVM Java Prozess darauf verbinden, einen
    HotSpot Core Dump laden oder sich mit einem DebugServer verbinden.

    Für's erste berbinden wir uns mal mit einem HotSpot JVM Prozess - Dies geht beispielsweise über:
    File -> Attach to HotSpot Process im Eingabefeld gibt man nun die PID (Process ID) eines
    entsprechenden Java Prozesses ein. Die PID kann man unter Windows beispielsweise über den Taskmanager herausfinden oder das Java Tool: JPS vewenden.

    Code (Text):
    1.  
    2. C:\Users\Tom>jps
    3. 6896 HSDB
    4. 1180
    5. 7088 Jps
    6.  
    Der Java Prozess 1180 ohne Namen ist meine aktuell Laufende Eclipse Instanz. Ich vermute mal, dass bei der JVM hier kein Name angezeigt wird, da die JVM hier intern vom eclipse launcher (eclipse.exe) erzeugt wurde.

    Nichtsdestotrotz können wir uns mit dieser PID verbinden.

    Wir sehen eine Auflistung der aktuellen Java Threads mit Ihren OS Thread-Ids und Java Thread Names.
    Klicken wir auf einen Thread in der Liste sehen wir die interne Struktur des Threads. Insbesondere die
    echten Speicheradressen der hinter den Java Objekten liegenden HotSpot Strukturen.

    Darüber hinaus kann man über das menü Tools noch zahlreiche weitere Ansichten erreichen...
    Siehe Screenshots :)

    Btw. sollte jemand die folgende Fehlermeldung erhalten, dann sucht Java die sawindbg.dll an der falschen Stelle. Diese dll findet man beispielsweise in folgendem Verzeichnis:
    C:\Program Files\Java\jdk1.7.0_03\jre\bin hier muss man also gegebenenfalls die DLL kopieren, oder die Umgebungsvariablen entsprechend anpassen.

    Code (Text):
    1.  
    2. C:\Windows\system32>java -cp "C:\Program Files\Java\jdk1.7.0_03\lib\tools.jar;C:\Program Files\Java\jdk1.7.0_03\lib\sa-jdi.jar" sun.jvm.hotspot.HSDB
    3. Exception in thread "Thread-1" java.lang.UnsatisfiedLinkError: Can't load library: C:\Program Files\Java\jre7\bin\sawindbg.dll
    4.         at java.lang.ClassLoader.loadLibrary(Unknown Source)
    5.         at java.lang.Runtime.load0(Unknown Source)
    6.         at java.lang.System.load(Unknown Source)
    7.         at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.<clinit>(WindbgDebuggerLocal.java:651)
    8.         at sun.jvm.hotspot.HotSpotAgent.setupDebuggerWin32(HotSpotAgent.java:512)
    9.         at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:335)
    10.         at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:312)
    11.         at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:156)
    12.         at sun.jvm.hotspot.HSDB.attach(HSDB.java:1168)
    13.         at sun.jvm.hotspot.HSDB.access$1700(HSDB.java:53)
    14.         at sun.jvm.hotspot.HSDB$25$1.run(HSDB.java:436)
    15.         at sun.jvm.hotspot.utilities.WorkerThread$MainLoop.run(WorkerThread.java:66)
    16.         at java.lang.Thread.run(Unknown Source)
    17.  

    Viel Spaß damit!
    Gruß Tom

    Anhänge:

  2. saftmeister

    saftmeister Nutze den Saft! Premium-User

    Vielen vielen Dank für deine guten Tipps und dass du dieses Wissen so selbstlos weiter gibst.

    Frage zum dem Thema: Mit dem JDK6-Tool jstack (Command-Line) konnte man sich prima anzeigen lassen, welche Threads grad in der VM laufen und welcher auf welche Locks wartet usw. Kann man das mit dem Tool auch machen?

    Gibt es die jconsole bei JDK7 noch? Bin bisher nicht dazu gekommen und auch noch nicht bereit, mir das zu installieren... ;-)

    Danke und Grüße
  3. Thomas Darimont

    Thomas Darimont Administrator

    Hallo,

    Danke! Keine Ursache - das gleiche kann man von Dir sagen :) Eine Community wie unsere lebt halt vom gemeinsamen Wissen :) Also nur weiter so :D

    Ich hab zumindest mal einen Deadlock-Detector in dem Tool (HotspotDebugger) gesehen.. aber für solche Sachen würde ich Dir JVisualVM empfehlen (siehe unten) oder eben auch jstack. Für die weitere Analyse von Thread Dumps bietet sich auch das Tool TDA (Thread Dump Analyzer -> http://java.net/projects/tda) an.

    Ja JConsole gibt es noch, jedoch verliert das Tool immer mehr an Bedeutung, da es jetzt schon seit längerer Zeit (Java 6) im JDK das viel mächtigere Tool JVisualVM (C:\Program Files\Java\jdk1.7.0_03\bin\jvisualvm.exe) gibt :)


    Gruß Tom
  4. genodeftest

    genodeftest Erfahrenes Mitglied

    Danke!
    Bei mir läuft das allerdings nicht so gut. Gestartet habe ich (unter Linux) mit
    Code (Text):
    1. java -cp "/usr/lib/jvm/java-7-openjdk-amd64/lib/sa-jdi.jar" sun.jvm.hotspot.HSDB
    und HSDB zeigt nur an:
    Code (Text):
    1. Unable to connect to process ID 9156:
    2.  
    3. sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process
    EDIT:
    Ok, Da man unter Linux nicht mehr ohne höhere Rechte auf den Speicher anderer Prozesse zugreifen kann, braucht man höhere Rechte ;)
    Zuletzt bearbeitet: 1. Mai 2012
  5. Thomas Darimont

    Thomas Darimont Administrator

    Hallo,

    Ich wollte es gerade aus probieren ... funktioniert es jetzt bei Dir?
  6. genodeftest

    genodeftest Erfahrenes Mitglied

    Ja. aber dabei werden leider mit höheren Rechten unnötig Dateien im eigenen Benutzerkonto erstellt. Das Tool wurde also nicht an die neuen Gegebenheiten angepasst. Es funktioniert, aber suboptimal. Sollte man wohl nen BugReport erstellen, denn eigentlich würde es reichen, wenn das Auslesen des Speichers mit höheren Rechten abläuft, der Rest (besonders UI) sollte auf keinen Fall mit höheren Rechten laufen.
  7. Thomas Darimont

    Thomas Darimont Administrator

    Hallo,

    ein weiteres Tool in dem sa-jdi.jar SysPropDumper:
    Code (Text):
    1.  
    2. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.SysPropsDumper -h
    3. Usage: java sun.jvm.hotspot.tools.SysPropsDumper [option] <pid>
    4.                 (to connect to a live java process)
    5.    or java sun.jvm.hotspot.tools.SysPropsDumper [option] <executable> <core>
    6.                 (to connect to a core file)
    7.    or java sun.jvm.hotspot.tools.SysPropsDumper [option] [server_id@]<remote server IP or hostname>
    8.                 (to connect to a remote debug server)
    9.  
    10. where option must be one of:
    11.     -h | -help  to print this help message
    12.  

    Code (Text):
    1.  
    2. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar"
    3. sun.jvm.hotspot.tools.SysPropsDumper  PID
    4.  
    (PID mit Taskmanager oder jps ermitteln)

    Ausgabe:
    Code (Text):
    1.  
    2. Attaching to process ID 2996, please wait...
    3. Debugger attached successfully.
    4. Server compiler detected.
    5. JVM version is 23.0-b21
    6. java.vendor = Oracle Corporation
    7. ...
    8.  
    Gruß Tom
  8. Thomas Darimont

    Thomas Darimont Administrator

    Hallo,

    weiteres Tool StackTrace:
    Code (Text):
    1.  
    2. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.StackTrace -h
    3. Usage: java sun.jvm.hotspot.tools.StackTrace [option] <pid>
    4.                 (to connect to a live java process)
    5.    or java sun.jvm.hotspot.tools.StackTrace [option] <executable> <core>
    6.                 (to connect to a core file)
    7.    or java sun.jvm.hotspot.tools.StackTrace [option] [server_id@]<remote server IP or hostname>
    8.                 (to connect to a remote debug server)
    9.  
    10. where option must be one of:
    11.     -h | -help  to print this help message
    12.  
    13. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.StackTrace 2996
    14. Attaching to process ID 2996, please wait...
    15. Debugger attached successfully.
    16. Server compiler detected.
    17. JVM version is 23.0-b21
    18. Deadlock Detection:
    19.  
    20. No deadlocks found.
    21.  
    22. none
    23. null_check
    24. null_assert
    25. range_check
    26. class_check
    27. array_check
    28. intrinsic
    29. bimorphic
    30. unloaded
    31. uninitialized
    32. unreached
    33. unhandled
    34. constraint
    35. div0_check
    36. age
    37. ...
    38.  
    Gruß Tom
  9. Thomas Darimont

    Thomas Darimont Administrator

    Hallo,

    weiteres Tool PermStat:
    Code (Text):
    1.  
    2. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.PermStat
    3. Usage: java sun.jvm.hotspot.tools.PermStat [option] <pid>
    4.                 (to connect to a live java process)
    5.    or java sun.jvm.hotspot.tools.PermStat [option] <executable> <core>
    6.                 (to connect to a core file)
    7.    or java sun.jvm.hotspot.tools.PermStat [option] [server_id@]<remote server IP or hostname>
    8.                 (to connect to a remote debug server)
    9.  
    10. where option must be one of:
    11.     -h | -help  to print this help message
    12.  
    13. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.PermStat 2996
    14. Attaching to process ID 2996, please wait...
    15. Debugger attached successfully.
    16. Server compiler detected.
    17. JVM version is 23.0-b21
    18. finding class loader instances ..none
    19. null_check
    20. null_assert
    21. range_check
    22. class_check
    23. array_check
    24. intrinsic
    25. bimorphic
    26. unloaded
    27. uninitialized
    28. unreached
    29. unhandled
    30. constraint
    31. div0_check
    32. age
    33. predicate
    34. loop_limit_check
    35. Finding object size using Printezis bits and skipping over...
    36. Finding object size using Printezis bits and skipping over...
    37. done.
    38. computing per loader stat ..done.
    39. please wait.. computing liveness..........................done.
    40. class_loader    classes bytes   parent_loader   alive?  type
    41.  
    42. <bootstrap>     3436    22227264          null          live    <internal>
    43. 0x00000000f0311b48      0       0       0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    44. 0x00000000f030f9b8      46      581456  0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    45. 0x00000000ff4316c8      1       3104      null          dead    sun/reflect/DelegatingClassLoader@0x00000000eae521f0
    46. 0x00000000f0e14810      5       13104   0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    47. 0x00000000ff466cc0      1       3104      null          dead    sun/reflect/DelegatingClassLoader@0x00000000eae521f0
    48. 0x00000000f0365010      8       154560  0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    49. 0x00000000f022dfa8      104     1281880 0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    50. 0x00000000ff431288      1       3088      null          dead    sun/reflect/DelegatingClassLoader@0x00000000eae521f0
    51. 0x00000000f02ed810      10      110632  0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    52. 0x00000000f03568d8      15      122296  0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    53. 0x00000000ff447010      1       3088      null          dead    sun/reflect/DelegatingClassLoader@0x00000000eae521f0
    54. 0x00000000f0888d30      1       3088      null          dead    sun/reflect/DelegatingClassLoader@0x00000000eae521f0
    55. 0x00000000f0316aa0      0       0       0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    56. 0x00000000f03490a8      59      369376  0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    57. 0x00000000f042b0f0      1       1944      null          dead    sun/reflect/DelegatingClassLoader@0x00000000eae521f0
    58. 0x00000000ff4682e0      1       3088      null          dead    sun/reflect/DelegatingClassLoader@0x00000000eae521f0
    59. 0x00000000ff431388      1       3088      null          dead    sun/reflect/DelegatingClassLoader@0x00000000eae521f0
    60. 0x00000000f06b8b80      12      55368   0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    61. 0x00000000f0888c30      1       1928      null          dead    sun/reflect/DelegatingClassLoader@0x00000000eae521f0
    62. 0x00000000f0348388      19      170456  0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    63. 0x00000000f0243858      0       0       0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    64. 0x00000000ff4314c8      1       3088    0x00000000f04a8698      dead    sun/reflect/DelegatingClassLoader@0x00000000eae521f0
    65. 0x00000000f0888b70      1       1928      null          dead    sun/reflect/DelegatingClassLoader@0x00000000eae521f0
    66. 0x00000000f0301490      43      547744  0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    67. 0x00000000f033dad0      311     2791144 0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    68. 0x00000000f03117b0      0       0       0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    69. 0x00000000ff4315c8      1       3096      null          dead    sun/reflect/DelegatingClassLoader@0x00000000eae521f0
    70. 0x00000000f0d31660      37      490272  0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    71. 0x00000000f03159d0      167     1734712 0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    72. 0x00000000f0244fd8      61      374488  0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    73. 0x00000000f0a72140      358     3124184 0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    74. 0x00000000f0237318      0       0       0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    75. 0x00000000f0888e30      1       1928      null          dead    sun/reflect/DelegatingClassLoader@0x00000000eae521f0
    76. 0x00000000f0323830      0       0       0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    77. 0x00000000f02fafa0      0       0       0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    78. 0x00000000f0d2c290      9       72808   0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    79. 0x00000000ff431188      1       3096      null          dead    sun/reflect/DelegatingClassLoader@0x00000000eae521f0
    80. 0x00000000f03697d8      36      355472  0x00000000f04a8698      live    org/netbeans/StandardModule$OneModuleClassLoader@0x00000000ebb3e0d0
    81. 0x00000000ff469e48      1       3096      null          dead    sun/reflect/DelegatingClassLoader@0x00000000eae521f0
    82. ...
    83.  
    Gruß Tom
  10. Thomas Darimont

    Thomas Darimont Administrator

    Hallo,

    Tool PStack: Listet den nativen StackTrace auf
    Code (Text):
    1.  
    2. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.PStack
    3. Usage: java sun.jvm.hotspot.tools.PStack [option] <pid>
    4.                 (to connect to a live java process)
    5.    or java sun.jvm.hotspot.tools.PStack [option] <executable> <core>
    6.                 (to connect to a core file)
    7.    or java sun.jvm.hotspot.tools.PStack [option] [server_id@]<remote server IP or hostname>
    8.                 (to connect to a remote debug server)
    9.  
    10. where option must be one of:
    11.     -h | -help  to print this help message
    12.  
    13. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.PStack 2996
    14. Attaching to process ID 2996, please wait...
    15. Debugger attached successfully.
    16. Server compiler detected.
    17. JVM version is 23.0-b21
    18. none
    19. null_check
    20. null_assert
    21. range_check
    22. class_check
    23. array_check
    24. intrinsic
    25. bimorphic
    26. unloaded
    27. uninitialized
    28. unreached
    29. unhandled
    30. constraint
    31. div0_check
    32. age
    33. predicate
    34. loop_limit_check
    35. Finding object size using Printezis bits and skipping over...
    36. Finding object size using Printezis bits and skipping over...
    37. Finding object size using Printezis bits and skipping over...
    38. Finding object size using Printezis bits and skipping over...
    39. Finding object size using Printezis bits and skipping over...
    40. Deadlock Detection:
    41.  
    42. No deadlocks found.
    43.  
    44. ----------------- 0 -----------------
    45. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    46. 0xec8b485741564155              ****************
    47. sun.jvm.hotspot.debugger.DebuggerException: Windbg Error: ReadVirtual failed!
    48.         at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readBytesFromProcess0(Native Method)
    49.         at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readBytesFromProcess(WindbgDebuggerLocal.java:485)
    50.         at sun.jvm.hotspot.debugger.DebuggerBase$Fetcher.fetchPage(DebuggerBase.java:76)
    51.         at sun.jvm.hotspot.debugger.PageCache.getPage(PageCache.java:178)
    52.         at sun.jvm.hotspot.debugger.PageCache.getLong(PageCache.java:100)
    53.         at sun.jvm.hotspot.debugger.DebuggerBase.readCInteger(DebuggerBase.java:356)
    54.         at sun.jvm.hotspot.debugger.DebuggerBase.readAddressValue(DebuggerBase.java:454)
    55.         at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readAddress(WindbgDebuggerLocal.java:316)
    56.         at sun.jvm.hotspot.debugger.windbg.WindbgAddress.getAddressAt(WindbgAddress.java:72)
    57.         at sun.jvm.hotspot.debugger.cdbg.basic.amd64.AMD64CFrame.sender(AMD64CFrame.java:51)
    58.         at sun.jvm.hotspot.tools.PStack.run(PStack.java:161)
    59.         at sun.jvm.hotspot.tools.PStack.run(PStack.java:53)
    60.         at sun.jvm.hotspot.tools.PStack.run(PStack.java:48)
    61.         at sun.jvm.hotspot.tools.Tool.start(Tool.java:221)
    62.         at sun.jvm.hotspot.tools.PStack.main(PStack.java:189)
    63. ----------------- 1 -----------------
    64. Locked ownable synchronizers:
    65.     - None
    66. ----------------- 2 -----------------
    67. ----------------- 3 -----------------
    68. ----------------- 4 -----------------
    69. ----------------- 5 -----------------
    70. ----------------- 6 -----------------
    71. ----------------- 7 -----------------
    72. ----------------- 8 -----------------
    73. ----------------- 9 -----------------
    74. ----------------- 10 -----------------
    75. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    76. ----------------- 11 -----------------
    77. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    78. Locked ownable synchronizers:
    79.     - None
    80. ----------------- 12 -----------------
    81. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    82. Locked ownable synchronizers:
    83.     - None
    84. ----------------- 13 -----------------
    85. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    86. sun.jvm.hotspot.debugger.UnalignedAddressException: 1
    87.         at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal$1.checkAlignment(WindbgDebuggerLocal.java:104)
    88.         at sun.jvm.hotspot.debugger.DebuggerBase.readCInteger(DebuggerBase.java:349)
    89.         at sun.jvm.hotspot.debugger.DebuggerBase.readAddressValue(DebuggerBase.java:454)
    90.         at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readAddress(WindbgDebuggerLocal.java:316)
    91.         at sun.jvm.hotspot.debugger.windbg.WindbgAddress.getAddressAt(WindbgAddress.java:72)
    92.         at sun.jvm.hotspot.debugger.cdbg.basic.amd64.AMD64CFrame.sender(AMD64CFrame.java:51)
    93.         at sun.jvm.hotspot.tools.PStack.run(PStack.java:161)
    94.         at sun.jvm.hotspot.tools.PStack.run(PStack.java:53)
    95.         at sun.jvm.hotspot.tools.PStack.run(PStack.java:48)
    96.         at sun.jvm.hotspot.tools.Tool.start(Tool.java:221)
    97.         at sun.jvm.hotspot.tools.PStack.main(PStack.java:189)
    98. Locked ownable synchronizers:
    99.     - None
    100. ----------------- 14 -----------------
    101. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    102. 0x0000000000007365              ****************
    103. sun.jvm.hotspot.debugger.DebuggerException: Windbg Error: ReadVirtual failed!
    104.         at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readBytesFromProcess0(Native Method)
    105.         at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readBytesFromProcess(WindbgDebuggerLocal.java:485)
    106.         at sun.jvm.hotspot.debugger.DebuggerBase$Fetcher.fetchPage(DebuggerBase.java:76)
    107.         at sun.jvm.hotspot.debugger.PageCache.getPage(PageCache.java:178)
    108.         at sun.jvm.hotspot.debugger.PageCache.getLong(PageCache.java:100)
    109.         at sun.jvm.hotspot.debugger.DebuggerBase.readCInteger(DebuggerBase.java:356)
    110.         at sun.jvm.hotspot.debugger.DebuggerBase.readAddressValue(DebuggerBase.java:454)
    111.         at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readAddress(WindbgDebuggerLocal.java:316)
    112.         at sun.jvm.hotspot.debugger.windbg.WindbgAddress.getAddressAt(WindbgAddress.java:72)
    113.         at sun.jvm.hotspot.debugger.cdbg.basic.amd64.AMD64CFrame.sender(AMD64CFrame.java:51)
    114.         at sun.jvm.hotspot.tools.PStack.run(PStack.java:161)
    115.         at sun.jvm.hotspot.tools.PStack.run(PStack.java:53)
    116.         at sun.jvm.hotspot.tools.PStack.run(PStack.java:48)
    117.         at sun.jvm.hotspot.tools.Tool.start(Tool.java:221)
    118.         at sun.jvm.hotspot.tools.PStack.main(PStack.java:189)
    119. Locked ownable synchronizers:
    120.     - None
    121. ----------------- 15 -----------------
    122. Locked ownable synchronizers:
    123.     - None
    124. ----------------- 16 -----------------
    125. Locked ownable synchronizers:
    126.     - None
    127. ----------------- 17 -----------------
    128. Locked ownable synchronizers:
    129.     - None
    130. ----------------- 18 -----------------
    131. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    132. ----------------- 19 -----------------
    133. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    134. Locked ownable synchronizers:
    135.     - None
    136. ----------------- 20 -----------------
    137. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    138. Locked ownable synchronizers:
    139.     - None
    140. ----------------- 21 -----------------
    141. ----------------- 22 -----------------
    142. Locked ownable synchronizers:
    143.     - None
    144. ----------------- 23 -----------------
    145. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    146. 0x616c2f6176616a10              ****************
    147. sun.jvm.hotspot.debugger.DebuggerException: Windbg Error: ReadVirtual failed!
    148.         at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readBytesFromProcess0(Native Method)
    149.         at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readBytesFromProcess(WindbgDebuggerLocal.java:485)
    150.         at sun.jvm.hotspot.debugger.DebuggerBase$Fetcher.fetchPage(DebuggerBase.java:76)
    151.         at sun.jvm.hotspot.debugger.PageCache.getPage(PageCache.java:178)
    152.         at sun.jvm.hotspot.debugger.PageCache.getLong(PageCache.java:100)
    153.         at sun.jvm.hotspot.debugger.DebuggerBase.readCInteger(DebuggerBase.java:356)
    154.         at sun.jvm.hotspot.debugger.DebuggerBase.readAddressValue(DebuggerBase.java:454)
    155.         at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readAddress(WindbgDebuggerLocal.java:316)
    156.         at sun.jvm.hotspot.debugger.windbg.WindbgAddress.getAddressAt(WindbgAddress.java:72)
    157.         at sun.jvm.hotspot.debugger.cdbg.basic.amd64.AMD64CFrame.sender(AMD64CFrame.java:51)
    158.         at sun.jvm.hotspot.tools.PStack.run(PStack.java:161)
    159.         at sun.jvm.hotspot.tools.PStack.run(PStack.java:53)
    160.         at sun.jvm.hotspot.tools.PStack.run(PStack.java:48)
    161.         at sun.jvm.hotspot.tools.Tool.start(Tool.java:221)
    162.         at sun.jvm.hotspot.tools.PStack.main(PStack.java:189)
    163. Locked ownable synchronizers:
    164.     - None
    165. ----------------- 24 -----------------
    166. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    167. Locked ownable synchronizers:
    168.     - None
    169. ----------------- 25 -----------------
    170. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    171. Locked ownable synchronizers:
    172.     - None
    173. ----------------- 26 -----------------
    174. Locked ownable synchronizers:
    175.     - None
    176. ----------------- 27 -----------------
    177. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    178. Locked ownable synchronizers:
    179.     - None
    180. ----------------- 28 -----------------
    181. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    182. Locked ownable synchronizers:
    183.     - None
    184. ----------------- 29 -----------------
    185. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    186. Locked ownable synchronizers:
    187.     - None
    188. ----------------- 30 -----------------
    189. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    190. Locked ownable synchronizers:
    191.     - <0x00000000f06b7b38>, (a java/util/concurrent/locks/ReentrantLock$NonfairSync)
    192. ----------------- 31 -----------------
    193. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    194. Locked ownable synchronizers:
    195.     - None
    196. ----------------- 32 -----------------
    197. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    198. Locked ownable synchronizers:
    199.     - None
    200. ----------------- 33 -----------------
    201. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    202. Locked ownable synchronizers:
    203.     - None
    204. ----------------- 34 -----------------
    205. ----------------- 35 -----------------
    206. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    207. Locked ownable synchronizers:
    208.     - None
    209. ----------------- 36 -----------------
    210. 0x00000000772d135a      ntdll!NtWaitForSingleObject + 0xa
    211. 0x0000000001e21290              ****************
    212. 0x0000000001e20738              ****************
    213. 0x000000006402d9b0      jvm!JVM_EnableCompiler + 0x16d740
    214. 0x0d751c42391c418b              ****************
    215. sun.jvm.hotspot.debugger.UnalignedAddressException: 157518423918418b
    216.         at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal$1.checkAlignment(WindbgDebuggerLocal.java:104)
    217.         at sun.jvm.hotspot.debugger.DebuggerBase.readCInteger(DebuggerBase.java:349)
    218.         at sun.jvm.hotspot.debugger.DebuggerBase.readAddressValue(DebuggerBase.java:454)
    219.         at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readAddress(WindbgDebuggerLocal.java:316)
    220.         at sun.jvm.hotspot.debugger.windbg.WindbgAddress.getAddressAt(WindbgAddress.java:72)
    221.         at sun.jvm.hotspot.debugger.cdbg.basic.amd64.AMD64CFrame.sender(AMD64CFrame.java:51)
    222.         at sun.jvm.hotspot.tools.PStack.run(PStack.java:161)
    223.         at sun.jvm.hotspot.tools.PStack.run(PStack.java:53)
    224.         at sun.jvm.hotspot.tools.PStack.run(PStack.java:48)
    225.         at sun.jvm.hotspot.tools.Tool.start(Tool.java:221)
    226.         at sun.jvm.hotspot.tools.PStack.main(PStack.java:189)
    227. Locked ownable synchronizers:
    228.     - None
    229. ...
    230.  
    Gruß Tom
  11. Thomas Darimont

    Thomas Darimont Administrator

    Hallo,

    Tool PMap -> Listet die von dem Java Prozess geladenen nativen Bibliotheken (z.Bsp.: Windows Dlls) auf:
    Code (Text):
    1.  
    2. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.PMap
    3. Usage: java sun.jvm.hotspot.tools.PMap [option] <pid>
    4.                 (to connect to a live java process)
    5.    or java sun.jvm.hotspot.tools.PMap [option] <executable> <core>
    6.                 (to connect to a core file)
    7.    or java sun.jvm.hotspot.tools.PMap [option] [server_id@]<remote server IP or hostname>
    8.                 (to connect to a remote debug server)
    9.  
    10. where option must be one of:
    11.     -h | -help  to print this help message
    12.  
    13. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.PMap 2996
    14. Attaching to process ID 2996, please wait...
    15. Debugger attached successfully.
    16. Server compiler detected.
    17. JVM version is 23.0-b21
    18. 0x0000000063bc0000      7272K   C:\Program Files\Java\jdk1.7.0_04\jre\bin\server\jvm.dll
    19. 0x000000006d1e0000      1616K   C:\Program Files\Java\jdk1.7.0_04\jre\bin\awt.dll
    20. 0x000000006e740000      260K    C:\Program Files\Java\jdk1.7.0_04\jre\bin\t2k.dll
    21. 0x00000000730e0000      208K    C:\Program Files\Java\jdk1.7.0_04\jre\bin\fontmanager.dll
    22. 0x0000000073120000      68K     C:\Program Files\Java\jdk1.7.0_04\jre\bin\nio.dll
    23. 0x0000000073140000      252K    C:\Program Files\Java\jdk1.7.0_04\jre\bin\splashscreen.dll
    24. 0x0000000073180000      836K    C:\Program Files\Java\jdk1.7.0_04\jre\bin\msvcr100.dll
    25. 0x0000000073410000      100K    C:\Program Files\Java\jdk1.7.0_04\jre\bin\net.dll
    26. 0x0000000074920000      160K    C:\Program Files\Java\jdk1.7.0_04\jre\bin\java.dll
    27. 0x0000000074960000      84K     C:\Program Files\Java\jdk1.7.0_04\jre\bin\zip.dll
    28. 0x00000000749a0000      36K     C:\Program Files\Java\jdk1.7.0_04\jre\bin\attach.dll
    29. 0x00000000749b0000      60K     C:\Program Files\Java\jdk1.7.0_04\jre\bin\verify.dll
    30. 0x0000000074af0000      44K     C:\Program Files\Java\jdk1.7.0_04\jre\bin\management.dll
    31. 0x0000000076ba0000      1000K   C:\Windows\system32\USER32.dll
    32. 0x0000000076f50000      1148K   C:\Windows\system32\kernel32.dll
    33. 0x0000000077280000      1700K   C:\Windows\SYSTEM32\ntdll.dll
    34. 0x0000000077440000      28K     C:\Windows\system32\PSAPI.DLL
    35. 0x000000013ffb0000      204K    C:\Program Files\Java\jdk1.7.0_04\jre\bin\java.exe
    36. 0x000007feef5f0000      640K    C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_a4d6a923711520a9\comctl32.dll
    37. 0x000007fef6e50000      60K     C:\Windows\system32\CSCAPI.dll
    38. 0x000007fef6fb0000      512K    C:\Windows\system32\ntshrui.dll
    39. 0x000007fef7180000      48K     C:\Windows\System32\CSCDLL.dll
    40. 0x000007fef7190000      504K    C:\Windows\System32\cscui.dll
    41. 0x000007fef7210000      212K    C:\Windows\system32\EhStorShell.dll
    42. 0x000007fef7b40000      44K     C:\Windows\System32\winrnr.dll
    43. 0x000007fef7f20000      100K    C:\Windows\system32\pnrpnsp.dll
    44. 0x000007fef7f40000      84K     C:\Windows\system32\napinsp.dll
    45. 0x000007fef8a40000      32K     C:\Windows\system32\rasadhlp.dll
    46. 0x000007fefa0c0000      96K     C:\Windows\system32\dhcpcsvc.DLL
    47. 0x000007fefa0e0000      68K     C:\Windows\system32\dhcpcsvc6.DLL
    48. 0x000007fefa150000      332K    C:\Windows\System32\fwpuclnt.dll
    49. 0x000007fefacd0000      1192K   C:\Windows\system32\WindowsCodecs.dll
    50. 0x000007fefb1f0000      96K     C:\Windows\system32\DWMAPI.DLL
    51. 0x000007fefb320000      236K    C:\Windows\system32\WINMM.dll
    52. 0x000007fefbc40000      2000K   C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_fa396087175ac9ac\COMCTL32.dll
    53. 0x000007fefc180000      84K     C:\Windows\system32\NLAapi.dll
    54. 0x000007fefc1e0000      1200K   C:\Windows\system32\PROPSYS.dll
    55. 0x000007fefc6d0000      28K     C:\Windows\System32\wshtcpip.dll
    56. 0x000007fefcaf0000      364K    C:\Windows\system32\DNSAPI.dll
    57. 0x000007fefcc00000      28K     C:\Windows\System32\wship6.dll
    58. 0x000007fefcc10000      284K    C:\Windows\system32\rsaenh.dll
    59. 0x000007fefccc0000      340K    C:\Windows\system32\mswsock.dll
    60. 0x000007fefcf10000      92K     C:\Windows\system32\CRYPTSP.dll
    61. 0x000007fefd2f0000      348K    C:\Windows\system32\apphelp.dll
    62. 0x000007fefd350000      60K     C:\Windows\system32\CRYPTBASE.dll
    63. 0x000007fefd420000      44K     C:\Windows\system32\slc.dll
    64. 0x000007fefd430000      44K     C:\Windows\system32\WINNSI.DLL
    65. 0x000007fefd440000      156K    C:\Windows\system32\IPHLPAPI.DLL
    66. 0x000007fefd470000      36K     C:\Windows\system32\WSOCK32.dll
    67. 0x000007fefd5b0000      60K     C:\Windows\system32\profapi.dll
    68. 0x000007fefd5c0000      120K    C:\Windows\system32\USERENV.dll
    69. 0x000007fefd670000      140K    C:\Windows\system32\srvcli.dll
    70. 0x000007fefd900000      216K    C:\Windows\system32\CFGMGR32.dll
    71. 0x000007fefd940000      104K    C:\Windows\system32\DEVOBJ.dll
    72. 0x000007fefda40000      432K    C:\Windows\system32\KERNELBASE.dll
    73. 0x000007fefdab0000      13856K  C:\Windows\system32\SHELL32.dll
    74. 0x000007fefe840000      124K    C:\Windows\SYSTEM32\sechost.dll
    75. 0x000007fefe860000      32K     C:\Windows\system32\NSI.dll
    76. 0x000007fefe870000      2060K   C:\Windows\system32\ole32.dll
    77. 0x000007fefea80000      412K    C:\Windows\system32\GDI32.dll
    78. 0x000007fefeaf0000      1060K   C:\Windows\system32\MSCTF.dll
    79. 0x000007fefecc0000      184K    C:\Windows\system32\IMM32.DLL
    80. 0x000007fefecf0000      56K     C:\Windows\system32\LPK.dll
    81. 0x000007fefed00000      308K    C:\Windows\system32\WS2_32.dll
    82. 0x000007fefed50000      876K    C:\Windows\system32\ADVAPI32.dll
    83. 0x000007fefee30000      1884K   C:\Windows\system32\SETUPAPI.dll
    84. 0x000007feff010000      636K    C:\Windows\system32\msvcrt.dll
    85. 0x000007feff0b0000      1204K   C:\Windows\system32\RPCRT4.dll
    86. 0x000007feff1e0000      452K    C:\Windows\system32\SHLWAPI.dll
    87. 0x000007feff260000      804K    C:\Windows\system32\USP10.dll
    88. 0x000007feff330000      860K    C:\Windows\system32\OLEAUT32.DLL
    89. 0x000007feff4f0000      612K    C:\Windows\system32\CLBCatQ.DLL
    90.  
    91. C:\Users\tom>
    92.  
    Gruß Tom
  12. Thomas Darimont

    Thomas Darimont Administrator

    Hallo,

    Tool ObjectHistogram -> Berechnet ein ObjektHistogram auf Basis eines HeapSnapshots (da braucht man ja fast kein JVisualVM mehr *g*)
    Code (Text):
    1.  
    2. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.ObjectHistogram
    3. Usage: java sun.jvm.hotspot.tools.ObjectHistogram [option] <pid>
    4.                 (to connect to a live java process)
    5.    or java sun.jvm.hotspot.tools.ObjectHistogram [option] <executable> <core>
    6.                 (to connect to a core file)
    7.    or java sun.jvm.hotspot.tools.ObjectHistogram [option] [server_id@]<remote server IP or hostname>
    8.                 (to connect to a remote debug server)
    9.  
    10. where option must be one of:
    11.     -h | -help  to print this help message
    12.  
    13. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.ObjectHistogram 2996
    14. Attaching to process ID 2996, please wait...
    15. Debugger attached successfully.
    16. Server compiler detected.
    17. JVM version is 23.0-b21
    18. Iterating over heap. This may take a while...
    19. none
    20. null_check
    21. null_assert
    22. range_check
    23. class_check
    24. array_check
    25. intrinsic
    26. bimorphic
    27. unloaded
    28. uninitialized
    29. unreached
    30. unhandled
    31. constraint
    32. div0_check
    33. age
    34. predicate
    35. loop_limit_check
    36. Finding object size using Printezis bits and skipping over...
    37. Finding object size using Printezis bits and skipping over...
    38. Finding object size using Printezis bits and skipping over...
    39. Finding object size using Printezis bits and skipping over...
    40. Object Histogram:
    41.  
    42. num       #instances    #bytes  Class description
    43. --------------------------------------------------------------------------
    44. 1:              65557   8960024 * ConstMethodKlass
    45. 2:              65557   8931976 * MethodKlass
    46. 3:              6066    7273152 * ConstantPoolKlass
    47. 4:              56325   6240096 char[]
    48. 5:              6066    6002792 * InstanceKlassKlass
    49. 6:              9177    5385896 int[]
    50. 7:              5411    4622496 * ConstantPoolCacheKlass
    51. 8:              14708   1945544 byte[]
    52. 9:              54295   1737440 java.lang.String
    53. 10:             6491    787704  java.lang.Class
    54. 11:             23036   737152  java.util.HashMap$Entry
    55. 12:             1466    734776  * MethodDataKlass
    56. 13:             10035   648200  short[]
    57. 14:             12337   617496  java.lang.Object[]
    58. 15:             5693    520752  java.util.HashMap$Entry[]
    59. 16:             9654    500368  * System ObjArray
    60. 17:             4924    393920  java.lang.reflect.Method
    61. 18:             11594   371008  java.util.Hashtable$Entry
    62. 19:             5595    268560  java.util.HashMap
    63. 20:             6461    258440  java.util.TreeMap$Entry
    64. 21:             408     235008  * ObjArrayKlassKlass
    65. 22:             5426    217040  java.util.LinkedHashMap$Entry
    66. 23:             572     134064  long[]
    67. 24:             5519    132456  java.util.ArrayList
    68. 25:             1073    129536  java.util.Hashtable$Entry[]
    69. 26:             2516    120768  java.security.ProtectionDomain[]
    70. 27:             4849    116376  java.lang.Double
    71. 28:             6986    111776  java.lang.Object
    72. 29:             3389    108448  java.lang.ref.WeakReference
    73. 30:             1933    108248  java.nio.DirectLongBufferU
    74. 31:             2688    107520  java.util.WeakHashMap$Entry
    75. 32:             3231    103392  java.util.concurrent.ConcurrentHashMap$HashEntry
    76. 33:             4862    103304  java.lang.Class[]
    77. 34:             277     95288   javax.swing.JPanel
    78. 35:             2170    93360   java.lang.String[]
    79. 36:             1203    86616   java.lang.reflect.Field
    80. 37:             2696    86272   java.util.TreeMap$KeyIterator
    81. 38:             2087    83480   java.lang.ref.Finalizer
    82. 39:             2486    79552   javax.swing.text.html.parser.ContentModel
    83. 40:             2485    79520   java.security.AccessControlContext
    84. 41:             1927    77080   sun.jvmstat.perfdata.monitor.PerfLongMonitor
    85. 42:             140     68320   com.sun.java.swing.plaf.windows.WindowsScrollBarUI$WindowsArrowButton
    86. 43:             1207    67592   java.util.zip.ZipFile$ZipFileInputStream
    87. 44:             1331    63888   org.openide.util.RequestProcessor$FastItem
    88. 45:             1510    60400   java.lang.ref.SoftReference
    89. 46:             1258    60384   org.openide.util.RequestProcessor$EnqueueTask
    90. 47:             3010    48160   javax.swing.event.EventListenerList
    91. 48:             369     47488   java.util.WeakHashMap$Entry[]
    92. 49:             959     46032   java.util.Hashtable
    93. 50:             1675    40200   java.lang.StringBuilder
    94. 51:             558     40176   java.lang.reflect.Constructor
    95. 52:             1630    39120   java.lang.Long
    96. 53:             2357    37712   java.lang.Integer
    97. 54:             575     36800   org.openide.filesystems.MultiFileObject
    98. 55:             2223    35568   java.util.HashSet
    99. 56:             1477    35448   java.util.jar.Attributes$Name
    100. 57:             347     33312   java.lang.management.ThreadInfo
    101. 58:             679     32592   org.netbeans.lib.profiler.charts.swing.LongRect
    102. 59:             978     31296   java.awt.Rectangle
    103. 60:             491     30400   java.util.concurrent.ConcurrentHashMap$HashEntry[]
    104. 61:             564     30352   java.lang.reflect.Method[]
    105. 62:             472     30208   java.awt.event.InvocationEvent
    106. 63:             1232    30064   java.beans.PropertyChangeListener[]
    107. 64:             340     29920   javax.swing.text.html.InlineView
    108. 65:             74      29008   javax.swing.JLabel
    109. 66:             895     28640   javax.swing.text.html.StyleSheet$SmallConversionSet
    110. 67:             893     28576   java.util.concurrent.locks.ReentrantLock$NonfairSync
    111. 68:             853     27296   javax.swing.SizeRequirements
    112. 69:             680     27200   javax.swing.text.GapContent$MarkData
    113. 70:             1121    26904   java.beans.PropertyChangeSupport
    114. 71:             836     26752   org.openide.util.WeakListenerImpl$ListenerReference
    115. 72:             825     26400   org.openide.modules.Dependency
    116. 73:             1064    25536   java.awt.AWTEventMulticaster
    117. 74:             786     25152   java.util.Vector
    118. 75:             392     25088   java.nio.DirectByteBuffer
    119. 76:             390     24960   org.netbeans.core.startup.layers.BinaryFS$BFSFile
    120. 77:             66      24816   javax.swing.JScrollPane$ScrollBar
    121. 78:             516     24768   java.util.TreeMap
    122. 79:             503     24144   java.util.logging.LogManager$LoggerWeakRef
    123. 80:             945     23320   javax.swing.text.AttributeSet[]
    124. 81:             362     23168   java.net.URL
    125. 82:             553     22120   javax.swing.text.html.HTMLDocument$RunElement
    126. 83:             395     22120   java.awt.BorderLayout
    127. 84:             671     21472   org.openide.util.WeakListenerImpl$ProxyListener
    128. 85:             45      21240   com.sun.tools.visualvm.core.ui.components.DisplayAreaSupport$ImageIconButton
    129. 86:             875     21000   java.util.Collections$UnmodifiableCollection$1
    130. 87:             184     19136   sun.awt.image.IntegerInterleavedRaster
    131. 88:             475     19000   java.util.concurrent.ConcurrentHashMap$Segment
    132. 89:             1171    18736   java.util.HashMap$KeySet
    133. 90:             1168    18688   java.beans.PropertyChangeSupport$PropertyChangeListenerMap
    134. 91:             84      18336   float[]
    135. 92:             758     18192   java.lang.StringBuffer
    136. 93:             362     17376   java.util.WeakHashMap
    137. 94:             37      17168   com.sun.tools.visualvm.core.ui.components.DisplayAreaSupport$TabButton
    138. 95:             36      16992   com.sun.tools.visualvm.core.ui.components.DisplayArea$Presenter
    139. 96:             45      16920   com.sun.tools.visualvm.core.ui.components.DisplayArea
    140. 97:             679     16296   javax.swing.text.html.StyleSheet$ViewAttributeSet
    141. 98:             45      16200   com.sun.tools.visualvm.core.ui.components.DisplayArea$OptionsContainer
    142. 99:             45      15840   com.sun.tools.visualvm.core.ui.components.DisplayArea$TabsContainer
    143. 100:            658     15792   javax.swing.ActionMap
    144. 101:            45      15480   com.sun.tools.visualvm.core.ui.components.DisplayArea$MiddleSpacer
    145. 102:            45      15480   com.sun.tools.visualvm.core.ui.components.DisplayArea$ViewArea
    146. 103:            241     15424   java.util.logging.Logger
    147. 104:            41      15416   javax.swing.JViewport
    148. 105:            320     15360   javax.swing.text.html.HTMLDocument$BlockElement
    149. 106:            627     15048   javax.swing.text.GapContent$StickyPosition
    150. 107:            268     15008   java.text.Format[]
    151. 108:            464     14848   sun.font.TrueTypeFont$DirectoryEntry
    152. 109:            457     14624   java.lang.ref.ReferenceQueue
    153. 110:            594     14256   javax.swing.InputMap
    154.  
    Gruß Tom
  13. Thomas Darimont

    Thomas Darimont Administrator

    Hallo,

    Tool JStack: Listet eine kompakte Darstellung der Java StackTraces aller Threads auf.
    (gleiche Ausgabe wie %JAVA_HOME%\bin\jstack nur kompakter)
    Code (Text):
    1.  
    2. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.JStack
    3. Usage: jstack [option] <pid>
    4.                 (to connect to a live java process)
    5.    or jstack [option] <executable> <core>
    6.                 (to connect to a core file)
    7.    or jstack [option] [server_id@]<remote server IP or hostname>
    8.                 (to connect to a remote debug server)
    9.  
    10. where option must be one of:
    11.     -l  to print java.util.concurrent locks
    12.     -m  to print both java and native frames (mixed mode)
    13.     -h | -help  to print this help message
    14.  
    15. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.JStack 2996
    16. Attaching to process ID 2996, please wait...
    17. Debugger attached successfully.
    18. Server compiler detected.
    19. JVM version is 23.0-b21
    20. Deadlock Detection:
    21.  
    22. No deadlocks found.
    23.  
    24. Thread 36: (state = BLOCKED)
    25.  - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
    26.  - org.openide.util.RequestProcessor$Processor.run() @bci=23, line=1880 (Interpreted frame)
    27.  
    28.  
    29. Thread 35: (state = BLOCKED)
    30.  - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
    31.  - org.openide.util.RequestProcessor$Processor.run() @bci=23, line=1880 (Interpreted frame)
    32.  
    33.  
    34. Thread 34: (state = BLOCKED)
    35.  - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
    36.  - org.openide.util.RequestProcessor$Processor.run() @bci=23, line=1880 (Interpreted frame)
    37.  
    38.  
    39. Thread 32: (state = BLOCKED)
    40.  - sun.misc.Unsafe.park(boolean, long) @bci=0 (Interpreted frame)
    41.  - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=14, line=186 (Interpreted frame)
    42.  - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=42, line=2043 (Interpreted frame)
    43.  - java.util.concurrent.LinkedBlockingQueue.take() @bci=29, line=442 (Interpreted frame)
    44.  - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=156, line=1043 (Interpreted frame)
    45.  - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=17, line=1103 (Interpreted frame)
    46.  - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=5, line=603 (Interpreted frame)
    47.  - java.lang.Thread.run() @bci=11, line=722 (Interpreted frame)
    48.  
    49.  
    50. Thread 31: (state = BLOCKED)
    51.  - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
    52.  - java.util.TimerThread.mainLoop() @bci=201, line=552 (Interpreted frame)
    53.  - java.util.TimerThread.run() @bci=1, line=505 (Interpreted frame)
    54.  
    55.  
    56. Thread 30: (state = BLOCKED)
    57.  - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
    58.  - org.openide.util.RequestProcessor$Processor.run() @bci=23, line=1880 (Interpreted frame)
    59.  
    60.  
    61. Thread 1: (state = BLOCKED)
    62.  
    63.  
    64. Thread 29: (state = BLOCKED)
    65.  - sun.misc.Unsafe.park(boolean, long) @bci=0 (Interpreted frame)
    66.  - java.util.concurrent.locks.LockSupport.parkNanos(java.lang.Object, long) @bci=20, line=226 (Interpreted frame)
    67.  - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(long) @bci=68, line=2082 (Interpreted frame)
    68.  - java.util.concurrent.DelayQueue.take() @bci=132, line=220 (Interpreted frame)
    69.  - javax.swing.TimerQueue.run() @bci=20, line=171 (Interpreted frame)
    70.  - java.lang.Thread.run() @bci=11, line=722 (Interpreted frame)
    71.  
    72.  
    73. Thread 28: (state = BLOCKED)
    74.  - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
    75.  - java.lang.Object.wait() @bci=2, line=503 (Interpreted frame)
    76.  - java.util.prefs.AbstractPreferences$EventDispatchThread.run() @bci=22, line=1476 (Interpreted frame)
    77.  
    78.  
    79. Thread 27: (state = BLOCKED)
    80.  - sun.misc.Unsafe.park(boolean, long) @bci=0 (Interpreted frame)
    81.  - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=14, line=186 (Interpreted frame)
    82.  - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=42, line=2043 (Interpreted frame)
    83.  - java.awt.EventQueue.getNextEvent() @bci=48, line=511 (Interpreted frame)
    84.  - java.awt.EventDispatchThread.pumpOneEventForFilters(int) @bci=51, line=213 (Compiled frame)
    85.  - java.awt.EventDispatchThread.pumpEventsForFilter(int, java.awt.Conditional, java.awt.EventFilter) @bci=48, line=163 (Interpreted frame)
    86.  - java.awt.EventDispatchThread.pumpEventsForHierarchy(int, java.awt.Conditional, java.awt.Component) @bci=11, line=151 (Interpreted frame)
    87.  - java.awt.EventDispatchThread.pumpEvents(int, java.awt.Conditional) @bci=4, line=147 (Interpreted frame)
    88.  - java.awt.EventDispatchThread.pumpEvents(java.awt.Conditional) @bci=3, line=139 (Interpreted frame)
    89.  - java.awt.EventDispatchThread.run() @bci=9, line=97 (Interpreted frame)
    90.  
    91.  
    92. Thread 26: (state = IN_NATIVE)
    93.  - sun.awt.windows.WToolkit.eventLoop() @bci=0 (Interpreted frame)
    94.  - sun.awt.windows.WToolkit.run() @bci=49, line=299 (Interpreted frame)
    95.  - java.lang.Thread.run() @bci=11, line=722 (Interpreted frame)
    96.  
    97.  
    98. Thread 25: (state = BLOCKED)
    99.  - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
    100.  - java.lang.Object.wait() @bci=2, line=503 (Interpreted frame)
    101.  - sun.awt.AWTAutoShutdown.run() @bci=32, line=287 (Interpreted frame)
    102.  - java.lang.Thread.run() @bci=11, line=722 (Interpreted frame)
    103.  
    104.  
    105. Thread 24: (state = BLOCKED)
    106.  - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
    107.  - java.lang.ref.ReferenceQueue.remove(long) @bci=44, line=135 (Interpreted frame)
    108.  - java.lang.ref.ReferenceQueue.remove() @bci=2, line=151 (Interpreted frame)
    109.  - sun.java2d.Disposer.run() @bci=3, line=145 (Interpreted frame)
    110.  - java.lang.Thread.run() @bci=11, line=722 (Interpreted frame)
    111.  
    112.  
    113. Thread 23: (state = BLOCKED)
    114.  - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
    115.  - org.openide.util.RequestProcessor$Processor.run() @bci=23, line=1880 (Interpreted frame)
    116.  
    117.  
    118. Thread 22: (state = IN_NATIVE)
    119.  - java.net.DualStackPlainSocketImpl.accept0(int, java.net.InetSocketAddress[]) @bci=0 (Interpreted frame)
    120.  - java.net.DualStackPlainSocketImpl.socketAccept(java.net.SocketImpl) @bci=37, line=121 (Interpreted frame)
    121.  - java.net.AbstractPlainSocketImpl.accept(java.net.SocketImpl) @bci=7, line=398 (Interpreted frame)
    122.  - java.net.PlainSocketImpl.accept(java.net.SocketImpl) @bci=35, line=183 (Interpreted frame)
    123.  - java.net.ServerSocket.implAccept(java.net.Socket) @bci=60, line=522 (Interpreted frame)
    124.  - java.net.ServerSocket.accept() @bci=48, line=490 (Interpreted frame)
    125.  - org.netbeans.CLIHandler$Server.run() @bci=61, line=1042 (Interpreted frame)
    126.  
    127.  
    128. Thread 20: (state = BLOCKED)
    129.  - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
    130.  - java.lang.ref.ReferenceQueue.remove(long) @bci=44, line=135 (Interpreted frame)
    131.  - org.openide.util.lookup.implspi.ActiveQueue$Impl.run() @bci=2, line=64 (Interpreted frame)
    132.  - java.lang.Thread.run() @bci=11, line=722 (Interpreted frame)
    133.  
    134.  
    135. Thread 19: (state = BLOCKED)
    136.  - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
    137.  - java.util.TimerThread.mainLoop() @bci=201, line=552 (Compiled frame)
    138.  - java.util.TimerThread.run() @bci=1, line=505 (Interpreted frame)
    139.  
    140.  
    141. Thread 14: (state = BLOCKED)
    142.  
    143.  
    144. Thread 13: (state = BLOCKED)
    145.  
    146.  
    147. Thread 12: (state = BLOCKED)
    148.  - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
    149.  - java.lang.ref.ReferenceQueue.remove(long) @bci=44, line=135 (Interpreted frame)
    150.  - java.lang.ref.ReferenceQueue.remove() @bci=2, line=151 (Interpreted frame)
    151.  - java.lang.ref.Finalizer$FinalizerThread.run() @bci=3, line=177 (Interpreted frame)
    152. ...
    153.  
    Gruß Tom
  14. Thomas Darimont

    Thomas Darimont Administrator

    Hallo,

    Tool JSnap: Gibt einige JVM System Properties, JVM Performance Counters sowie die verwendeten JVM Flags aus.
    Code (Text):
    1.  
    2. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.JSnap 2996
    3. Attaching to process ID 2996, please wait...
    4. Debugger attached successfully.
    5. Server compiler detected.
    6. JVM version is 23.0-b21
    7. java.threads.started=32 event(s)
    8. java.threads.live=21
    9. java.threads.livePeak=25
    10. java.threads.daemon=17
    11. java.cls.loadedClasses=6066 event(s)
    12. java.cls.unloadedClasses=0 event(s)
    13. java.cls.sharedLoadedClasses=0 event(s)
    14. java.cls.sharedUnloadedClasses=0 event(s)
    15. java.ci.totalTime=13402222 tick(s)
    16. java.property.java.vm.specification.version=1.7
    17. java.property.java.vm.specification.name=Java Virtual Machine Specification
    18. java.property.java.vm.specification.vendor=Oracle Corporation
    19. java.property.java.vm.version=23.0-b21
    20. java.property.java.vm.name=Java HotSpot(TM) 64-Bit Server VM
    21. java.property.java.vm.vendor=Oracle Corporation
    22. java.property.java.vm.info=mixed mode
    23. java.property.java.library.path=C:\Program Files\Java\jdk1.7.0_04\jre\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Pro
    24. ...
    25.  
    Gruß Tom
  15. Thomas Darimont

    Thomas Darimont Administrator

    Hallo,

    Tool JMap: (gleiche Ausgabe wie %JAVA_HOME%\bin\jmap)
    Code (Text):
    1.  
    2.  
    3. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.JMap
    4. Usage: jmap [option] <pid>
    5.                 (to connect to a live java process)
    6.    or jmap [option] <executable> <core>
    7.                 (to connect to a core file)
    8.    or jmap [option] [server_id@]<remote server IP or hostname>
    9.                 (to connect to a remote debug server)
    10.  
    11. where option must be one of:
    12.     <no option> to print same info as Solaris pmap
    13.     -heap       to print java heap summary
    14.     -heap:format=b      to dump java heap in hprof binary format
    15.     -histo      to print histogram of java object heap
    16.     -permstat   to print permanent generation statistics
    17.     -finalizerinfo      to print information on objects awaiting finalization
    18.     -h | -help  to print this help message
    19.  
    20. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.JMap -heap 2996
    21. Attaching to process ID 2996, please wait...
    22. Debugger attached successfully.
    23. Server compiler detected.
    24. JVM version is 23.0-b21
    25.  
    26. using thread-local object allocation.
    27. Parallel GC with 8 thread(s)
    28.  
    29. Heap Configuration:
    30.    MinHeapFreeRatio = 40
    31.    MaxHeapFreeRatio = 70
    32.    MaxHeapSize      = 268435456 (256.0MB)
    33.    NewSize          = 1310720 (1.25MB)
    34.    MaxNewSize       = 17592186044415 MB
    35.    OldSize          = 5439488 (5.1875MB)
    36.    NewRatio         = 2
    37.    SurvivorRatio    = 8
    38.    PermSize         = 21757952 (20.75MB)
    39.    MaxPermSize      = 85983232 (82.0MB)
    40.    G1HeapRegionSize = 0 (0.0MB)
    41.  
    42. Heap Usage:
    43. PS Young Generation
    44. Eden Space:
    45.    capacity = 65273856 (62.25MB)
    46.    used     = 41695136 (39.763580322265625MB)
    47.    free     = 23578720 (22.486419677734375MB)
    48.    63.87723746548695% used
    49. From Space:
    50.    capacity = 5832704 (5.5625MB)
    51.    used     = 5777120 (5.509490966796875MB)
    52.    free     = 55584 (0.053009033203125MB)
    53.    99.04702861657303% used
    54. To Space:
    55.    capacity = 9568256 (9.125MB)
    56.    used     = 0 (0.0MB)
    57.    free     = 9568256 (9.125MB)
    58.    0.0% used
    59. PS Old Generation
    60.    capacity = 29229056 (27.875MB)
    61.    used     = 15248400 (14.542007446289062MB)
    62.    free     = 13980656 (13.332992553710938MB)
    63.    52.16863657861547% used
    64. PS Perm Generation
    65.    capacity = 72613888 (69.25MB)
    66.    used     = 39503336 (37.673316955566406MB)
    67.    free     = 33110552 (31.576683044433594MB)
    68.    54.40190174089012% used
    69.  
    70. 16638 interned Strings occupying 1687656 bytes.
    71.  
    72. C:\Users\tom>
    73.  
    Gruß Tom
  16. Thomas Darimont

    Thomas Darimont Administrator

    Hallo,

    Tool HeapSummary: gibt eine kompakte Darstellung einiger Heap-Kennzahlen aus.

    Code (Text):
    1.  
    2. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.HeapSummary 2996
    3. Attaching to process ID 2996, please wait...
    4. Debugger attached successfully.
    5. Server compiler detected.
    6. JVM version is 23.0-b21
    7.  
    8. using thread-local object allocation.
    9. Parallel GC with 8 thread(s)
    10.  
    11. Heap Configuration:
    12.    MinHeapFreeRatio = 40
    13.    MaxHeapFreeRatio = 70
    14.    MaxHeapSize      = 268435456 (256.0MB)
    15.    NewSize          = 1310720 (1.25MB)
    16.    MaxNewSize       = 17592186044415 MB
    17.    OldSize          = 5439488 (5.1875MB)
    18.    NewRatio         = 2
    19.    SurvivorRatio    = 8
    20.    PermSize         = 21757952 (20.75MB)
    21.    MaxPermSize      = 85983232 (82.0MB)
    22.    G1HeapRegionSize = 0 (0.0MB)
    23.  
    24. Heap Usage:
    25. PS Young Generation
    26. Eden Space:
    27.    capacity = 62455808 (59.5625MB)
    28.    used     = 52892936 (50.44263458251953MB)
    29.    free     = 9562872 (9.119865417480469MB)
    30.    84.68857852259313% used
    31. From Space:
    32.    capacity = 6881280 (6.5625MB)
    33.    used     = 6301408 (6.009490966796875MB)
    34.    free     = 579872 (0.553009033203125MB)
    35.    91.57319568452381% used
    36. To Space:
    37.    capacity = 9633792 (9.1875MB)
    38.    used     = 0 (0.0MB)
    39.    free     = 9633792 (9.1875MB)
    40.    0.0% used
    41. PS Old Generation
    42.    capacity = 29229056 (27.875MB)
    43.    used     = 15248400 (14.542007446289062MB)
    44.    free     = 13980656 (13.332992553710938MB)
    45.    52.16863657861547% used
    46. PS Perm Generation
    47.    capacity = 72613888 (69.25MB)
    48.    used     = 39511984 (37.68156433105469MB)
    49.    free     = 33101904 (31.568435668945312MB)
    50.    54.41381130838222% used
    51.  
    52. 16706 interned Strings occupying 1695152 bytes.
    53.  
    Gruß Tom
  17. Thomas Darimont

    Thomas Darimont Administrator

    Hallo,

    Tool HeapDumper: Erlaubt das erzeugen von Heap Dumps zur späteren analyse (Beispielsweise in JVisualVM)
    Code (Text):
    1.  
    2. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.HeapDumper 2996
    3. Attaching to process ID 2996, please wait...
    4. Debugger attached successfully.
    5. Server compiler detected.
    6. JVM version is 23.0-b21
    7. Dumping heap to heap.bin ...
    8. none
    9. null_check
    10. null_assert
    11. range_check
    12. class_check
    13. array_check
    14. intrinsic
    15. bimorphic
    16. unloaded
    17. uninitialized
    18. unreached
    19. unhandled
    20. constraint
    21. div0_check
    22. age
    23. predicate
    24. loop_limit_check
    25. Finding object size using Printezis bits and skipping over...
    26. Finding object size using Printezis bits and skipping over...
    27. Finding object size using Printezis bits and skipping over...
    28. Finding object size using Printezis bits and skipping over...
    29. Finding object size using Printezis bits and skipping over...
    30. Heap dump file created
    31.  

    Gruß Tom
  18. Thomas Darimont

    Thomas Darimont Administrator

    Hallo,

    Tool FlagDumper: gibt alle JVM-Flags mit ihren aktuellen Werten aus.
    Code (Text):
    1.  
    2. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.FlagDumper 1104
    3. Attaching to process ID 1104, please wait...
    4. Debugger attached successfully.
    5. Server compiler detected.
    6. JVM version is 23.0-b21
    7. AdaptivePermSizeWeight = 20
    8. AdaptiveSizeDecrementScaleFactor = 4
    9. AdaptiveSizeMajorGCDecayTimeScale = 10
    10. AdaptiveSizePausePolicy = 0
    11. AdaptiveSizePolicyCollectionCostMargin = 50
    12. AdaptiveSizePolicyInitializingSteps = 20
    13. AdaptiveSizePolicyOutputInterval = 0
    14. AdaptiveSizePolicyWeight = 10
    15. AdaptiveSizeThroughPutPolicy = 0
    16. AdaptiveTimeWeight = 25
    17. AdjustConcurrency = false
    18. AggressiveOpts = false
    19. AliasLevel = 3
    20. AllocateInstancePrefetchLines = 1
    21. AllocatePrefetchDistance = 192
    22. AllocatePrefetchInstr = 0
    23. AllocatePrefetchLines = 4
    24. AllocatePrefetchStepSize = 64
    25. AllocatePrefetchStyle = 1
    26. AllowInvokeGeneric = false
    27. AllowJNIEnvProxy = false
    28. AllowParallelDefineClass = false
    29. AllowUserSignalHandlers = false
    30. AlwaysActAsServerClassMachine = false
    31. AlwaysCompileLoopMethods = false
    32. AlwaysInflate = 0
    33. AlwaysLockClassLoader = false
    34. AlwaysPreTouch = false
    35. AlwaysRestoreFPU = false
    36. AlwaysTenure = false
    37. AnonymousClasses = false
    38. ArraycopyDstPrefetchDistance = 0
    39. ...
    40.  

    Gruß Tom
  19. Thomas Darimont

    Thomas Darimont Administrator

    Hallo,

    Tool FinalizerInfo: Gibt Informationen zu den aktuell in die finalizer Queue eingestellten Objekten aus:
    Code (Text):
    1.  
    2. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.FinalizerInfo 1104
    3. Attaching to process ID 1104, please wait...
    4. Debugger attached successfully.
    5. Server compiler detected.
    6. JVM version is 23.0-b21
    7. Number of objects pending for finalization: 0
    8.  
    Gruß Tom
  20. Thomas Darimont

    Thomas Darimont Administrator

    Hallo,

    Tool SOQL: SOQL (Simple Object Query Language) Client zum analysieren von Heap Strukturen, leider gibt es dazu (stand heute) noch nicht so viele Beispiele. Man kann sich aber grob an OQL orientieren:http://visualvm.java.net/oqlhelp.html)
    Unterstützte Kommandos: select, classes, class, object, quit

    Code (Text):
    1.  
    2.  
    3. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.soql.SOQL 1104
    4. Attaching to process ID 1104, please wait...
    5. Debugger attached successfully.
    6. Server compiler detected.
    7. JVM version is 23.0-b21
    8. soql> classes
    9. $Proxy1 @0x00000000ebaae9c8
    10. $Proxy2 @0x00000000ebbb8ff8
    11. $Proxy3 @0x00000000ebc284c0
    12. $Proxy4 @0x00000000ebc3fc68
    13. $Proxy5 @0x00000000ec305ad8
    14. $Proxy6 @0x00000000ec311fd8
    15. com.sun.beans.WeakCache @0x00000000eb56d818
    16. com.sun.beans.finder.BeanInfoFinder @0x00000000eb576958
    17. com.sun.beans.finder.InstanceFinder @0x00000000eb5766d8
    18. com.sun.beans.finder.PropertyEditorFinder @0x00000000ec1da2e0
    19. com.sun.imageio.plugins.bmp.BMPImageReaderSpi @0x00000000eb664530
    20. com.sun.imageio.plugins.bmp.BMPImageWriterSpi @0x00000000eb6653e0
    21. com.sun.imageio.plugins.common.InputStreamAdapter @0x00000000eb6ad690
    22. com.sun.imageio.plugins.common.ReaderUtil @0x00000000eb6ca060
    23. com.sun.imageio.plugins.common.SubImageInputStream @0x00000000eb6aca98
    24. com.sun.imageio.plugins.gif.GIFImageMetadata @0x00000000ebd78f98
    25. com.sun.imageio.plugins.gif.GIFImageReader @0x00000000ebd70a88
    26. com.sun.imageio.plugins.gif.GIFImageReaderSpi @0x00000000eb65c538
    27. com.sun.imageio.plugins.gif.GIFImageWriterSpi @0x00000000eb661940
    28. com.sun.imageio.plugins.gif.GIFMetadata @0x00000000ebd75cf0
    29. com.sun.imageio.plugins.gif.GIFStreamMetadata @0x00000000ebd76020
    30. com.sun.imageio.plugins.jpeg.JPEG @0x00000000eb66b828
    31. com.sun.imageio.plugins.jpeg.JPEGImageReaderSpi @0x00000000eb669bc0
    32. com.sun.imageio.plugins.jpeg.JPEGImageWriterSpi @0x00000000eb66c670
    33. com.sun.imageio.plugins.png.PNGImageDataEnumeration @0x00000000eb6aadf0
    34. com.sun.imageio.plugins.png.PNGImageReader @0x00000000eb68c530
    35. com.sun.imageio.plugins.png.PNGImageReaderSpi @0x00000000eb668040
    36. com.sun.imageio.plugins.png.PNGImageWriterSpi @0x00000000eb668ea8
    37. com.sun.imageio.plugins.png.PNGMetadata @0x00000000eb699980
    38. com.sun.imageio.plugins.wbmp.WBMPImageReaderSpi @0x00000000eb6663e0
    39. com.sun.imageio.plugins.wbmp.WBMPImageWriterSpi @0x00000000eb667280
    40. ...
    41.  
    Code (Text):
    1.  
    2. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.soql.SOQL 1104
    3. Attaching to process ID 1104, please wait...
    4. Debugger attached successfully.
    5. Server compiler detected.
    6. JVM version is 23.0-b21
    7. soql> class
    8. usage: class <name of the class>
    9. soql> class java.lang.String
    10. super
    11.         java.lang.Object
    12. fields
    13.         char[] value
    14.         int offset
    15.         int count
    16.         int hash
    17.         long serialVersionUID
    18.         java.io.ObjectStreamField[] serialPersistentFields
    19.         java.util.Comparator CASE_INSENSITIVE_ORDER
    20. ...
    21.  
    Es gibt wohl davon auch noch eine Variante mit JavaScript Interpreter:
    Code (Text):
    1.  
    2. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.soql.JSDB 1104
    3. Attaching to process ID 1104, please wait...
    4. Debugger attached successfully.
    5. Server compiler detected.
    6. JVM version is 23.0-b21
    7. jsdb> object
    8. sun.org.mozilla.javascript.internal.InterpretedFunction@4c5f3bf7
    9. jsdb> object(0x0000000)
    10. java.lang.Object@7049cca1
    11. jsdb> object(0x0000000).hashCode()
    12. 1883884705
    13. jsdb> object()
    14. call to object failed!
    15. javax.script.ScriptException: JavaException: javax.script.ScriptException: java.lang.reflect.InvocationTarget
    16. jsdb> object(0)
    17. java.lang.Object@7049cca1
    18. jsdb>
    19.  
    Gruß Tom

Diese Seite empfehlen