JRockit to HotSpot Migration Guide
JRockit to HotSpot Migration Guide
Release 9
E76287-05
October 2017
Java Platform, Standard Edition JRockit to HotSpot Migration Guide, Release 9
E76287-05
Copyright © 1995, 2017, Oracle and/or its affiliates. All rights reserved.
This software and related documentation are provided under a license agreement containing restrictions on
use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your
license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify,
license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means.
Reverse engineering, disassembly, or decompilation of this software, unless required by law for
interoperability, is prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If
you find any errors, please report them to us in writing.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on
behalf of the U.S. Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software,
any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are
"commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-
specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the
programs, including any operating system, integrated software, any programs installed on the hardware,
and/or documentation, shall be subject to license terms and license restrictions applicable to the programs.
No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management applications.
It is not developed or intended for use in any inherently dangerous applications, including applications that
may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you
shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its
safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this
software or hardware in dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of
their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are
used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron,
the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro
Devices. UNIX is a registered trademark of The Open Group.
This software or hardware and documentation may provide access to or information about content, products,
and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly
disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise
set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be
responsible for any loss, costs, or damages incurred due to your access to or use of third-party content,
products, or services, except as set forth in an applicable agreement between you and Oracle.
Contents
Preface
Audience v
Documentation Accessibility v
Related Documents v
Conventions v
1 Introduction
Heap Sizing 1-1
2 Garbage Collectors
Tuning Garbage Collection 2-1
3 Runtime
Runtime Options 3-1
4 Compilation Optimization
Compiler Considerations 4-1
Important HotSpot JIT Compiler Options 4-2
5 Logging
Verbose Logging 5-1
HotSpot Logging Options 5-2
6 Command-Line Options
Mapping of Oracle JRockit to HotSpot Command-Line Options 6-1
jcmd Commands 6-8
iii
7 Common Migration Issues and Solutions
8 Troubleshooting Tools
Troubleshooting Tools Available in Java SE 8-1
iv
Preface
This guide helps users of Oracle JRockit to migrate to Java HotSpot VM (Java
Platform, Standard Edition). The document describes the command-line options and
tools available in Oracle JRockit, and their equivalents in the Java HotSpot VM
(HotSpot).
Audience
The target audiences for this document are developers and users who are working on
Oracle JRockit and planning to migrate to the Java Development Kit (JDK). The JDK is
Oracle's implementation of the Java Platform, Standard Edition (Java SE). The current
release is Java SE 9 and JDK 9. However, most of the information in this document
can be applied to releases earlier than JDK 9.
This document is intended for readers who have a detailed understanding of the Java
HotSpot VM components, and also have some understanding of concepts such as
garbage collection, threads, and native libraries. In addition, it is assumed that the
reader is reasonably proficient with the operating systems where the Java application
is developed and run.
Documentation Accessibility
For information about Oracle's commitment to accessibility, visit the Oracle
Accessibility Program website at [Link]
ctx=acc&id=docacc.
Related Documents
See Oracle JDK 9 Documentation for other JDK 9 guides.
Conventions
The following text conventions are used in this document:
v
Preface
Convention Meaning
boldface Boldface type indicates graphical user interface elements associated
with an action, or terms defined in text or the glossary.
italic Italic type indicates book titles, emphasis, or placeholder variables for
which you supply particular values.
monospace Monospace type indicates commands within a paragraph, URLs, code
in examples, text that appears on the screen, or text that you enter.
vi
1
Introduction
This document provides simple guidelines to help migrate applications from Oracle
JRockit to Java HotSpot VM (HotSpot). It contains sections for each JVM system
component that describe the equivalents of those components in both Oracle JRockit
and HotSpot. The document also lists the corresponding JVM options of those
components. It includes tables that map the complete set of Oracle JRockit -X and -XX
command-line options to the ones available in HotSpot.
Note:
Some of the tools described in this document require a commercial license for
use in production. To learn more about commercial features and how to
enable them, see Oracle Java SE Advanced and Oracle Java SE Suite.
Heap Sizing
HotSpot has the same options as Oracle JRockit to set the initial and the maximum
Java heap size.
Note:
When migrating from Oracle JRockit to HotSpot, the Java heap size must
essentially be the same.
1-1
2
Garbage Collectors
This topic describes garbage collection tuning options available in Oracle JRockit and
HotSpot, and compares their functionality and performance.
To understand the various garbage collectors that are included with the HotSpot, see
Introduction to Garbage Collection Tuning in Java Platform, Standard Edition HotSpot
Virtual Machine Garbage Collection Tuning Guide.
2-1
3
Runtime
This topic describes important options that control the runtime behavior of the HotSpot.
Runtime Options
The following table lists important equivalent options of the runtime subsystem in
Oracle JRockit and HotSpot:
3-1
Chapter 3
Runtime Options
3-2
4
Compilation Optimization
This topic describes the various compiler options available in Oracle JRockit and
HotSpot to optimize compilation.
• Compiler Considerations
• Important HotSpot JIT Compiler Options
Compiler Considerations
Unlike Oracle JRockit, HotSpot features a Java byte code interpreter in addition to two
different Just In Time (JIT) compilers: client (also known as C1) and server (also
known as C2).
This section provides details about the complier that you can use.
HotSpot VM defaults to interpreting Java byte code. It compiles (JIT compilation)
methods that runtime profiling determines to be "hot", that is, the methods that are
executed for a predetermined number of times. JIT compliers are either client or server
compilers.
• Client compiler: It compiles methods quickly but emits machine code that is less
optimized than the server compiler. This complier is used for quick startup. Also, in
this compiler, the smaller memory footprint is more important than steady-state
performance.
• Server compiler: The compiler often takes more time (and memory) to compile the
same methods. However, it generates better optimized machine code than the
code generated by the client compiler. It provides better runtime performance after
the application reaches the steady state.
The tiered compilation enhances the server VM startup speed equivalent to the client
VM speed by using client compiler as the first tier. A server VM uses the interpreter to
collect the profiling information about the methods that is fed into the compiler. In the
tiered scheme, in addition to the interpreter, the client compiler generates compiled
versions of methods that collect profiling information about themselves. As the
compiled code is substantially faster than the interpreter, the program executes with
greater performance during this profiling phase. Often, a startup that is even faster
than with the client VM can be achieved, because the final code produced by the
server compiler is available during the early stages of application initialization. The
tiered scheme can also achieve better peak performance than a regular server VM.
This is because the faster profiling phase allows a longer period of profiling, which
yields better optimization.
Tiered compilation is the default mode for the server VM. The 64-bit mode is
supported. To enable tiered compilation manually, use the -XX:+TieredCompilation flag.
You can disable tiered compilation by using the -XX:-TieredCompilation flag.
Oracle JRockit JVM compiles a Java method and generates the machine code for the
first time it is invoked. This compiled code of frequently invoked methods is optimized
in the background by an Optimizer thread. This code is different from the HotSpot
4-1
Chapter 4
Important HotSpot JIT Compiler Options
where methods are interpreted first and compiled later, either by the client (fewer
optimizations) or the server (more optimizations) compiler.
4-2
Chapter 4
Important HotSpot JIT Compiler Options
4-3
Chapter 4
Important HotSpot JIT Compiler Options
4-4
5
Logging
This topic describes the various logging options available in Oracle JRockit and
HotSpot:
• Verbose Logging
• HotSpot Logging Options
Verbose Logging
Verbose logging in HotSpot can be enabled using the -verbose option. There are some
specific flags that can be used with this option to get area-specific verbose output.
The following table lists various logging options available in Oracle JRockit and
compares them with the options available in HotSpot:
5-1
Chapter 5
HotSpot Logging Options
5-2
Chapter 5
HotSpot Logging Options
5-3
6
Command-Line Options
This topic describes the various HotSpot command-line options and compares them
with those available in Oracle JRockit:
• Mapping of Oracle JRockit to HotSpot Command-Line Options
• jcmd Commands
6-1
Chapter 6
Mapping of Oracle JRockit to HotSpot Command-Line Options
6-2
Chapter 6
Mapping of Oracle JRockit to HotSpot Command-Line Options
6-3
Chapter 6
Mapping of Oracle JRockit to HotSpot Command-Line Options
6-4
Chapter 6
Mapping of Oracle JRockit to HotSpot Command-Line Options
6-5
Chapter 6
Mapping of Oracle JRockit to HotSpot Command-Line Options
6-6
Chapter 6
Mapping of Oracle JRockit to HotSpot Command-Line Options
6-7
Chapter 6
jcmd Commands
jcmd Commands
The following are the list of jcmd commands:
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• VM.native_memory
• VM.check_commercial_features
6-8
Chapter 6
jcmd Commands
• VM.unlock_commercial_features
• [Link]
• [Link]
• ManagementAgent.start_local
• [Link]
• Compiler.directives_clear
• Compiler.directives_remove
• Compiler.directives_add
• Compiler.directives_print
• VM.print_touched_methods
• [Link]
• [Link]
• [Link]
• VM.classloader_stats
• [Link]
• JVMTI.data_dump
• JVMTI.agent_load
• [Link]
• [Link]
• VM.class_hierarchy
• GC.class_stats
• GC.class_histogram
• GC.heap_dump
• GC.finalizer_info
• GC.heap_info
• GC.run_finalization
• [Link]
• [Link]
• [Link]
• [Link]
• VM.set_flag
• [Link]
• VM.system_properties
• VM.command_line
• [Link] help
For the complete list of commands, refer to jcmd Commands in the Java Platform,
Standard Edition Tools Reference guide.
6-9
7
Common Migration Issues and Solutions
This topic describes some common issues that can occur while migrating from Oracle
JRockit to HotSpot, along with their solutions.
The following table lists some common issues that can occur during the migration
process and solutions for resolving them:
7-1
8
Troubleshooting Tools
This topic describes various troubleshooting tools available in Java SE and compares
their functionality to those available in Oracle JRockit.
8-1
Chapter 8
Troubleshooting Tools Available in Java SE
8-2