'jinfo' - VM Option Value Checker

This section provides a tutorial example on how to use the 'jinfo' tool to view the current value of a given HotSpot VM option.

The first JVM troubleshooting tool I want to try is the "jinfo" tool.

The "jinfo" tool included in the Windows version of JDK 1.8 supports functions to view and modify HotSpot VM options of the specified JVM process. Here is the "jinfo" command syntax:

C:\herong>\Progra~1\java\jdk1.8.0\bin\jinfo

Usage:
    jinfo [option] <pid>
        (to connect to running process)
    jinfo [option] <executable <core>
        (to connect to a core file)
    jinfo [option] [server_id@]<remote server IP or hostname>
        (to connect to remote debug server)

where <option> is one of:
    -flag <name>         to print the value of the named VM flag
    -flag [+|-]<name>    to enable or disable the named VM flag
    -flag <name>=<value> to set the named VM flag to the given value
    -flags               to print VM flags
    -sysprops            to print Java system properties
    <no option>          to print both of the above
    -h | -help           to print this help message

HotSpot VM supports many options as described on the "Java HotSpot VM Options" page. You can change the default value of any HotSpot VM option using the "-XX:..." command option when running the "java" command.

Here is a tutorial example of how to use the "jinfo" tool get the current value of a given VM option:

C:\herong>\Progra~1\java\jdk1.8.0\bin\java 
   -jar "\Program Files\java\jdk1.8.0\demo\jfc\Notepad\notepad.jar"
   (Notepad started.)

   
(Start another command window.)
C:\herong>\Progra~1\java\jdk1.8.0\bin\jps -l -m

424 \Program Files\java\jdk1.8.0\demo\jfc\Notepad\notepad.jar
3984 sun.tools.jps.Jps -l -m


C:\herong>\Progra~1\java\jdk1.8.0\bin\jinfo 
   -flag ThreadStackSize 424

-XX:ThreadStackSize=0

Note that:

Last update: 2015.

Table of Contents

 About This Book

 Java Tools Terminology

 Installing Java 8 on Windows

 'javac' - The Java Program Compiler

 'java' - The Java Program Launcher

 'jdb' - The Java Debugger

 'jconsole' - Java Monitoring and Management Console

 'jstat' - JVM Statistics Monitoring Tool

JVM Troubleshooting Tools

 JVM Troubleshooting Tools in JDK 1.5

'jinfo' - VM Option Value Checker

 Changing HotSpot VM Option using 'jinfo'

 'jstack' - Stack Tracer to Generate Thread Dump

 What Is a Thread Dump?

 Java Thread Deadlock Demo Program

 Detecting Java Thread Deadlocks with 'jstack'

 'jmap' - JVM Heap Dump Tool

 Printing Histogram of Java Object Heap

 Generating Heap Dump File with 'jmap'

 'jhat' - Java Heap Analysis Tool

 Starting 'jhat' Web Server on a Heap Dump File

 Listing Instance Counts of All Classes

 Browsing Object Instance Values

 Object Query Language (OQL)

 Searching for Instances with OQL Statements

 jvisualvm (Java VisualVM) - JVM Visual Tool

 'jar' - The JAR File Tool

 'javap' - The Java Class File Disassembler

 'keytool' - Public Key Certificate Tool

 'native2ascii' - Native-to-ASCII Encoding Converter

 Outdated Tutorials

 References

 PDF Printing Version