HSDB, javahsdb

Source: Internet
Author: User

HSDB, javahsdb

HSDB is a debugger used to debug the HotSpot VM. It is a graphical interface. There is also a CLHSDB-Command Line HotSpot Debugger, the Command Line Debugging interface. The following is the startup command:

Java-cp .; % JAVA_HOME %/lib/sa-jdi.jar sun. jvm. hotspot. HSDB # Start the graphical interface java-cp .; % JAVA_HOME %/lib/sa-jdi.jar sun. jvm. hotspot. CLHSDB # Start the command line interface

1. HSDB graphical interface

After HSDB is started, use File-> Attach to HotSpot process to connect to the target process:

After the connection is successful, the Java Threads interface is opened by default. Double-click a thread to view its OOP information, or use the toolbar tool, as shown below:

  • Inspector: displays information about OOP and Klass objects. You can also view this information by double-clicking the thread name.
  • Stack Memory: thread Stack Memory
  • Show Java Stack Traces: displays the thread Stack information.
  • Show Thread Infomation: display Thread Information
  • Find Crashes

(1) Inspector

(2) Stack Memory

The stack memory interface has three columns of information, from left to right: memory address, indicating that the virtual address is not a physical address. The address data is in the unit of word width, in the case of a 64-bit machine, the word width is 64-bit = 8 bytes. For related notes, the vertical line indicates the range and the horizontal line indicates the description.

The Tools toolbar is also available and has the following features:

  • Class Browser: Class Browser
  • Code Viewer: view Code
  • Compute Reverse Ptrs: Reverse pointer Calculation
  • Deadlock Detection: Deadlock Detection
  • Find Object by Query: Query objects using the Object Query Language
  • Find Pointer: Find Pointer
  • Find Value in Heap: query in Heap
  • Find Value in Code Cache: query in Code Cache
  • Heap Parameters: Heap Information
  • Inspector: object checker
  • Memory Viewer: Memory information
  • Monitor Cache Dump: Monitor Cache Information
  • Object Histogram: Object Histogram
  • Show System Properties: displays System Properties.
  • Show VM Version: displays the VM Version.
  • Show-XX flags: displays VM options

Use Heap Parameters to view Heap information and check the address space of each generation:

2. CLHSDB

You can use Windows> Console in HSDB for the command line interface, or use Java commands to directly connect to CLHSDB.

CLHSDB provides a variety of commands to view help information. The following describes common commands:

  • Attach pid | exec core: connects to a Java Process or core file.
  • Class name: View class information
  • Classes: View loaded classes
  • Detach: disconnect
  • Inspect expression: View OOP Information
  • Jstack [-v]: thread Stack
  • Mem address [length]: view memory
  • Print expression: Output expression value
  • Revptrs: reverse pointer
  • Scanoops start end [type]: Scan instances of the type and its subclass in the specified space
  • Thread {-a | id}: view the specified thread Information
  • Threads: View All thread Information
  • Universe: View heap space information
  • Whatis address: view the data stored at the specified address
  • Quit: Exit

Through HSDB and CLHSDB, you can view JVM internal information and understand the working principle of JVM in essence.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.