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 Premium-User

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

    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 Premium-User

    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 Premium-User

    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 Premium-User

    Hallo,

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

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

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

    Thomas Darimont Premium-User

    Hallo,

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

    Thomas Darimont Premium-User

    Hallo,

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

    Thomas Darimont Premium-User

    Hallo,

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

    Thomas Darimont Premium-User

    Hallo,

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

    Thomas Darimont Premium-User

    Hallo,

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

    Thomas Darimont Premium-User

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

    Thomas Darimont Premium-User

    Hallo,

    Tool JSnap: Gibt einige JVM System Properties, JVM Performance Counters sowie die verwendeten JVM Flags aus.
    Code (Text):
    1. C:\Users\tom>"%JAVA_HOME%\bin\java" -cp "%JAVA_HOME%\lib\sa-jdi.jar" sun.jvm.hotspot.tools.JSnap 2996
    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.threads.started=32 event(s)
    7. java.threads.live=21
    8. java.threads.livePeak=25
    9. java.threads.daemon=17
    10. java.cls.loadedClasses=6066 event(s)
    11. java.cls.unloadedClasses=0 event(s)
    12. java.cls.sharedLoadedClasses=0 event(s)
    13. java.cls.sharedUnloadedClasses=0 event(s)
    14. java.ci.totalTime=13402222 tick(s)
    15. java.property.java.vm.specification.version=1.7
    16. java.property.java.vm.specification.name=Java Virtual Machine Specification
    17. java.property.java.vm.specification.vendor=Oracle Corporation
    18. java.property.java.vm.version=23.0-b21
    19. java.property.java.vm.name=Java HotSpot(TM) 64-Bit Server VM
    20. java.property.java.vm.vendor=Oracle Corporation
    21. java.property.java.vm.info=mixed mode
    22. 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
    23. ...
    Gruß Tom
     
  15. Thomas Darimont

    Thomas Darimont Premium-User

    Hallo,

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

    Thomas Darimont Premium-User

    Hallo,

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

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

    Thomas Darimont Premium-User

    Hallo,

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

    Gruß Tom
     
  18. Thomas Darimont

    Thomas Darimont Premium-User

    Hallo,

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

    Gruß Tom
     
  19. Thomas Darimont

    Thomas Darimont Premium-User

    Hallo,

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

    Thomas Darimont Premium-User

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

Diese Seite empfehlen