Java Tools Tutorials - Herong's Tutorial Examples - v6.22, by Dr. Herong Yang
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 supports functions to view and modify HotSpot VM options of the specified JVM process. Here is the "jinfo" command syntax:
herong> 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" Website at oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html. 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:
herong> java -XX:MaxHeapSize=123456789 PrimeNumberSeeker 10 200 Period, Current int, # primes 1, 2, 0 2, 10, 4 ... (Start another command window.) herong> jps -l -m 14084 PrimeNumberSeeker 10 200 10620 jdk.jcmd/sun.tools.jps.Jps -l -m herong> jinfo -flag MaxHeapSize 14084 -XX:MaxHeapSize=123731968
Note that:
Table of Contents
javac - The Java Program Compiler
java - The Java Program Launcher
jpackage - Binary Package Builder
javadoc - The Java Document Generator
jdeps - The Java Class Dependency Analyzer
jdeprscan - The Java Deprecated API Scanner
jcmd - The JVM Diagnostic Tool
jconsole - Java Monitoring and Management Console
jstat - JVM Statistics Monitoring Tool
JVM Troubleshooting Tools in JDK
►jinfo - VM Option Value Checker
jinfo - Changing HotSpot VM Option
jstack - Stack Tracer to Generate Thread Dump
Java Thread Deadlock Demo Program
jstack - Detecting Java Thread Deadlocks
Printing Histogram of Java Object Heap
jmap - Generating Heap Dump File
jhat - Java Heap Analysis Tool
jhat - Starting Web Server on a Heap Dump File
Listing Instance Counts of All Classes
Browsing Object Instance Values
Searching for Instances with OQL Statements
jhsdb - The Java HotSpot Debugger
jvisualvm (Java VisualVM) - JVM Visual Tool
javap - The Java Class File Disassembler
keytool - Public Key Certificate Tool
jrunscript - Script Code Shell
native2ascii - Native-to-ASCII Encoding Converter