diff --git a/search/search_index.json b/search/search_index.json index a3dd0a8f1..741a65ba5 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"About the docs","text":""},{"location":"#eclipse-openj9","title":"Eclipse OpenJ9","text":"

Welcome to the user documentation for the Eclipse OpenJ9\u2122 virtual machine (VM).

This user documentation supports the configuration, tuning, and diagnosis of the OpenJ9 VM in an OpenJDK runtime. However, due to differences between the Java SE class libraries, specific options might apply only to one Java SE version. Icons are used to indicate where differences apply. For example:

This sentence applies only to Java 11 binaries that include the OpenJ9 VM. Icons for LTS releases are this colour.

This sentence applies only to Java 16 or later binaries that include the OpenJ9 VM. Icons for feature releases are this colour.

To see which Java releases are LTS releases and which are feature releases, and for information about release cadence, supported platforms, and build environments, see Supported environments.

Note: Documentation to support OpenJ9 is still under construction. The current content covers some high level information about OpenJ9 components together with the command-line options and environment variables that you can use to configure the VM when you start your application. Because OpenJ9 was contributed to the Eclipse Foundation by IBM, this content contains some links to additional information that forms part of the IBM\u00ae SDK, Java\u2122 Technology Edition product documentation in IBM Documentation. That content supplements the documentation here until a more complete set of user documentation is available.

We welcome contributions to the user documentation. If you would like to get involved, please read our Contribution guidelines. If you spot any errors in the documentation, please raise an issue at our GitHub repository.

"},{"location":"#supported-environments","title":"Supported environments","text":"

OpenJDK binaries that contain the OpenJ9 VM are supported on a range of hardware and operating systems. This range is expanding as work progresses at the Eclipse foundation. See the current list of supported environments for details.

Note: This user guide also contains information about configuring, tuning, and debugging OpenJ9 on the z/OS\u00ae platform.

"},{"location":"#documentation-for-specific-releases","title":"Documentation for specific releases","text":"

Several versions of the documentation are available, covering all releases of OpenJ9:

"},{"location":"#useful-links","title":"Useful links","text":""},{"location":"allocation/","title":"Heap allocation","text":""},{"location":"allocation/#heap-allocation","title":"Heap allocation","text":"

The process of managing memory in the VM is handled by the allocator and the garbage collector. These components operate on an area of memory that is reserved for VM processing called the Java\u2122 heap.

The allocator assigns areas of the heap for Java objects. Objects are considered as live when they have a chain of references to them that start from root references, such as those found in thread stacks. When that reference or pointer no longer exists, the objects are considered as garbage.

The garbage collector reclaims memory by removing objects when they are no longer required. To find out more about the garbage collector, see Garbage collection.

Depending on your application workload or service level agreement, you can choose from a number of Eclipse OpenJ9\u2122 garbage collection (GC) policies. Each GC policy uses a different strategy to manage memory on the heap. The structure of the heap also depends on the strategy in force. For more information about choosing a GC policy, see Garbage collection policies.

"},{"location":"allocation/#the-allocator","title":"The allocator","text":"

The allocator manages pools of free memory and how the free memory is consumed. It is also responsible for allocating areas of storage in the Java heap for objects at the request of applications, class libraries, or the VM.

In general, allocation requires a heap lock to synchronize concurrent threads that try to access the same area of memory at the same time. When an object is allocated, the heap lock is released. If there is insufficient space to allocate the object, allocation fails, the heap lock is released, and the garbage collector is called. If GC manages to recover some space on the heap, the allocator can resume operations. If GC does not recover enough space, it returns an OutOfMemoryError exception.

Acquiring a heap lock for every allocation would be an intensive operation with an impact to performance. To get around this problem, small objects are allocated to allocation caches.

"},{"location":"allocation/#allocation-caches","title":"Allocation caches","text":"

To improve performance, allocation caches are reserved in the heap for different threads. These allocation caches are known as thread local heaps (TLH) and allow each thread to allocate memory from its cache without acquiring the heap lock. Objects are allocated from the TLH unless there is insufficient space remaining in the TLH to satisfy the request. In this situation, the allocation might proceed directly from the heap for larger objects by using a heap lock or the TLH might be refreshed for smaller objects.

If a thread allocates a lot of objects, the allocator gives that thread a larger TLH to reduce contention on the heap lock.

A TLH is predefined with an initial default size of 2 KB. On every TLH refresh, the requested size for that thread is increased by an increment (default 4 KB). The requested size can grow up to a predefined maximum (default 128 KB). If a TLH refresh fails to complete, a GC cycle is triggered.

After every GC cycle, the requested size of the TLH for each thread is reduced, sometimes by as much as 50%, to take account of threads that reduce their allocation rate and no longer need large TLHs.

For very inactive threads, the requested size can even drop below the initial value, down to the predefined minimum (512/768 bytes). For very active threads, the maximum TLH requested size might be reached before the next GC occurs.

Larger TLHs can help reduce heap lock contention, but might also reduce heap utilization and increase heap fragmentation.

The following options control the requested TLH size:

Typically, when the maximum TLH size is increased, you should also increase the increment proportionally, so that active threads can reach the maximum requested TLH size more quickly.

"},{"location":"allocation/#heap-configuration","title":"Heap configuration","text":"

Depending on the memory management strategy in force, the Java heap can be configured in a number of ways. The simplest configuration consists of a single area of memory, often referred to as a flat heap. Other configurations divide the heap into different areas or regions, which might contain objects of different ages (generations) or sizes.

"},{"location":"allocation/#area-based-heaps","title":"Area-based heaps","text":"

The default GC policy for OpenJ9 uses a heap configuration that is divided into two main areas: the nursery area for new object allocation, and the tenure area for objects that continue to be reachable for a longer period of time. Most objects have short lifecycles and can be reclaimed by the garbage collector more quickly by focusing only on the nursery area. Global GC cycles that cause application pauses in order to clear and defragment the tenure area are less frequent.

"},{"location":"allocation/#soa-and-loa","title":"SOA and LOA","text":"

All area-based heaps subdivide part of the heap into the Small Object Area (SOA) and the Large Object Area (LOA).

The allocator initially attempts to allocate objects in the SOA, regardless of size. If the allocation cannot be satisfied the following actions are possible, depending on object size:

The GC action that is triggered by the allocation failure depends on the GC policy in force.

The overall size of the LOA is calculated when the heap is initialized, and recalculated at the end of each global GC cycle. The garbage collector can expand or contract the LOA, depending on usage, to avoid allocation failures.

You can control the size of the LOA by using the -Xloainitial, -Xloaminimum, and -Xloamaximum command line options. If the LOA is not used, the garbage collector contracts the LOA after a few cycles, down to the value of -Xloaminimum. You can also specify -Xnoloa to prevent an LOA being created.

An SOA and LOA are used by the OpenJ9 GC policies: gencon, optavgpause, and optthruput. For the gencon policy, the LOA and SOA are contained within the tenure area, which is designated for ageing objects. For more information about policies, see Garbage collection policies.

"},{"location":"allocation/#region-based-heaps","title":"Region-based heaps","text":"

The Java heap can also be subdivided into multiple regions. The balanced GC policy uses a heap that is divided into thousands of equal size regions in order to manage multiple generations of objects. The metronome GC policy also uses multiple regions, which are grouped by size-class to manage a singe generation of objects. To learn more about how the regions are configured for each policy, see Garbage collection policies.

In addition to regions, the balanced and metronome policies use structures called arraylets to store large arrays in the heap.

"},{"location":"allocation/#arraylets","title":"Arraylets","text":"

A Java heap that is subdivided into regions might not be able to contain a large enough region for data arrays. This problem is solved by using arraylets. An arraylet has a spine, which contains the class pointer and size, and leaves, which contain the data associated with the array. The spine also contains arrayoids, which are pointers to the respective arraylet leaves, as shown in the following diagram.

There are a number of advantages to using arraylets.

Note: Despite the general advantage of using arraylets, they can slow down processing when the Java Native Interface (JNI) is being used. The JNI provides flexibility by enabling Java programs to call native code; for example, C or C++, and if direct addressability to the inside of an object is needed, a JNI critical section can be used. However, that requires the object to be in a contiguous region of memory, or at least appear to be so. The JNI, therefore, creates a temporary contiguous array that is the same size as the original array and copies everything, element by element, to the temporary array. After the JNI critical section is finished, everything is copied from the temporary array back to the arraylet, element by element.

"},{"location":"allocation/#heap-sizing","title":"Heap sizing","text":"

The overall size of the Java heap is determined by two command-line options, -Xms, which sets the initial size of the heap, and -Xmx, which sets the maximum size of the heap. Finer tuning of the heap depends on the heap configuration that is being used by a GC policy. For example, an LOA within the heap can be sized by using the -Xloainitial, -Xloaminimum, and -Xloamaximum command-line options. A nursery area within the heap can be sized by using the -Xmn, -Xmns, and -Xmnx command-line options. For more information about policies and the heap configurations that are used, see GC policies. To determine the values that are in use for the Java heap, use the -verbose:sizes option when you run your Java application.

When the Java heap runs out of space, OutOfMemoryError exceptions are generated. If you are confident that your heap settings are appropriate for your application but are still receiving an OutOfMemoryError exception, check the Java dump file that gets automatically generated when the error occurs. A Java dump file can tell you more about what your application was attempting to do at the time of the error. For example, see the Java OutOfMemoryError scenario.

"},{"location":"allocation/#expansion-and-contraction","title":"Expansion and contraction","text":"

At startup, the VM allocates a single contiguous area of virtual storage to match the value of -Xmx. By default, this is 25% of the available memory up to a maximum of 25 GB. The actual Java heap size starts at the value set by -Xms and expands automatically, as required, up to the maximum heap size. The VM can also contract the size of the Java heap. Expansion and contraction occur as part of a GC cycle when the VM has exclusive access to the heap. The only GC policy that does not support heap expansion and contraction is the metronome GC policy, where the heap is always fully expanded.

Note: On operating systems that support paging, the VM allocates a single contiguous area that matches the value of -Xms. Additional memory is committed as the heap expands by using the paging process.

Expansion occurs to maintain free space on the Java heap for object allocation. By default, the heap is expanded to maintain 30% free space, but this proportion can be adjusted by setting one of the following command-line options:

If expansion is required, the amount of memory that the heap can expand by is controlled by the following command-line options:

Expansion can also be triggered if more time is being spent on GC processing than is specified by the -Xmaxt option. In this case, the heap expands by an amount that provides 17% more free space, within the limits imposed by the -Xmine and -Xmaxe values.

Heap contraction occurs under certain conditions and might be preceded by heap compaction. If the last three GC cycles caused a heap expansion, contraction does not occur. Otherwise, contraction is triggered when the proportion of free heap space that is specified by the -Xmaxf option is reached. The amount of memory to reduce the heap by is calculated to the nearest 1024-byte boundary, down to the minimum size specified for the initial Java heap (-Xms). To prevent heap contraction, set the -Xmaxf value to 1, which sets the maximum free space allowed on the heap to 100%.

When the heap contracts, physical memory is not released unless paging is supported by the underlying operating system.

"},{"location":"allocation/#balanced-gc-policy","title":"balanced GC policy","text":"

For the balanced GC policy, if the -Xminf/-Xmaxf and/or -Xmint/-Xmaxt criteria are not being met and this results in a heap resize, then the heap resize that occurs, happens only on non-eden heap (similar to how these options apply to tenure part for gencon).

The non-eden heap resizing occurs at the end of a GMP cycle, or global collection. At this point, heap resizing decision is made by observing both -Xmint/-Xmaxt and -Xminf/-Xmaxf and comparing them to the appropriate proportion of time spent in GC, and free heap respectively.

If either -Xmint/-Xmaxt and/or -Xminf/-Xmaxf criteria are not being met, there is no guarantee that a heap resize will occur. The heap sizing logic is looking at the following two things:

Since these two criteria may be providing opposite recommendations (for example, lots of free memory, but high % of time in GC) causing oscillations in heap size, the balanced GC heap sizing logic finds a balance between these two criteria.

"},{"location":"allocation/#compressed-references","title":"Compressed references","text":"

On 64-bit systems, the VM can use compressed references to decrease the size of Java objects and make better use of the available space in the Java heap. By storing objects in a 32-bit representation, the object size is identical to that in a 32-bit VM, which creates a smaller memory footprint. These 4 byte (32-bit) compressed references are converted to 64-bit values at runtime with minimal overhead. Smaller objects enable larger heap sizes that result in less frequent garbage collection and improve memory cache utilization. Overall, the performance of 64-bit applications that store compressed rather than uncompressed 64-bit object references is significantly improved.

Compressed references are used by default when the maximum Java heap size is in the range 0 - 57 GB on AIX\u00ae, Linux\u00ae, and Windows\u00ae systems. The upper limit is also 57 GB on z/OS\u00ae systems that have APAR OA49416 installed (25 GB without APAR OA49416). All GC policies observe these limits except for the metronome policy, which can support a heap size of up to 25 GB only with compressed references.

When the VM uses compressed references, classes, threads, and monitors are stored in the lowest 4 GB of address space. However, this area of memory is also used by native libraries, the operating system, and for small Java heaps. If you receive native memory OutOfMemoryError exceptions in the lowest 4 GB when running with compressed references enabled, these errors might result from the lowest 4 GB of address space becoming full. Try specifying a large heap with the -Xmx option, which puts the Java heap into a higher area of address space or using the -Xmcrs option to reserve space in the lowest 4 GB of address space for compressed references.

To turn off compressed references, use the -Xnocompressedrefs command-line option.

"},{"location":"aot/","title":"AOT Compiler","text":""},{"location":"aot/#ahead-of-time-aot-compiler","title":"Ahead-Of-Time (AOT) compiler","text":"

The AOT compiler dynamically compiles Java methods into native AOT code at runtime and stores them in the shared classes cache. This activity enables the VM to start an application faster the next time it runs because it doesn't need to spend time interpreting Java methods. The VM automatically chooses which methods should be AOT-compiled based on heuristics that identify the start-up phase of large applications. AOT code is always used in combination with class data sharing and is enabled automatically when -Xshareclasses is set on the command line. When a cached AOT method is run it might also be optimized further by the Just-In-Time (JIT) compiler.

If you want to turn off AOT compilation and disable the use of AOT-compiled code, set the -Xnoaot suboption. When the AOT compiler is disabled, the JIT compiles frequently used methods into native code. However, because the JIT compiler operates while the application is running, the startup time for an application will increase.

"},{"location":"aot/#see-also","title":"See also","text":""},{"location":"api-conditionhandling/","title":"Condition exception handling","text":""},{"location":"api-conditionhandling/#condition-handling-api-documentation","title":"Condition Handling API documentation","text":""},{"location":"api-cuda/","title":"CUDA4J","text":""},{"location":"api-cuda/#cuda4j-api-documentation","title":"CUDA4J API documentation","text":""},{"location":"api-daa/","title":"Data access acceleration","text":""},{"location":"api-daa/#data-access-acceleration-api-documentation","title":"Data access acceleration API documentation","text":""},{"location":"api-dtfj/","title":"DTFJ","text":""},{"location":"api-dtfj/#dtfj-api-documentation","title":"DTFJ API documentation","text":""},{"location":"api-gpu/","title":"GPU","text":""},{"location":"api-gpu/#gpu-api-documentation","title":"GPU API documentation","text":""},{"location":"api-jdk11/","title":"Java 11 API","text":""},{"location":"api-jdk11/#openj9-jdk-11-api-documentation","title":"OpenJ9 JDK 11 API documentation","text":""},{"location":"api-jdk17/","title":"Java 17 API","text":""},{"location":"api-jdk17/#openj9-jdk-17-api-documentation","title":"OpenJ9 JDK 17 API documentation","text":""},{"location":"api-jdk21/","title":"Java 21 API","text":""},{"location":"api-jdk21/#openj9-jdk-21-api-documentation","title":"OpenJ9 JDK 21 API documentation","text":""},{"location":"api-jdk22/","title":"Java 22 API","text":""},{"location":"api-jdk22/#openj9-jdk-22-api-documentation","title":"OpenJ9 JDK 22 API documentation","text":""},{"location":"api-jvm/","title":"JVM diagnostic utilities","text":""},{"location":"api-jvm/#jvm-diagnostic-utilities-api-documentation","title":"JVM diagnostic utilities API documentation","text":""},{"location":"api-langmgmt/","title":"Monitoring and management","text":""},{"location":"api-langmgmt/#monitoring-and-management-api-documentation","title":"Monitoring and management API documentation","text":""},{"location":"api-overview/","title":"Overview","text":""},{"location":"api-overview/#api-documentation","title":"API documentation","text":"

The Eclipse OpenJ9\u2122 VM provides supplementary application programming interfaces and extensions, which can be used to improve performance, assist with problem determination, or help monitor and manage the OpenJ9 VM. The documentation also includes links to the API documentation for the Java\u2122 SE and JDK reference implementation.

"},{"location":"api-overview/#native-data-operations","title":"Native data operations","text":"

If your Java application manipulates native data, the Data Access Accelerator API package (com.ibm.dataaccess) can help improve application performance. Classes are available for the following types of operation:

"},{"location":"api-overview/#gpu-acceleration","title":"GPU acceleration","text":"

You can improve the performance of your applications by offloading certain processing functions from your processor (CPU) to a graphics processing unit (GPU). If your application contains code that would benefit from parallel processing, you can use the CUDA4J API package (com.ibm.cuda) to specify in your code when to offload processing to the GPU. You can also use the GPU API package (com.ibm.gpu) to accelerate certain Java functions, such as sort operations.

"},{"location":"api-overview/#problem-determination","title":"Problem determination","text":"

The JVM diagnostic utilities API package (com.ibm.jvm) provides classes for controlling dump, log, and trace operations.

The Diagnostic Tool Framework for Java (DTFJ) API packages (com.ibm.dtfj.*) allow custom applications to be written that can access a wide range of information in a system dump or a Java dump.

"},{"location":"api-overview/#monitoring-and-management","title":"Monitoring and management","text":"

The shared classes API package (com.ibm.oti.shared) provides a large number of classes for managing permissions, finding and storing classes and byte data, and obtaining statistics about a shared classes cache. Classes are also available to enable class sharing for a custom class loader implementation.

OpenJ9 includes MXBean extensions to the java.lang.management API (com.ibm.lang.management and openj9.lang.management), which can be used to monitor and manage the VM. These extensions provide access to information about the state of the OpenJ9 VM and the environment in which it is running.

"},{"location":"api-shrc/","title":"Shared classes","text":""},{"location":"api-shrc/#shared-classes-api-documentation","title":"Shared classes API documentation","text":""},{"location":"attachapi/","title":"Java Attach API","text":""},{"location":"attachapi/#java-attach-api","title":"Java Attach API","text":"

With the Attach API, your application can connect to a running VM and load an agent into that VM to run tasks. The typical use case for this feature is to load an agent that can be used to monitor the application that's running in the target VM.

For example, if you wanted to start monitoring an application that is already running with the Attach API enabled, you can use a tool such as the IBM Health Center. In this case, a Health Center agent can start in its own VM and attach to the target VM where the application is running to start recording and sending data to the Health Center client.

The Eclipse OpenJ9\u2122 implementation of the Attach API is equivalent to the reference implementation (API documentation is available on the Oracle website). However, you can use the Attach API only to connect to another OpenJ9 VM.

When you run a Java\u2122 application, VM support for the Attach API is enabled by default on all platforms except z/OS\u00ae. For security reasons on z/OS, processes that use the default z/OS OMVS segment cannot enable the Attach API.

To enable or disable the Attach API, use the -Dcom.ibm.tools.attach.enable=[yes|no] command line option.

"},{"location":"attachapi/#securing-the-attach-api","title":"Securing the Attach API","text":"

Because the Attach API can be used to connect to a running application, you must control access to it to ensure that only authorized users or processes can use it. Disable the Attach API if you do not intend to use it.

If you do not want to disable the Attach API but want to control the unauthorized dynamic loading of agents into the VM by using the Attach API, use the -XX:-EnableDynamicAgentLoading option.

On Windows\u2122 systems, the Attach API uses the system temporary directory, which is typically C:\\Users\\<USERNAME>\\AppData\\Local\\Temp. The Attach API creates a common subdirectory, which is .com_ibm_tools_attach by default. Because files and directories in the system temporary directory are handled by Windows security, only the process owner can connect to their processes.

On UNIX systems, the Attach API uses /tmp and creates a common subdirectory, which is .com_ibm_tools_attach by default. The common subdirectory must be on a local drive, not a network drive. Security is handled by POSIX file permissions. The Attach API directory must be owned by root user and must have read, write, and execute file permissions for user, group, and other (drwxrwxrwx). The sticky bit is set so that only the owner and root can delete or rename files or directories within it. A process that uses the Java Attach API must be owned by the same UNIX user ID as the target process.

~/tmp $ ls -al\ntotal 0\ndrwxr-xr-x   3 user_a staff    96  6 Aug 17:11 .\ndrwxr-xr-x+ 89 user_a staff  2848  6 Aug 17:11 ..\ndrwxrwxrwx+  7 root   staff   224  6 Aug 17:22 .com_ibm_tools_attach\n

In the default Attach API directory, you can find certain files that start with an underscore _*, which are involved in synchronization. By default, any user that has read and write permissions can own these files. The files are empty and are automatically re-created if deleted. A user might interfere with the functioning of the Attach API by modifying the file permissions. To prevent such an interference, you can protect the file permissions by setting root as the owner of the files.

When your application attaches to a VM, a process directory is created.

~/tmp/.com_ibm_tools_attach $ ls -l\ntotal 3\n-rw-rw-rw-  1 user_a  staff    0  6 Aug 17:12 _attach_lock\n-rw-rw-rw-  1 user_a  staff    0  6 Aug 17:12 _controller\n-rw-rw-rw-  1 user_a  staff    0  6 Aug 17:12 _notifier\ndrwx--x--x  6 user_b  staff  192  6 Aug 17:21 process_a\n

The files in the subdirectory for a process, with the exception of a lock file, are accessible only by the owner of a process. The permissions for these files are rwxr-xr-x with the exception of the attachNotificationSync file, as shown in the following example.

~/tmp/.com_ibm_tools_attach/process_a $ ls -l\ntotal 4\n-rwxrw-rw-  1 user_b  staff  0  6 Aug 17:18 attachNotificationSync\n-rwxr-xr-x  1 user_b  staff  0  6 Aug 17:21 file_a\n-rwxr-xr-x  1 user_b  staff  0  6 Aug 17:21 file_b\n-rwxr-xr-x  1 user_b  staff  0  6 Aug 17:21 file_c\n

Notes for z/OS:

"},{"location":"attachapi/#configuring","title":"Configuring","text":"

A number of system properties are available to configure the Attach API when you start a Java application, as shown in the following table:

System property Description -Dcom.ibm.tools.attach.directory=<directory_name> Specify a different common directory for Attach API working files. -Dcom.ibm.tools.attach.displayName=<my_display_name> Change the display name recorded by an agent -Dcom.ibm.tools.attach.id=<my_vm_ID> Change the VM identifier recorded by an agent -Dcom.ibm.tools.attach.timeout=<value_in_milliseconds> Change the connection timeout -Dcom.ibm.tools.attach.shutdown_timeout=<value_in_milliseconds> Specify the timeout for ending the Attach API wait loop thread -Dcom.ibm.tools.attach.command_timeout=<value_in_milliseconds> Specify the timeout for sending a command to the target VM after initial attachment -Dcom.ibm.tools.attach.retry=<number_of_retries> Specify the number of times the jcmd tool retries attaching to a running VM when the tool encounters the SocketException error on Windows platform

To learn more about each property, click the link in the table.

"},{"location":"attachapi/#troubleshooting","title":"Troubleshooting","text":"

Problems with the Attach API generate one of the following exceptions:

Exceptions from agents on the target VM go to stderr or stdout for the target VM. These exceptions are not reported in the output of the attaching VM.

Here are some problems that you might encounter:

If you have checked for these potential issues but you are still experiencing problems, a number of command line system properties are available to help narrow down the cause. These options are shown in the following table:

System property Description -Dcom.ibm.tools.attach.logging=<yes|no> Turn on tracing of attach API events -Dcom.ibm.tools.attach.log.name=<my_log_name> Specify the path and prefix for the log files

To learn more about each property, click the link in the table.

"},{"location":"builds/","title":"OpenJ9 builds","text":""},{"location":"builds/#eclipse-openj9-builds","title":"Eclipse OpenJ9 builds","text":"

Eclipse Foundation projects are not permitted to distribute, market or promote JDK binaries unless they have passed a Java SE Technology Compatibility Kit licensed from Oracle, to which the Eclipse OpenJ9\u2122 project does not currently have access. See the Eclipse Adoptium Project Charter.

"},{"location":"builds/#supported-platforms","title":"Supported platforms","text":"

The community develops and maintains a test infrastructure for the OpenJ9 source across a broad range of platforms. For information about the platforms and minimum operating system levels supported, see the Platform support matrix.

"},{"location":"builds/#building-your-own-binaries","title":"Building your own binaries","text":"

If you want to build your own binaries of OpenJDK with OpenJ9, a complete set of build instructions for several platforms can be found in the OpenJ9 GitHub repository.

"},{"location":"builds/#installation-pre-requisites","title":"Installation pre-requisites","text":"

Note the following:

"},{"location":"cmdline_general/","title":"Standard options","text":""},{"location":"cmdline_general/#standard-command-line-options","title":"Standard command-line options","text":"

The Eclipse OpenJ9\u2122 virtual machine supports the standard Java\u2122 options that are common to all Java virtual machine implementations, including Oracle's HotSpot VM. Some of the common options supported are summarised in the following table:

Standard option name Purpose -classpath:<resource_name>[:<resource_name>] Sets the search path for application classes and resources (directories and compressed or .jar files). cp can be used instead of classpath. -help, -? Prints a usage message. -fullversion Prints the build and version information for a VM -showversion Prints product version and continues. -verbose:<option>[,<option>] Enables verbose output. Options include class, dynload, gc, init, jni, sizes, stack, and module. (See Notes) -version Prints the full build and version information a VM

Notes:

For more information about standard options, see Oracle Java SE Standard Options

"},{"location":"cmdline_general/#openj9-extensions","title":"OpenJ9 extensions","text":"

OpenJ9 supports the following extension to the -verbose option:

"},{"location":"cmdline_migration/","title":"Switching to OpenJ9","text":""},{"location":"cmdline_migration/#switching-to-eclipse-openj9","title":"Switching to Eclipse OpenJ9","text":"

If you are already familiar with HotSpot command-line options but want the advantages of Eclipse OpenJ9\u2122, the following information will prove helpful. In all cases, check individual topics for minor discrepancies in the way these options might work.

Note: For information about HotSpot equivalences and differences for items other than command-line options, see New to Eclipse OpenJ9?

"},{"location":"cmdline_migration/#compatible-options","title":"Compatible options","text":"

You can use the following command-line options in OpenJ9, just as you did in HotSpot; you can continue to use the HotSpot option in OpenJ9 without having to change your code:

Option Usage -X Displays help on nonstandard options. -Xbootclasspath Specifies the search path for bootstrap classes and resources. -Xcheck:jni Runs additional checks for JNI functions during VM startup. -Xfuture Turns on strict class-file format checks. -Xint Runs an application in interpreted-only mode. -Xlog Some forms of -Xlog that enable garbage collection logging are recognized. (Equivalent to -Xverbosegclog). -Xmn Sets the initial and maximum size of the new area when using -Xgcpolicy:gencon. -Xms Sets the initial size of the heap. (Equivalent to -XX:InitialHeapSize) -Xmx Specifies the maximum size of the object memory allocation pool. (Equivalent to -XX:MaxHeapSize) -Xnoclassgc Disables class garbage collection (GC). -Xrs Prevents the OpenJ9 run time environment from handling signals. -Xss Sets the Java\u2122 thread stack size. (Equivalent to -XX:ThreadStackSize). Note: Unlike HotSpot, this option applies only to the Java stack. OpenJ9 has a separate native stack for operating system threads (see -Xmso) -Xverify:mode Enables or disables the verifier. -XX:ConcGCThreads Configures the number of GC mutator background threads. -XX:[+|-]AlwaysPreTouch Enables or disables committing of memory during initial heap inflation or heap expansion. -XX:[+|-]CompactStrings Enables or disables String compression. Note: This option is enabled by default in OpenJ9 on Java 11 and later. In the earlier versions, this option is disabled by default. -XX:DiagnoseSyncOnValueBasedClasses=<number> Configure warnings for value-based classes. -XX:[+|-]DisableExplicitGC Enables or disables explicit System.gc() calls. (Alias for -Xdisableexplicitgc / -Xenableexplicitgc) -XX:[+|-]ExitOnOutOfMemoryError Triggers VM shutdown on out-of-memory conditions. -XX:[+|-]HeapDumpOnOutOfMemory Enables or disables dumps on out-of-memory conditions. -XX:HeapDumpPath Specifies a directory for all VM dumps including heap dumps, javacores, and system dumps. (Alias for -Xdump:directory) -XX:[+|-]IgnoreUnrecognizedVMOptions Specifies whether to ignore unrecognized top-level VM options. -XX:InitialHeapSize Sets the initial size of the heap. (Alias for -Xms) -XX:InitialRAMPercentage Sets the initial size of the Java heap as a percentage of total memory. -XX:MaxDirectMemorySize Sets a limit on the amount of memory that can be reserved for all direct byte buffers. -XX:MaxHeapSize Specifies the maximum size of the object memory allocation pool. (Alias for -Xmx) -XX:MaxRAMPercentage Sets the maximum size of the Java heap as a percentage of total memory. -XX:OnOutOfMemoryError Runs specified commands when a java.lang.OutOfMemoryError is thrown. (Equivalent to -Xdump:tool:events=systhrow,filter=java/lang/OutOfMemoryError,exec=) -XX:ParallelCMSThreads Configures the number of GC mutator background threads. -XX:ParallelGCThreads Configures the number of GC threads. -XX:[+|-]PrintCodeCache Prints code cache usage when the application exits. -XX:[+|-]ShowHiddenFrames Specifies whether generated hidden MethodHandle frames are displayed in a stack trace. Note: Unlike HotSpot, this option doesn't require the +UnlockDiagnosticVMOptions option. -XX:[+|-]UseCompressedOops Disables compressed references in 64-bit JVMs. (See also -Xcompressedrefs) -XX:[+|-]UseContainerSupport Sets a larger fraction of memory to the Java heap when the VM detects that it is running in a container."},{"location":"cmdline_migration/#equivalent-options","title":"Equivalent options","text":"

These HotSpot command-line options have equivalents in OpenJ9 that are not specified in the same way, but perform a related function:

HotSpot Option OpenJ9 Option Usage -Xcomp -Xjit:count=01 -Xcomp disables interpreted method invocations. -Xgc -Xgcpolicy2 Configuring your garbage collection policy. -XX:+UseNUMA -Xnuma:none3 Controls non-uniform memory architecture (NUMA) awareness.

Notes:

  1. HotSpot uses -Xcomp to force compilation of methods on first invocation. However, this option is deprecated. Whilst it can be used for compatibility, using -Xjit:count=0 is preferred.

  2. HotSpot uses -Xgc to both select policies and configure them; OpenJ9 uses -Xgcpolicy to select policies, reserving -Xgc for configuration.

  3. In HotSpot, NUMA awareness is turned off by default and is turned on by using the -XX:+UseNUMA option. Conversely, the OpenJ9 VM automatically enables NUMA awareness and uses -Xnuma:none to turn it off.

"},{"location":"cmdline_migration/#creating-compatible-behavior","title":"Creating compatible behavior","text":"

You can set the following options to make OpenJ9 behave in the same way as HotSpot.

Option Usage -Djava.lang.string.substring.nocopy=true Avoid String sharing by String.substring(). -Xnuma:none Disable non-uniform memory architecture (NUMA) awareness. -XX:[+|-]HandleSIGABRT Force handling of SIGABRT signals to be compatible with HotSpot."},{"location":"cmdline_migration/#compatible-environment-variables","title":"Compatible environment variables","text":"

The JAVA_TOOL_OPTIONS environment variable can be used to set command line options as described in OpenJ9 command-line options and Environment variables.

"},{"location":"cmdline_specifying/","title":"Specifying options","text":""},{"location":"cmdline_specifying/#eclipse-openj9-command-line-options","title":"Eclipse OpenJ9 command-line options","text":"

When you start a Java\u2122 application you can specify various options on the command line to configure the runtime environment. These options include:

Although the command line is the traditional way to specify command-line options, you can also pass options to the Eclipse OpenJ9\u2122 virtual machine (VM) by using a manifest file, options files, and environment variables.

Options specified on the command line override the equivalent environment variables. For example, specifying java -cp <dir1> completely overrides setting the environment variable CLASSPATH=<dir2>.

"},{"location":"cmdline_specifying/#quotation-marks","title":"Quotation marks","text":"

Use single or double quotation marks for command-line options only when explicitly directed to do so. Single and double quotation marks have different meanings on different platforms, operating systems, and shells. Do not use '-X<option>' or \"-X<option>\". Instead, you must use -X<option>. For example, do not use '-Xmx500m' and \"-Xmx500m\". Write this option as -Xmx500m.

"},{"location":"cmdline_specifying/#precedence","title":"Precedence","text":"

The sequence of the Java options on the command line defines which options take precedence during startup. Rightmost options have precedence over leftmost options. In the following example, the -Xjit option takes precedence:

java -Xint -Xjit myClass\n

At startup, the list of VM arguments is constructed in the following order, with the lowest precedence first:

  1. Certain options are created automatically by the VM, which specify arguments such as search paths and version information. The VM automatically adds -Xoptionsfile=<path>/options.default at the beginning of the command line, where <path> is the path to the VM directory.

    You can modify the options.default file to include any options that you want to specify for your application instead of entering these options on the command line. For more information about the path and construction of the file, see -Xoptionsfile.

  2. Options can be specified in an executable JAR file by using the META-INF/MANIFEST.MF file. Options are placed in the main section in a header named IBM-Java-Options. Only one IBM-Java-Options header is permitted, but the header can contain multiple options, separated by spaces. A long sequence of options can be split using a header continuation but are treated as a single line.

    Example manifest file:

    Manifest-Version: 1.0\nClass-Path: .\nMain-Class: HelloWorld\nIBM-Java-Options: -Xshareclasses:name=mycache,nonfa\n tal,cacheDirPerm=1000 -Dproperty=example -Da.long.system.pro\n perty=\"this is a long system property value to\n  demonstrate long VM arguments\n in the manifest file\"\n

    This example manifest file is parsed as the following string:

    -Xshareclasses:name=mycache,nonfatal,cacheDirPerm=1000\n-Dproperty=example\n-Da.long.system.property=this is a long system property value to\ndemonstrate long VM arguments in the manifest file\n

    Options specified in the manifest file are subject to the same restrictions as options files. For more information, see the -Xoptionsfile topic in the user guide.

  3. Environment variables that are described in OpenJ9 environment variables are translated into command-line options. For example, the following environment variable adds the parameter -Xrs to the list of arguments:

  4. The OPENJ9_JAVA_OPTIONS environment variable. You can set command-line options using this environment variable. The options that you specify with this environment variable are added to the command line when a VM starts in that environment. The environment variable can contain multiple blank-delimited argument strings, but must not contain comments. For example:

    Note: The environment variable JAVA_TOOL_OPTIONS is equivalent to OPENJ9_JAVA_OPTIONS and is available for compatibility with JVMTI. The equivalent IBM_JAVA_OPTIONS environment variable is deprecated and will be removed in a future release.

  5. Options that are specified on the command line. For example:

    java -Dmysysprop1=tcpip -Dmysysprop2=wait -Xdisablejavadump MyJavaClass\n

    The Java launcher adds some automatically generated arguments to this list, such as the names of the main class.

  6. The _JAVA_OPTIONS environment variable. You can override previous options using this environment variable. The options that you specify with this environment variable are added to the end of the command line when a VM starts in that environment. The environment variable can contain multiple blank-delimited argument strings, but must not contain comments. For example:

You can also use the -Xoptionsfile parameter to specify VM options. This parameter can be used on the command line, or as part of the OPENJ9_JAVA_OPTIONS environment variable. The contents of an option file are expanded in place during startup. For more information about the structure and contents of this type of file, see -Xoptionsfile.

To troubleshoot startup problems, you can check which options are used by the OpenJ9 VM. Append the following command-line option, and inspect the Java core file that is generated:

-Xdump:java:events=vmstart\n

Here is an extract from a Java core file that shows the options that are used:

    2CIUSERARG               -Xdump:java:file=/home/test_javacore.txt,events=vmstop\n    2CIUSERARG               -Dtest.cmdlineOption=1\n    2CIUSERARG               -XXallowvmshutdown:true\n    2CIUSERARG               -Xoptionsfile=test1.test_options_file\n
"},{"location":"configuring/","title":"Configuring your system","text":""},{"location":"configuring/#configuring-your-system","title":"Configuring your system","text":"

Configuring your local system can help you optimize the runtime environment for your Java application. Options include setting operating system environment variables and configuring system resources so that Eclipse OpenJ9\u2122 can exploit the underlying operating system and hardware capabilities.

When you install a Java\u2122 runtime environment on your system you can set the PATH environment variable so that the operating system can find the Java programs and utilities to run your application. To tell your application where to find user classes, you can use the -cp option or set the CLASSPATH environment variable. However, if you set CLASSPATH globally, all invocations of Java are affected. How to set these environment variables is covered in many publications about Java, such as The Java Tutorials: PATH and CLASSPATH.

On some systems, a further environment variable might be required if your application requires shared libraries but does not specify their exact location. You can set the following environment variables to specify the directory location of the shared libraries, although setting a global value affects all invocations of Java:

Although most Java applications should run without changing anything on the underlying system, a unique pre-requisite exists for AIX systems on OpenJDK version 11 and later; you must have the 16.1 XL C++ Runtime installed.

"},{"location":"configuring/#setting-resource-limits-aix-linux-and-macos","title":"Setting resource limits (AIX, Linux, and macOS)","text":"

The operating system sets resource limits for a shell, and to processes started by the shell, to ensure that a single process cannot consume all available resources. However, these limits can affect certain operations that might need to run for a Java application, such as producing a dump file.

"},{"location":"configuring/#setting-ulimit-values","title":"Setting ulimit values","text":"

Some resource limits are controlled by the ulimit command. A soft limit is the value set by the kernel for a resource and a hard limit imposes a maximum value on the soft limit. A privileged process can change either limit, but an unprivileged process can change only its soft limit (between 0 and the hard limit) or irreversibly lower its hard limit. To see the current limits set for a system, run ulimit -a. The output is similar to the following example:

core file size          (blocks, -c) 0\ndata seg size           (kbytes, -d) unlimited\nfile size               (blocks, -f) unlimited\nmax locked memory       (kbytes, -l) unlimited\nmax memory size         (kbytes, -m) unlimited\nopen files                      (-n) 256\npipe size            (512 bytes, -p) 1\nstack size              (kbytes, -s) 8192\ncpu time               (seconds, -t) unlimited\nmax user processes              (-u) 2784\nvirtual memory          (kbytes, -v) unlimited\n

To show hard limits, use ulimit -Ha.

You can change limits for specific resources on a temporary basis by running the ulimit command. Alternatively, you can store limit settings in a configuration file, which is /etc/security/limits for AIX or etc/security/limits.conf for Linux. For more information about configuring resource limits, refer to the documentation for your operating system.

The main use case for changing ulimit resources is when enabling a system dump to ensure that all the required data can be collected for analysis. For more information, see Enabling a full system dump.

"},{"location":"configuring/#setting-shared-memory-values","title":"Setting shared memory values","text":"

Another use case for changing resource limits is to ensure that there is sufficient shared memory allocated for class data sharing. By default, the shared classes cache consists of memory-mapped files that are created on disk and persist when the system is restarted. If you choose to use non-persistent caches by setting the -Xshareclasses:nonpersistent option, caches are not retained on startup and are allocated by using the System V IPC shared memory mechanism.

Note: The virtual address space of a process is shared between the shared classes cache and the Java heap. Increasing the maximum size for the shared classes cache might reduce the size of the Java heap that you can create.

Shared memory limits are also important when configuring large page memory allocation on Linux systems. For more information, see Configuring large page memory allocation: Linux systems.

"},{"location":"configuring/#setting-resource-limits-zos","title":"Setting resource limits (z/OS)","text":"

Resource limits imposed by z/OS might affect Java operations. To learn how these resource limits are set, see Customizing the BPXPRMxx member of SYS1.PARMLIB.

The OpenJ9 class data sharing feature is implemented by using shared memory segments on z/OS. Special consideration should be given to the following parameters that relate to the shared memory and IPC semaphore settings:

Incorrect or suboptimal settings might prevent shared classes from working or impact performance. By default, the VM attempts to create a 16 MB cache on Java 8 and a 300 MB cache on Java 11 and later. If you set a cache size for your application by specifying the -Xscmx option on the command line, the VM rounds the value up to the nearest megabyte. Ensure that the value set for IPCSHMMPAGES takes this adjustment into consideration.

To see the current settings, enter the following z/OS operator command:

D OMVS,O\n

The suggested minimum values for Java applications are shown in the following table:

Parameter Value MAXPROCSYS 900 MAXPROCUSER 512 MAXUIDS 500 MAXTHREADS 10000 MAXTHREADTASKS 5000 MAXASSIZE 2147483647 MAXCPUTIME 2147483647 MAXMMAPAREA 40960 IPCSHMSPAGES 262144 IPCSHMMPAGES 25600 IPCSHMNSEGS 10 IPCSEMNIDS 500 IPCSEMNSEMS 1000 SHRLIBRGNSIZE 67 108 864

Note: The number of threads that can be created by a Java process is limited by the lower of the two values for MAXTHREADS and MAXTHREADSTASKS.

You can change these settings dynamically without re-IPLing the system. For example, to set MACPROCUSER to 256, run SETOMVS MAXPROCUSER=256

z/OS uses region sizes to determine the amount of storage available to running programs. For a Java runtime environment, the region size must be sufficiently large to avoid storage related error messages or abends. Rather than restricting region size, allow the VM to use what it needs. Region size can be affected by one of the following parameters: JCL REGION, BPXPRMxx MAXASSIZE, the RACF OMVS segment ASSIZEMAX, or IEFUSI (Step initiation exit).

SHRLIBRGNSIZE controls how much storage is reserved in each address space for mapping shared DLLs that have the +l extended attribute set. If this storage space is exceeded, DLLs are loaded into the address space instead of using a single copy of z/OS UNIX System Services storage that is shared between the address spaces. The z/OS command D OMVS,L shows the SHRLIBRGNSIZE size and peak usage. If this size is set to a much higher value than is needed, the Java application might have problems acquiring native storage. These problems can cause a z/OS abend, such as 878-10, or a Java OutOfMemoryError.

"},{"location":"configuring/#configuring-language-environment-runtime-options","title":"Configuring Language Environment runtime options","text":"

Language Environment\u00ae runtime options affect performance and storage usage. These options can be optimized for your application.

Runtime options are typically embedded in programs by using #pragma runopts settings. In many cases, these options provide suitable default values that are known to produce good performance results. However, these options can be overridden to tune the runtime environment of your application.

On 64-bit z/OS systems, the following runtime options affect Java applications:

A suitable MEMLIMIT value is also required. The OpenJ9 VM requirement is the sum of the following amounts:

Note: If you intend to use the Concurrent Scavenge mode of the default Generational Concurrent (gencon) garbage collection policy by using hardware-based support, the virtual storage used might exceed the Java maximum heap size. Set the z/OS memory limit to a larger value than the maximum heap size. For more information, see -Xgc:concurrentScavenge.

The following guides are available to help you configure Language Environment runtime options and callable services:

Warning: Changing the runtime options can often degrade performance.

"},{"location":"configuring/#configuring-large-page-memory-allocation","title":"Configuring large page memory allocation","text":"

If your application allocates a large amount of memory and frequently accesses that memory, you might be able to improve performance by enabling large page support on your system.

Some Linux kernels implement Transparent HugePage Support (THP), which automates the provision of large pages to back virtual memory, as described in Linux systems. Alternatively, you can configure the VM to use large pages (if the large pages support is enabled on the system) by setting the -Xlp:objectheap and -Xlp:codecache options on the command line when you start your application. These options have the following effects:

The process for enabling the large page support differs in different operating systems, as explained in the following sections.

"},{"location":"configuring/#aix-systems","title":"AIX systems","text":"

AIX supports large page sizes of 64 KB and 16 MB, and a huge page size of 16 GB depending on the underlying system P hardware. To determine which page sizes are supported on a particular system, run pagesize -a.

To use large pages to back an application's data and heap segments, specify the LDR_CNTRL environment variable. You can set different page sizes for different purposes. The following variables can be used:

The following example sets 4 KB for text and 64 KB for stack, native data, and heap areas:

LDR_CNTRL=TEXTPSIZE=4K@STACKPSIZE=64K@DATAPSIZE=64K\n

For more information, including support considerations, see Large pages and Multiple page size support in the AIX documentation.

The 16 MB and 16 GB page sizes, which are intended for very high performance environments, require special user permissions. You must also configure the number of pages that you require, which cannot be adjusted on demand. For 16 MB large pages, you set the number of large pages by using the vmo command. For 16 GB huge pages you must define the number of pages by using the hardware management console. For more information, see Page sizes for very high-performance environments in the AIX documentation.

"},{"location":"configuring/#linux-systems","title":"Linux systems","text":"

Large pages are typically referred to as huge pages on Linux systems. To configure huge page memory allocation, the kernel must support huge pages. If huge pages are supported, the following lines are present in the /proc/meminfo file:

HugePages_Total:    \nHugePages_Free:     \nHugepagesize:     \n

If these lines do not exist, update your Linux kernel. If HugePages_Total has a value of 0, huge pages are available, but not enabled. To enable huge pages, add the following line to your /etc/sysctl.conf file and reload the configuration by running sysctl -p:

vm.nr_hugepages=<number>\n

Where <number> is the number of huge pages required.

Configure the number of huge pages that you require at boot time to ensure that the VM has access to sufficient contiguous pages. The following kernel parameters must be set appropriately for your system:

The user running the Java process must either be ROOT or have permissions to use huge pages. For the appropriate permissions, the user must be a member of a group that has its group identifier (gid) stored in /proc/sys/vm/hugetlb_shm_group. The locked memory limit must also be increased to at least the size of the Java heap by using the ulimit -l command.

Where huge page support is available, the following default sizes apply for the object heap:

Transparent HugePage Support (THP) is an automated mechanism of using huge pages to back virtual memory. On Linux kernels that support THP, it is typically enabled by default with the madvise option and can be relied on to provide huge pages as required without any user configuration. To disable THP for your application, use the OpenJ9 -XX:-TransparentHugePage option on the command line. To disable THP system-wide, change the sysfs boot time defaults with the command transparent_hugepage=never. For more information about THP see Transparent HugePage Support.

"},{"location":"configuring/#windows-systems","title":"Windows systems","text":"

On Windows systems, large pages are typically 2 MB in size. To use large pages, the VM user must have the Windows Lock pages in memory setting enabled in the Local Security Policy. Applications must also be run with Admin privileges in order to use large page memory allocations.

For more information, see the following resources from Microsoft:

"},{"location":"configuring/#zos-systems","title":"z/OS systems","text":"

When available, 1 MB pageable pages are the default size for the object heap and the code cache. Other page sizes are available for the object heap, depending on the system architecture as shown in the following table:

Large page size System architecture required -Xlp:codecache -Xlp:objectheap 2 GB nonpageable IBM zEnterprise EC12 processor or later Not supported Supported (64-bit VM only) 1 MB nonpageable System z10 processor or later Not supported Supported (64-bit VM only) 1 MB pageable IBM zEnterprise EC12 processor or later (see Note) Supported Supported

Note: The Flash Express feature (#0402) helps avoid demoting 1 MB pageable pages to 4 KB pages when there is system paging activity.

If a particular page size cannot be allocated, a smaller page size is attempted, in descending order. For example, if 2 GB nonpageable pages are requested but not available, the VM tries to allocate 1MB nonpageable pages. If 1 MB nonpageable pages are not available, the VM tries to allocate 1MB pageable pages. If large pages are not available, 4 KB pages are allocated.

If you want to use nonpageable large pages for the object heap, a system programmer must configure z/OS for nonpageable large pages in the IEASYSxx parmlib member. Users who require large pages must also be authorized to the IARRSM.LRGPAGES resource in the RACF FACILITY class with read authority.

Use the following z/OS system command to show large page usage for an LPAR:

MODIFY AXR,IAXDMEM\n

For more information, see Displaying real storage memory statistics in the z/OS product documentation.

For usage information, including examples, see -Xlp:objectheap.

"},{"location":"configuring/#configuring-dynamic-lpar-support-aix-only","title":"Configuring Dynamic LPAR support (AIX only)","text":"

Dynamic logical partitioning (DLPAR) provides a mechanism to add or remove system resources, such as memory or CPU, to or from the operating system in a logical partition without rebooting. Changing these resources dynamically can have an impact on Java applications that are running on the LPAR.

To enable an application to respond to DLPAR events, you can use OpenJ9 MXBean extensions to the java.lang.management API. The following classes are available in the com.ibm.lang.management package:

These extensions can listen for events and trigger any necessary adjustments to the runtime environment. For example, if a Java VM is running in an LPAR with 2GB of memory, but the available memory might be adjusted between 1GB and 8GB, you might set the following options for the Java heap at run time:

\u2013Xms1g \u2013Xsoftmx2g \u2013Xmx8g\n

This command-line string sets an initial heap size of 1 GB, a soft (adjustable) maximum heap size of 2 GB, and a maximum heap size of 8 GB. You can then use the MemoryMXBean API to dynamically respond to changes in memory resources. The following classes can be used:

For more information about the com.ibm.lang.managment package, which extends the jdk.management module, see the API documentation.

"},{"location":"criusupport/","title":"CRIU support","text":""},{"location":"criusupport/#criu-support","title":"CRIU support","text":"

(Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), Linux on AArch64, and Linux on IBM Z\u00ae only)

Notes:

In OpenJ9, the CRIU support includes an API that you can use to stop the VM at a checkpoint, save its state, and then run the VM from the point where it was stopped. The period of time between when the VM starts and when the application takes a checkpoint is referred to as the checkpoint phase. The application writes the VM state that was saved at the checkpoint to one or more image files. The saved state includes memory pages, methods, file systems, processes, and network connections. You can restore the VM from these files multiple times from the same point and in multiple environments.

Because the checkpoint image files have the live state of the VM that is used to restore the VM in different systems, they should not contain cryptographically-sensitive security data. If the image files contain sensitive security data, the security components are vulnerable to exploitation even if you don't move the image files between systems. The CRIU technical preview introduces the CRIUSECProvider security provider, which provides the following limited set of security services:

When you enable CRIU support, all existing security providers are removed from the security provider list during the checkpoint phase, by default and CRIUSECProvider is added. When you restore the VM in the nonportable restore mode (-XX:+CRIURestoreNonPortableMode), CRIUSECProvider is removed from the security provider list and the previous security providers are added back again.

You can disable CRIUSECProvider during the checkpoint phase with the -XX:-CRIUSecProvider option. For more information, see -XX:[+|-]CRIUSecProvider.

When the VM starts from the saved point instead of the beginning, the VM startup time improves.

"},{"location":"criusupport/#enabling-criu-support","title":"Enabling CRIU support","text":"

CRIU support is not enabled by default. You must enable it by specifying the -XX:+EnableCRIUSupport command-line option when you start your application.

"},{"location":"criusupport/#configuring-criu-support","title":"Configuring CRIU support","text":"

You can access the OpenJ9 CRIU support capabilities by specifying different options. The VM enables the addition of VM options on restore through the CRIUSupport.registerRestoreOptionsFile API and environment variables through the CRIUSupport.registerRestoreEnvVariables API. OPENJ9_RESTORE_JAVA_OPTIONS is a special environment variable for adding the VM options on restore.

There are new options that work at checkpoint as well as at restore and some new options that work at restore only. There are also some existing options that work on restore but some of them behave differently.

"},{"location":"criusupport/#new-options","title":"New options","text":"

You can use the following options only during the checkpoint phase:

You can use the following options only when you restore a VM. If you specify these options when you start the VM (during the checkpoint phase), the VM does not start:

"},{"location":"criusupport/#existing-options","title":"Existing options","text":"

Of the existing command-line options, only the following are supported when you run a restored VM and some of these options have changed behavior:

Options Changed behavior -Xverbosegclog -XcompilationThreads -XsamplingExpirationTime -XX:[+|-]PrintCodeCache -Xtrace If you specify an output file before a checkpoint and another output file for restore, both the files are written according to the -Xtrace options associated with the output file. -Xdump Dump events that are triggered on exception throws or catches cannot be enabled on restore. -Xgcthreads This option is ignored if the number of GC threads is less than the checkpoint GC thread count. -Xjit If -Xint or -Xnoaot and -Xnojit are specified pre-checkpoint, the compiler remains disabled post-restore. -Xaot If -Xnoaot is specified pre-checkpoint, then specifying -Xaot post-restore does not enable AOT compilation or load. -Xjit / -Xaot You can specify the following parameters with the -Xjit and -Xaot options when you run a restored VM:count: Applies only to new methods; existing interpreted methods will not have their counts that are updated. limit, limitFile, exclude: Invalidates the existing compiled methods that do not match the filters. The filters are then enforced for all future JIT and AOT compilations. loadLimit, loadLimitFile, loadExclude: Applies only to future AOT loads; does not impact existing compiled methods. verbose: Effective post-restore; does not override verbose options specified pre-checkpoint. vlog: A vlog file is opened post-restore. If this option was specified pre-checkpoint, the old file is closed first. -Xnoaot Prevents AOT compilations and loads; does not affect the existing compiled methods and does not prevent JIT compilation. -Xnojit Invalidates all existing compiled methods and prevents JIT compilations; does not prevent AOT compilations and loads.

If you specify an unsupported option, the VM throws a JVMRestoreException error by default. If you specify the -XX:+IgnoreUnrecognizedRestoreOptions option, the VM does not throw any exception and just ignores the unsupported option.

For more more information on CRIU support, see the openj9.criu module in your OpenJ9 JDK version (OpenJDK 11 and later) API documentation.

Restrictions:

"},{"location":"criusupport/#see-also","title":"See Also","text":""},{"location":"d_jvm_commands/","title":"Using System properties","text":""},{"location":"d_jvm_commands/#using-system-property-command-line-options","title":"Using system property command-line options","text":"

Java\u2122 system properties determine the environment in which a Java program runs by starting a Java virtual machine with a set of values. You can choose to use the default values for Java system properties or you can specify values for them by adding parameters to the command line when you start your application.

To set a system property from the command line, use:

java -D<property_name>=<value> <program_name>\n

For example, to specify the UTF-8 file encoding for your application MyProgram, use:

java -Dfile.encoding=UTF-8 MyProgram\n
"},{"location":"dcomibmenableclasscaching/","title":"-Dcom.ibm.enableClassCaching","text":""},{"location":"dcomibmenableclasscaching/#-dcomibmenableclasscaching","title":"-Dcom.ibm.enableClassCaching","text":"

Setting this property to true enables caching of the Latest User Defined Class Loader (LUDCL).

"},{"location":"dcomibmenableclasscaching/#syntax","title":"Syntax","text":"
    -Dcom.ibm.enableClassCaching=[true|false]\n
Setting Effect Default true Enable yes false Disable"},{"location":"dcomibmenableclasscaching/#explanation","title":"Explanation","text":"

By reducing repeated lookups, Java\u2122 applications that use deserialization extensively can see a performance improvement.

"},{"location":"dcomibmenableclasscaching/#see-also","title":"See also","text":""},{"location":"dcomibmenablelegacydumpsecurity/","title":"-Dcom.ibm.enableLegacyDumpSecurity","text":""},{"location":"dcomibmenablelegacydumpsecurity/#-dcomibmenablelegacydumpsecurity","title":"-Dcom.ibm.enableLegacyDumpSecurity","text":"

To improve security, the security checks in the certain com.ibm.jvm.Dump APIs are now enabled by default, when the SecurityManager is enabled. Use this system property to turn off security checking for these APIs.

"},{"location":"dcomibmenablelegacydumpsecurity/#syntax","title":"Syntax","text":"
    -Dcom.ibm.enableLegacyDumpSecurity=[true|false]\n
Setting Effect Default true Enable yes false Disable"},{"location":"dcomibmenablelegacydumpsecurity/#explanation","title":"Explanation","text":"

Security checking is enabled in the following APIs:

"},{"location":"dcomibmenablelegacydumpsecurity/#see-also","title":"See also","text":""},{"location":"dcomibmenablelegacylogsecurity/","title":"-Dcom.ibm.enableLegacyLogSecurity","text":""},{"location":"dcomibmenablelegacylogsecurity/#-dcomibmenablelegacylogsecurity","title":"-Dcom.ibm.enableLegacyLogSecurity","text":"

To improve security, the security checks in the certain com.ibm.jvm.Log APIs are now enabled by default, when the SecurityManager is enabled. Use this system property to turn off security checking for these APIs.

"},{"location":"dcomibmenablelegacylogsecurity/#syntax","title":"Syntax","text":"
    -Dcom.ibm.enableLegacyLogSecurity=[true|false]\n
Setting Effect Default true Enable yes false Disable"},{"location":"dcomibmenablelegacylogsecurity/#explanation","title":"Explanation","text":"

Security checking is enabled in the following APIs:

"},{"location":"dcomibmenablelegacylogsecurity/#see-also","title":"See also","text":""},{"location":"dcomibmenablelegacytracesecurity/","title":"-Dcom.ibm.enableLegacyTraceSecurity","text":""},{"location":"dcomibmenablelegacytracesecurity/#-dcomibmenablelegacytracesecurity","title":"-Dcom.ibm.enableLegacyTraceSecurity","text":"

To improve security, the security checks in certain com.ibm.jvm.Trace APIs are now enabled by default, when the SecurityManager is enabled. Use this system property to turn off security checking for these APIs.

"},{"location":"dcomibmenablelegacytracesecurity/#syntax","title":"Syntax","text":"
    -Dcom.ibm.enableLegacyTraceSecurity=[true|false]\n
Setting Effect Default true Enable yes false Disable"},{"location":"dcomibmenablelegacytracesecurity/#explanation","title":"Explanation","text":"

Security checking is enabled in the following APIs:

"},{"location":"dcomibmenablelegacytracesecurity/#see-also","title":"See also","text":""},{"location":"dcomibmgpudisable/","title":"-Dcom.ibm.gpu.disable","text":""},{"location":"dcomibmgpudisable/#-dcomibmgpudisable","title":"-Dcom.ibm.gpu.disable","text":"

Restriction: This system property is supported only on Java\u2122 11 and later.

If you have enabled GPU processing with -Dcom.ibm.gpu.enable, use this system property to turn off processing that can be offloaded to a graphics processing unit (GPU).

"},{"location":"dcomibmgpudisable/#syntax","title":"Syntax","text":"
    -Dcom.ibm.gpu.disable\n
"},{"location":"dcomibmgpudisable/#explanation","title":"Explanation","text":"

Because establishing and completing communication with a GPU incurs an additional overhead, not all processing requirements benefit from being offloaded to the GPU. GPU processing is therefore disabled by default. However, if you have enabled GPU processing with -Dcom.ibm.gpu.enable, this property turns GPU processing off.

"},{"location":"dcomibmgpudisable/#see-also","title":"See also","text":""},{"location":"dcomibmgpuenable/","title":"-Dcom.ibm.gpu.enable","text":""},{"location":"dcomibmgpuenable/#-dcomibmgpuenable","title":"-Dcom.ibm.gpu.enable","text":"

Restriction: This system property is supported only on Java\u2122 11 and later.

Use this system property to control the type of processing that can be offloaded to a graphics processing unit (GPU) when processing requirements meet a specific threshold. This feature can improve the performance of certain Java functions.

"},{"location":"dcomibmgpuenable/#syntax","title":"Syntax","text":"
    -Dcom.ibm.gpu.enable=[all|sort]\n
Setting Effect all Turns on GPU processing for all possible Java functions. sort Turns on GPU processing only for the Java sort() function.

By default, this property is not set.

"},{"location":"dcomibmgpuenable/#explanation","title":"Explanation","text":"

Because establishing and completing communication with a GPU incurs an additional overhead, not all processing requirements benefit from being offloaded to the GPU. When set, this property enables GPU processing for any array that meets a minimum size.

"},{"location":"dcomibmgpuenable/#see-also","title":"See also","text":""},{"location":"dcomibmgpuverbose/","title":"-Dcom.ibm.gpu.verbose","text":""},{"location":"dcomibmgpuverbose/#-dcomibmgpuverbose","title":"-Dcom.ibm.gpu.verbose","text":"

Restriction: This system property is supported only on Java\u2122 11 and later.

This system property can be used to help identify problems with graphics processing unit (GPU) processing.

"},{"location":"dcomibmgpuverbose/#syntax","title":"Syntax","text":"
    -Dcom.ibm.gpu.verbose\n

This property is not set by default.

"},{"location":"dcomibmgpuverbose/#explanation","title":"Explanation","text":"

When specified, this option generates verbose output to STDOUT, which can be piped to a file.

"},{"location":"dcomibmgpuverbose/#see-also","title":"See also","text":""},{"location":"dcomibmlangmanagementosmxbeaniscputime100ns/","title":"-Dcom.ibm.lang.management.OperatingSystemMXBean.isCpuTime100ns","text":""},{"location":"dcomibmlangmanagementosmxbeaniscputime100ns/#-dcomibmlangmanagementoperatingsystemmxbeaniscputime100ns","title":"-Dcom.ibm.lang.management.OperatingSystemMXBean.isCpuTime100ns","text":"

Changes the unit of the return value of the OperatingSystemMXBean.getProcessCpuTime() method.

"},{"location":"dcomibmlangmanagementosmxbeaniscputime100ns/#syntax","title":"Syntax","text":"
    -Dcom.ibm.lang.management.OperatingSystemMXBean.isCpuTime100ns=[true|false]\n
Setting Effect Default true Enable false Disable yes"},{"location":"dcomibmlangmanagementosmxbeaniscputime100ns/#explanation","title":"Explanation","text":"

The Oracle java.lang.management package includes MBean categories such as Memory, OperatingSystem, and GarbageCollector. The Eclipse OpenJ9\u2122 VM provides additional MXBeans to extend the monitoring and management capabilities. For example, the OperatingSystemMXBean, which monitors operating system settings such as physical and virtual memory size, processor capacity, and processor utilization.

The OperatingSystemMXBean.getProcessCpuTime() method returns a value in nanoseconds (10-9 s), for compatibility with the com.sun.management.OperatingSystemMXBean and UnixOperatingSystemMXBean interfaces.

In earlier VM releases, the return value was in hundreds of nanoseconds. If you want to revert to this behavior, set the -Dcom.ibm.lang.management.OperatingSystemMXBean.isCpuTime100ns property to true.

The default value for this property is false.

"},{"location":"dcomibmlangmanagementosmxbeaniscputime100ns/#see-also","title":"See also","text":""},{"location":"dcomibmlangmanagementverbose/","title":"-Dcom.ibm.lang.management.verbose","text":""},{"location":"dcomibmlangmanagementverbose/#-dcomibmlangmanagementverbose","title":"-Dcom.ibm.lang.management.verbose","text":"

Enables verbose information from java.lang.management operations to be written to the output channel during VM operations.

"},{"location":"dcomibmlangmanagementverbose/#syntax","title":"Syntax","text":"
    -Dcom.ibm.lang.management.verbose\n

There are no options for this system property.

"},{"location":"dcomibmotisharedsharedclassglobalfilterclass/","title":"-Dcom.ibm.oti.shared.SharedClassGlobalFilterClass","text":""},{"location":"dcomibmotisharedsharedclassglobalfilterclass/#-dcomibmotisharedsharedclassglobalfilterclass","title":"-Dcom.ibm.oti.shared.SharedClassGlobalFilterClass","text":"

This system property applies a global filter to all non-bootstrap class loaders that share classes.

"},{"location":"dcomibmotisharedsharedclassglobalfilterclass/#syntax","title":"Syntax","text":"
    -Dcom.ibm.oti.shared.SharedClassGlobalFilterClass=<filter_class_name>\n

This property is not set by default.

"},{"location":"dcomibmotisharedsharedclassglobalfilterclass/#explanation","title":"Explanation","text":"

A filter can be used to decide which classes are found and stored by a custom class loader in a shared classes cache. The filter is applied to a particular package by implementing the SharedClassFilter interface.

"},{"location":"dcomibmotisharedsharedclassglobalfilterclass/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachcommand_timeout/","title":"-Dcom.ibm.tools.attach.command_timeout","text":""},{"location":"dcomibmtoolsattachcommand_timeout/#-dcomibmtoolsattachcommand_timeout","title":"-Dcom.ibm.tools.attach.command_timeout","text":"

Specify the timeout for sending a command to the target VM after the initial attachment.

"},{"location":"dcomibmtoolsattachcommand_timeout/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.command_timeout=<ms>\n
Setting Value Default <ms> [1 millisecond or greater] 0 milliseconds (no timeout)"},{"location":"dcomibmtoolsattachcommand_timeout/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachdirectory/","title":"-Dcom.ibm.tools.attach.directory","text":""},{"location":"dcomibmtoolsattachdirectory/#-dcomibmtoolsattachdirectory","title":"-Dcom.ibm.tools.attach.directory","text":"

Specify a different common directory for Attach API working files.

"},{"location":"dcomibmtoolsattachdirectory/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.directory=<directory_name>\n
Setting Value Default <directory_name> [string] .com_ibm_tools_attach

To change the value for directory_name, specify a different directory name. If the directory does not exist, it is created. However, if a parent directory is specified, it must exist. The common directory must be on a local drive, not a network drive.

"},{"location":"dcomibmtoolsattachdirectory/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachdisplayname/","title":"-Dcom.ibm.tools.attach.displayName","text":""},{"location":"dcomibmtoolsattachdisplayname/#-dcomibmtoolsattachdisplayname","title":"-Dcom.ibm.tools.attach.displayName","text":"

Change the default display name for the target virtual machine.

"},{"location":"dcomibmtoolsattachdisplayname/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.displayName=<my_display_name>\n
Setting Value <my_display_name> [string]

To change the value for <my_display_name> that is recorded by an agent, enter a character string of your choice.

If the display name is not set through the -Dcom.ibm.tools.attach.displayName system property, then the main class name along with the application arguments is set as the default display name. For more information, see Java diagnostic command (jcmd) tool.

"},{"location":"dcomibmtoolsattachdisplayname/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachenable/","title":"-Dcom.ibm.tools.attach.enable","text":""},{"location":"dcomibmtoolsattachenable/#-dcomibmtoolsattachenable","title":"-Dcom.ibm.tools.attach.enable","text":"

Enable the Attach API for this application.

"},{"location":"dcomibmtoolsattachenable/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.enable=[yes|no]\n

On AIX\u00ae, Linux\u00ae, macOS\u00ae, and Windows\u2122 systems, the following default applies:

Value Effect Default yes Enable yes no Disable

On z/OS\u00ae systems, the following default applies:

Value Effect Default yes Enable no Disable yes"},{"location":"dcomibmtoolsattachenable/#explanation","title":"Explanation","text":"

A useful reference for information about the Java\u2122 Attach API can be found at http://docs.oracle.com/javase/8/docs/technotes/guides/attach/index.html. The following extract is taken from the Oracle documentation:

The Attach API is an extension that provides a mechanism to attach to a Java virtual machine. A tool written in the Java Language, uses this API to attach to a target virtual machine and load its tool agent into that virtual machine.

A usage example is to late attach the IBM\u00ae Health Center agent to a virtual machine (VM) that is already running.

The Eclipse OpenJ9\u2122 implementation of the Attach API is equivalent to the Oracle implementation. However, the OpenJ9 implementation cannot be used to attach to, or accept attach requests from, other VM implementations.

"},{"location":"dcomibmtoolsattachenable/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachfileaccessupdatetime/","title":"-Dcom.ibm.tools.attach.fileAccessUpdateTime","text":""},{"location":"dcomibmtoolsattachfileaccessupdatetime/#-dcomibmtoolsattachfileaccessupdatetime","title":"-Dcom.ibm.tools.attach.fileAccessUpdateTime","text":"

Linux\u00ae only

This option enables Attach API to update the control file access times at specific intervals, for long-running applications.

"},{"location":"dcomibmtoolsattachfileaccessupdatetime/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.fileAccessUpdateTime=<sleep days>\n

where <sleep days> is the number of interval days after which Attach API updates the control file access times for long-running applications. The default value for <sleep days> is 8.

"},{"location":"dcomibmtoolsattachfileaccessupdatetime/#explanation","title":"Explanation","text":"

By default, the Attach API of a VM places its control files in the system temporary directory, /tmp/.com_ibm_tools_attach. The long-running Attach API uses the control files to operate. But, the VM does not open, modify, or read from these files after the files are created, if there is no attempt to attach to a target VM.

This causes a problem in Linux environments because by default systemd-tmpfiles automatically deletes all files and directories that are stored in the /tmp/ folder that are not changed or read within a specific time period. By default, the files in the /tmp/ folder are cleaned up after 10 days by systemd-tmpfiles.

You can prevent Linux systemd-tmpfiles from deleting the Attach API control files within the /tmp/ folder with the -Dcom.ibm.tools.attach.fileAccessUpdateTime system property. You can specify the interval days after which Attach API updates the control file access times with the -Dcom.ibm.tools.attach.fileAccessUpdateTime system property.

If 0 is specified as the number of <sleep days>, the control file access times are not updated and if systemd-tmpfiles is enabled, it deletes the files in the /tmp/ folder.

You can specify a different location outside of the /tmp/ folder to place the Attach API control files with the -Dcom.ibm.tools.attach.directory system property, if you do not want to use the -Dcom.ibm.tools.attach.fileAccessUpdateTime system property.

"},{"location":"dcomibmtoolsattachfileaccessupdatetime/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachid/","title":"-Dcom.ibm.tools.attach.id","text":""},{"location":"dcomibmtoolsattachid/#-dcomibmtoolsattachid","title":"-Dcom.ibm.tools.attach.id","text":"

Specify a different virtual machine (VM) identifier.

"},{"location":"dcomibmtoolsattachid/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.id=<my_vm_ID>\n
Setting Value Default <my_vm_ID> [string] Target VM process ID

To change the VM identifier recorded by an agent, change the value for <my_vm_ID>. The string must start with an alphabetic character. The remaining characters must be alphanumeric or underscore. Case-sensitivity is system dependent. If the VM identifier is already in use, the attach API modifies it to create a unique value.

"},{"location":"dcomibmtoolsattachid/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachlogging/","title":"-Dcom.ibm.tools.attach.logging","text":""},{"location":"dcomibmtoolsattachlogging/#-dcomibmtoolsattachlogging","title":"-Dcom.ibm.tools.attach.logging","text":"

Enable logging for Attach API events.

"},{"location":"dcomibmtoolsattachlogging/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.logging=[yes|no]\n
Value Effect Default yes Enable no Disable yes"},{"location":"dcomibmtoolsattachlogging/#explanation","title":"Explanation","text":"

Turn on tracing and logging of Attach API events to help diagnose problems. One timestamped log file is created for each Java\u2122 process in the current directory for the running JVM .

"},{"location":"dcomibmtoolsattachlogging/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachlogname/","title":"-Dcom.ibm.tools.attach.log.name","text":""},{"location":"dcomibmtoolsattachlogname/#-dcomibmtoolsattachlogname","title":"-Dcom.ibm.tools.attach.log.name","text":"

Specify the path and prefix for the log files.

"},{"location":"dcomibmtoolsattachlogname/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.log.name=<path/prefix>\n
Setting Value Default <path/prefix> [string] VM process directory

By default, when -Dcom.ibm.tools.attach.logging=true is set, timestamped log files are written to the current directory for the running VM. Use the -Dcom.ibm.tools.attach.log.name option to change the path and prefix for the logfiles.

"},{"location":"dcomibmtoolsattachlogname/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachretry/","title":"-Dcom.ibm.tools.attach.retry","text":""},{"location":"dcomibmtoolsattachretry/#-dcomibmtoolsattachretry","title":"-Dcom.ibm.tools.attach.retry","text":"

Windows\u2122 only

This option specifies the number of times the jcmd tool retries attaching to a running VM when the tool encounters the SocketException error.

"},{"location":"dcomibmtoolsattachretry/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.retry=<number_of_retries>\n

The default value for <number_of_retries> is 3.

"},{"location":"dcomibmtoolsattachretry/#explanation","title":"Explanation","text":"

When the jcmd tool sends a command to a running VM, the command might throw the Socket Exception error in case of issues, such as a network failure or a connection reset. Instead of failing the attaching request, you can specify the number of times the tool retries attaching to the target VM with the -Dcom.ibm.tools.attach.retry system property.

"},{"location":"dcomibmtoolsattachretry/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachshutdown_timeout/","title":"-Dcom.ibm.tools.attach.shutdown_timeout","text":""},{"location":"dcomibmtoolsattachshutdown_timeout/#-dcomibmtoolsattachshutdown_timeout","title":"-Dcom.ibm.tools.attach.shutdown_timeout","text":"

Specify a timeout before ending the Attach API wait loop thread.

"},{"location":"dcomibmtoolsattachshutdown_timeout/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.shutdown_timeout=<ms>\n
Setting Value Default <ms> [1 millisecond or greater] 10000 milliseconds (10 seconds)"},{"location":"dcomibmtoolsattachshutdown_timeout/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachtimeout/","title":"-Dcom.ibm.tools.attach.timeout","text":""},{"location":"dcomibmtoolsattachtimeout/#-dcomibmtoolsattachtimeout","title":"-Dcom.ibm.tools.attach.timeout","text":"

Specify a time that an application should wait when attempting to connect to a target virtual machine (VM) before ending.

"},{"location":"dcomibmtoolsattachtimeout/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.timeout=<ms>\n
Setting Value Default <ms> [501 milliseconds or greater] 120000 milliseconds (120 seconds)

If you specify a value of 500 milliseconds or lower, no connection attempt is made.

"},{"location":"dcomibmtoolsattachtimeout/#example","title":"Example","text":"

To timeout after 60 seconds, specify:

-Dcom.ibm.tools.attach.timeout=60000

"},{"location":"dcomibmtoolsattachtimeout/#see-also","title":"See also","text":""},{"location":"dfileencoding/","title":"-Dfile.encoding","text":""},{"location":"dfileencoding/#-dfileencoding","title":"-Dfile.encoding","text":"

Use this OpenJDK property to define the file encoding that is required.

"},{"location":"dfileencoding/#syntax","title":"Syntax","text":"
    -Dfile.encoding=<value>\n
Setting Value Default <value> [string] Unicode 3.0 standards where <value> defines the file encoding that is required."},{"location":"dfileencoding/#explanation","title":"Explanation","text":"

By default the GBK converter follows Unicode 3.0 standards. To force the GBK converter to follow Unicode 2.0 standards, use a value of bestfit936.

"},{"location":"diag_overview/","title":"Overview","text":""},{"location":"diag_overview/#diagnostic-data-and-tooling","title":"Diagnostic data and tooling","text":"

Eclipse OpenJ9\u2122 contains a broad range of diagnostic capabilities to help identify, isolate, and solve run time problems. These capabilities include dump files, verbose logs, and trace files, which are supported by a variety of diagnostic tools and interfaces.

"},{"location":"diag_overview/#dumps","title":"Dumps","text":"

Various types of dumps are produced by default in response to certain events, such as a GPF fault or an OutOfMemoryError exception. You can also trigger the production of dumps by using the com.ibm.jvm.Dump API or by specifying -Xdump options on the command line.

All dumps are produced by dump agents, which are initialized when the OpenJ9 VM starts. Different dumps target different areas of the runtime environment. If you want to generate a dump to diagnose a particular type of problem, you need to understand what data the dump will provide. The following dumps are typically used for problem diagnosis:

Other types of dump include binary JIT dumps, stack dumps, and snap dumps. For a complete list of dump agents and the diagnostic data they produce, see Dump agents.

"},{"location":"diag_overview/#verbose-log-files","title":"Verbose log files","text":"

Some components of OpenJ9 can also produce verbose output or log files to assist with problem determination.

"},{"location":"diag_overview/#trace-files","title":"Trace files","text":"

The OpenJ9 trace facility can be used to trace applications, Java methods, or internal JVM operations with minimal impact on performance. Trace is configured by using the -Xtrace command line option, which allows you to control what is traced and when.

Trace data is produced in binary format and must be processed by the OpenJ9 trace formatter to convert it to a readable form. For more information, see Trace formatter.

"},{"location":"diag_overview/#diagnostic-tools","title":"Diagnostic tools","text":"

A number of diagnostic tools are available with OpenJ9 to assist with the analysis of dump and trace files.

"},{"location":"diag_overview/#dump-extractor","title":"Dump extractor","text":"

The dump extractor (jpackcore) supports a full analysis of core files on specific platforms by collecting key files from a system and packaging them into an archive along with a core dump. This archive file is extremely useful when reporting issues to the OpenJ9 community, helping to ensure a faster analysis and turnaround. For more information, see Dump extractor.

"},{"location":"diag_overview/#dump-viewer","title":"Dump viewer","text":"

Because system dumps are binary files, OpenJ9 provides a dump viewer tool (jdmpview) to analyze the contents. This tool can work with dumps from any platforms independently of a system debugger. For more information, see Dump viewer.

"},{"location":"diag_overview/#trace-formatter","title":"Trace formatter","text":"

The trace formatter tool converts binary trace point data in a trace file into a readable format for analysis. For more information, see Trace formatter.

"},{"location":"diag_overview/#option-builder","title":"Option builder","text":"

OpenJ9 contains an extensive set of command-line options to assist with problem diagnosis. Certain options are complex, containing many sub-options with numerous parameters. Whilst these offer a great degree of flexibility, the syntax can be difficult to construct. Option builder tools are available that provide a simple graphical user interface to help you construct your command-line argument. For more information, see Option builder.

"},{"location":"diag_overview/#hotspot-compatible-tools","title":"HotSpot-compatible tools","text":"

A number of tools are available for compatibility with the reference implementation. These tools are independently implemented by OpenJ9 but have similar functions, allowing users to migrate more easily. The available tools are listed in the Tools section.

Note: If you are already familiar with tools that are provided with HotSpot, see Switching to OpenJ9, which explains some of the differences you might encounter when using OpenJ9.

"},{"location":"diag_overview/#eclipse-marketplace-tools","title":"Eclipse marketplace tools","text":"

OpenJ9 provides support for a number of monitoring and diagnostic tools that can be found in the Eclipse marketplace. Each tool provides a graphical user interface to help you visualize data and, in some cases, can provide tuning or debugging recommendations.

If you are familiar with using HotSpot as part of an Oracle JDK or OpenJDK, the Java VisualVM utility is functionally similar to Health Center.

"},{"location":"diag_overview/#interfaces","title":"Interfaces","text":""},{"location":"diag_overview/#jvm-tool-interface-jvmti","title":"JVM tool interface (JVMTI)","text":"

OpenJ9 supports the Java Virtual Machine Tool Interface (JVMTI) and provides extensions that allow JVMTI tools to obtain diagnostic information or trigger diagnostic operations in the VM. For more information, see Java Virtual Machine Tool Interface.

"},{"location":"diag_overview/#dtfj-interface","title":"DTFJ Interface","text":"

OpenJ9 includes the Diagnostic Tool Framework for Java (DTFJ) API. Custom applications can be written that use this API to access a wide range of information in a system dump or a Java dump. DTFJ can be used with the Eclipse Memory Analyzer tool (MAT) to examine the Java object heap for memory leaks and to reduce memory consumption. For more information, see Diagnostic Tool Framework for Java.

"},{"location":"diag_overview/#language-management-interface","title":"Language Management interface","text":"

OpenJ9 provides MXBean additions and extensions to the standard java.lang.management API, which enables you to use tools such as JConsole to monitor and manage your Java applications. For more information, see Language management interface.

"},{"location":"diag_overview/#jpda-tools","title":"JPDA tools","text":"

OpenJ9 is compliant with the Java Platform Debugging Architecture (JPDA), which means you can use any JPDA tool for diagnosis, including Eclipse JDT Debug.

"},{"location":"djavacompiler/","title":"-Djava.compiler","text":""},{"location":"djavacompiler/#-djavacompiler","title":"-Djava.compiler","text":"

This Oracle HotSpot property is used for loading a JIT compiler from a named, native library. This option can be used on the command line to specify the JIT compiler for the Eclipse OpenJ9\u2122 VM.

"},{"location":"djavacompiler/#syntax","title":"Syntax","text":"
    -Djava.compiler=j9jit29\n
"},{"location":"djavalangstringbuffergrowaggressively/","title":"-Djava.lang.stringBuffer.growAggressively","text":""},{"location":"djavalangstringbuffergrowaggressively/#-djavalangstringbuffergrowaggressively","title":"-Djava.lang.stringBuffer.growAggressively","text":"

Restriction: This system property is supported only on Java\u2122 8.

Setting this property to false reverts to the behavior (Eclipse OpenJ9\u2122 0.18 and earlier) of growing a 1 G char[] or larger StringBuffer or StringBuilder only as much as necessary to accommodate the String being added. The default behavior is to immediately grow to the maximum possible size, similarly to Java 11 and later. The default behavior is compatible with the Oracle HotSpot VM.

"},{"location":"djavalangstringbuffergrowaggressively/#syntax","title":"Syntax","text":"
    -Djava.lang.stringBufferAndBuilder.growAggressively=[true|false]\n
Setting Effect Default true Above 1 G, grow to the maximum size yes false Above 1 G, grow only as required"},{"location":"djavalangstringsubstringnocopy/","title":"-Djava.lang.string.substring.nocopy","text":""},{"location":"djavalangstringsubstringnocopy/#-djavalangstringsubstringnocopy","title":"-Djava.lang.string.substring.nocopy","text":"

Restriction: This system property is supported only on Java\u2122 8. String sharing cannot be enabled on Java 11 and later.

Setting this property to true avoids sharing a String object when substring() is used to subset a String beginning from offset zero. Avoiding sharing is compatible with the Oracle HotSpot VM.

"},{"location":"djavalangstringsubstringnocopy/#syntax","title":"Syntax","text":"
    -Djava.lang.string.substring.nocopy=[true|false]\n
Setting Effect Default true No sharing false Sharing yes"},{"location":"djdknativecbc/","title":"-Djdk.nativeCBC","text":""},{"location":"djdknativecbc/#-djdknativecbc","title":"-Djdk.nativeCBC","text":"

This option enables or disables OpenSSL native cryptographic support for the CBC algorithm.

"},{"location":"djdknativecbc/#syntax","title":"Syntax","text":"
    -Djdk.nativeCBC=[true|false]\n
Setting value Default -Djdk.nativeCBC true yes -Djdk.nativeCBC false"},{"location":"djdknativecbc/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the CBC algorithm. If you want to turn off this algorithm only, set this option to false. To turn off all the algorithms, see the -Djdk.nativeCrypto system property command line option.

"},{"location":"djdknativechacha20/","title":"-Djdk.nativeChaCha20","text":""},{"location":"djdknativechacha20/#-djdknativechacha20","title":"-Djdk.nativeChaCha20","text":"

This option enables or disables OpenSSL native cryptographic support for the ChaCha20 and ChaCha20-Poly1305 algorithms.

Restrictions:

"},{"location":"djdknativechacha20/#syntax","title":"Syntax","text":"
    -Djdk.nativeChaCha20=[true|false]\n
Setting value Default -Djdk.nativeChaCha20 true yes -Djdk.nativeChaCha20 false"},{"location":"djdknativechacha20/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the ChaCha20 and ChaCha20-Poly1305 algorithms. If you want to turn off support for these algorithms only, set this option to false. To turn off support for these and other algorithms, see the -Djdk.nativeCrypto system property command line option.

"},{"location":"djdknativecrypto/","title":"-Djdk.nativeCrypto","text":""},{"location":"djdknativecrypto/#-djdknativecrypto","title":"-Djdk.nativeCrypto","text":"

This option controls the use of OpenSSL native cryptographic support.

"},{"location":"djdknativecrypto/#syntax","title":"Syntax","text":"
    -Djdk.nativeCrypto=[true|false]\n
Setting value Default -Djdk.nativeCrypto true yes -Djdk.nativeCrypto false"},{"location":"djdknativecrypto/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the following algorithms:

If you want to turn off the OpenSSL implementation, set the -Djdk.nativeCrypto option to false.

Restrictions:

If you want to turn off the algorithms individually, use the following system properties:

"},{"location":"djdknativedigest/","title":"-Djdk.nativeDigest","text":""},{"location":"djdknativedigest/#-djdknativedigest","title":"-Djdk.nativeDigest","text":"

This option enables or disables OpenSSL native cryptographic support for the MD5, SHA-224, SHA-256, SHA-384, and SHA-512 digest algorithms.

"},{"location":"djdknativedigest/#syntax","title":"Syntax","text":"
    -Djdk.nativeDigest=[true|false]\n
Setting value Default -Djdk.nativeDigest true yes -Djdk.nativeDigest false"},{"location":"djdknativedigest/#explanation","title":"Explanation","text":"

To turn off all the algorithms, see the -Djdk.nativeCrypto system property command-line option.

Note: The MD5 digest algorithm is not supported for OpenSSL on AIX\u00ae. The Java implementation is always used for the MD5 digest algorithm on AIX.

"},{"location":"djdknativeec/","title":"-Djdk.nativeEC","text":""},{"location":"djdknativeec/#-djdknativeec","title":"-Djdk.nativeEC","text":"

This option enables or disables OpenSSL native cryptographic support for the ECDH key agreement algorithm.

"},{"location":"djdknativeec/#syntax","title":"Syntax","text":"
    -Djdk.nativeEC=[true|false]\n
Setting value Default -Djdk.nativeEC true yes -Djdk.nativeEC false"},{"location":"djdknativeec/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the ECDH key agreement algorithm. If you want to turn off support for this algorithm only, set this option to false. To turn off support for this and other algorithms, see the -Djdk.nativeCrypto system property command line option.

"},{"location":"djdknativeeckeygen/","title":"-Djdk.nativeECKeyGen","text":""},{"location":"djdknativeeckeygen/#-djdknativeeckeygen","title":"-Djdk.nativeECKeyGen","text":"

This option enables or disables OpenSSL native cryptographic support for the EC key generation algorithm.

"},{"location":"djdknativeeckeygen/#syntax","title":"Syntax","text":"
    -Djdk.nativeECKeyGen=[true|false]\n
Setting value Default -Djdk.nativeECKeyGen true yes -Djdk.nativeECKeyGen false"},{"location":"djdknativeeckeygen/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the EC key generation algorithm. If you want to turn off support for this algorithm only, set this option to false. To turn off support for this and other algorithms, see the -Djdk.nativeCrypto system property command line option.

Note: The EC key generation algorithm is not supported for OpenSSL on AIX\u00ae. This option is ignored on AIX and the Java implementation is always used.

"},{"location":"djdknativegcm/","title":"-Djdk.nativeGCM","text":""},{"location":"djdknativegcm/#-djdknativegcm","title":"-Djdk.nativeGCM","text":"

This option enables or disables OpenSSL native cryptographic support for the GCM algorithm.

"},{"location":"djdknativegcm/#syntax","title":"Syntax","text":"
    -Djdk.nativeGCM=[true|false]\n
Setting value Default -Djdk.nativeGCM true yes -Djdk.nativeGCM false"},{"location":"djdknativegcm/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the GCM algorithm. If you want to turn off this algorithm only, set this option to false. To turn off all the algorithms, see the -Djdk.nativeCrypto system property command line option.

"},{"location":"djdknativersa/","title":"-Djdk.nativeRSA","text":""},{"location":"djdknativersa/#-djdknativersa","title":"-Djdk.nativeRSA","text":"

This option enables or disables OpenSSL native cryptographic support for the RSA algorithm.

"},{"location":"djdknativersa/#syntax","title":"Syntax","text":"
    -Djdk.nativeRSA=[true|false]\n
Setting value Default -Djdk.nativeRSA true yes -Djdk.nativeRSA false"},{"location":"djdknativersa/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the RSA algorithm. If you want to turn off support for this algorithm only, set this option to false. To turn off all the algorithms, see the -Djdk.nativeCrypto system property command line option.

"},{"location":"djdknativexdhkeyagreement/","title":"-Djdk.nativeXDHKeyAgreement","text":""},{"location":"djdknativexdhkeyagreement/#-djdknativexdhkeyagreement","title":"-Djdk.nativeXDHKeyAgreement","text":"

This option enables or disables OpenSSL native cryptographic support for the XDH key agreement algorithm.

Restrictions:

"},{"location":"djdknativexdhkeyagreement/#syntax","title":"Syntax","text":"
    -Djdk.nativeXDHKeyAgreement=[true|false]\n
Setting value Default -Djdk.nativeXDHKeyAgreement true yes -Djdk.nativeXDHKeyAgreement false"},{"location":"djdknativexdhkeyagreement/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the XDH key agreement algorithm. If you want to turn off support for this algorithm only, set this option to false. To turn off support for this and other algorithms, see the -Djdk.nativeCrypto system property command line option.

Note: The XDH key agreement algorithm is not supported for OpenSSL on AIX\u00ae. This option is ignored on AIX and the Java implementation is always used.

"},{"location":"djdknativexdhkeygen/","title":"-Djdk.nativeXDHKeyGen","text":""},{"location":"djdknativexdhkeygen/#-djdknativexdhkeygen","title":"-Djdk.nativeXDHKeyGen","text":"

This option enables or disables OpenSSL native cryptographic support for the XDH key generation algorithm.

Restrictions:

"},{"location":"djdknativexdhkeygen/#syntax","title":"Syntax","text":"
    -Djdk.nativeXDHKeyGen=[true|false]\n
Setting value Default -Djdk.nativeXDHKeyGen true yes -Djdk.nativeXDHKeyGen false"},{"location":"djdknativexdhkeygen/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the XDH key generation algorithm. If you want to turn off support for this algorithm only, set this option to false. To turn off support for this and other algorithms, see the -Djdk.nativeCrypto system property command line option.

Note: The XDH key generation algorithm is not supported for OpenSSL on AIX\u00ae. This option is ignored on AIX and the Java implementation is always used.

"},{"location":"dorgeclipseopenj9criuimmutableenvvars/","title":"-Dorg.eclipse.openj9.criu.ImmutableEnvVars","text":""},{"location":"dorgeclipseopenj9criuimmutableenvvars/#-dorgeclipseopenj9criuimmutableenvvars","title":"-Dorg.eclipse.openj9.criu.ImmutableEnvVars","text":"

This system property specifies the environment variables that you want to add to the ImmutableEnvVars list.

Restrictions: This option takes effect only when the -XX:+EnableCRIUSupport option is enabled. This option can be used only during the checkpoint phase.

"},{"location":"dorgeclipseopenj9criuimmutableenvvars/#syntax","title":"Syntax","text":"
    -Dorg.eclipse.openj9.criu.ImmutableEnvVars=<environment_variables>\n

Where <environment_variables> is a comma-separated list of environment variables. For example:

-Dorg.eclipse.openj9.criu.ImmutableEnvVars=INVOKED,WLP_USER_DIR,WLP_OUTPUT_DIR,LOG_DIR,X_LOG_DIR,LOG_FILE,X_LOG_FILE,VARIABLE_SOURCE_DIRS,X_CMD\n

The following environment variables are included in the list by default and cannot be removed:

"},{"location":"dorgeclipseopenj9criuimmutableenvvars/#explanation","title":"Explanation","text":"

The environment variables are a property of the operating system environment and not the VM. The VM considers these properties as immutable and does not allow the environment variables to change values between checkpoint and restore.

During the checkpoint and restore phases, the VM can detect the environment variables that are in the immutableEnvvars list. You can add any other immutable variables that you want the VM to detect in the ImmutableEnvVars list with the -Dorg.eclipse.openj9.criu.ImmutableEnvVars option. If an environment variable is not in the list, the VM does not detect that variable even if the underlying system has defined it. These environment variables exist for the entire lifetime of the VM (checkpoint and restore).

At restore, the VM can also detect the environment variables that are added through the CRIUSupport.registerRestoreEnvVariables API.

For more information about how environment variables are handled during the checkpoint and restore process, see the Environment Variables section in the OpenJ9 CRIU Support: A look under the hood\u202f(part II) blog post.

"},{"location":"dorgeclipseopenj9criuimmutableenvvars/#see-also","title":"See also","text":""},{"location":"dump_heapdump/","title":"Heap dump","text":""},{"location":"dump_heapdump/#heap-dump","title":"Heap dump","text":"

Heap dumps contain a snapshot of all the live objects that are being used by a running Java\u2122 application on the Java heap. You can obtain detailed information for each object instance, such as the address, type, class name, or size, and whether the instance has references to other objects.

There are two formats for heap dumps; the classic format and the Portable Heap Dump (PHD) format, which is the default. Whilst the classic format is generated in ascii text and can be read, the PHD format is binary and and must be processed for analysis.

"},{"location":"dump_heapdump/#obtaining-dumps","title":"Obtaining dumps","text":"

Heap dumps are generated by default in PHD format when the Java heap runs out of space. If you want to trigger the production of a heap dump in response to other situations, or in classic format, you can use one of the following options:

"},{"location":"dump_heapdump/#analyzing-dumps","title":"Analyzing dumps","text":"

The best method to analyze a PHD heap dump is to use the Eclipse Memory Analyzer\u2122 tool (MAT) or the IBM Memory Analyzer tool. These tools process the dump file and provide a visual representation of the objects in the Java Heap. Both tools require the Diagnostic Tool Framework for Java (DTFJ) plug-in. To install the DTFJ plug-in in the Eclipse IDE, select the following menu items:

Help > Install New Software > Work with \"IBM Diagnostic Tool Framework for Java\" > IBM Monitoring and Diagnostic Tools > Diagnostic Tool Framework for Java   \n

The following sections contain detailed information about the content of each type of heap dump file.

"},{"location":"dump_heapdump/#portable-heap-dump-phd-format","title":"Portable Heap Dump (PHD) format","text":"

A PHD format dump file contains a header section and a body section. The body section can contain information about object, array, or class records. Primitive numbers are used to describe the file format, as detailed in the following table:

Primitive number Length in bytes byte 1 short 2 int 4 long 8 word 4 (32-bit platforms) or 8 (64-bit platforms)"},{"location":"dump_heapdump/#general-structure","title":"General structure","text":"

The following structure comprises the header section of a PHD file:

The body of a PHD file is indicated by a byte that contains a tag with a value of 2, after which there are a number of dump records. Dump records are preceded by a 1 byte tag with the following record types:

These records are described in more detail in the sections that follow.

The end of the PHD body is indicated by a byte that contains a tag with a value of 3.

"},{"location":"dump_heapdump/#object-records","title":"Object records","text":"

Object records can be short, medium, or long, depending on the number of object references in the heap dump.

1. Short object record

The following information is contained within the tag byte:

2. Medium object record

These records provide the actual address of the class rather than a cache index. The following format is used:

3. Long object record

This record format is used when there are more than 7 references, or if there are extra flags or a hash code. The following format is used:

"},{"location":"dump_heapdump/#array-records","title":"Array records","text":"

PHD arrays can be primitive arrays or object arrays, as described in the sections that follow.

1. Primitive array record

The following information is contained in an array record:

2. Long primitive array record

This type of record is used when a primitive array has been hashed.

3. Object array record

The following format applies:

"},{"location":"dump_heapdump/#class-records","title":"Class records","text":"

The PHD class record encodes a class object and contains the following format:

"},{"location":"dump_heapdump/#classic-heap-dump-format","title":"Classic Heap Dump format","text":"

Classic heap dumps are produced in ascii text on all platforms except z/OS, which are encoded in EBCDIC. The dump is divided into the following sections:

"},{"location":"dump_heapdump/#header-record","title":"Header record","text":"

A single string containing information about the runtime environment, platform, and build levels, similar to the following example:

// Version: JRE 1.8.0 Linux amd64-64 (build 1.8.0_232-b09)\n
"},{"location":"dump_heapdump/#object-records_1","title":"Object records","text":"

A record of each object instance in the heap with the following format:

<object address, in hexadecimal> [<length in bytes of object instance, in decimal>] OBJ <object type>\n<heap reference, in hexadecimal> <heap reference, in hexadecimal> ...\n

The following object types (object type) might be shown:

These types are abbreviated in the record. To determine the type, see the Java VM Type Signature table.

Any references found are also listed, excluding references to an object's class or NULL references.

The following example shows an object instance (16 bytes in length) of type java/lang/String, with a reference to a char array:

0x00000000E0000AF0 [16] OBJ java/lang/String\n    0x00000000E0000B00\n

The object instance (length 32 bytes) of type char array, as referenced from the java/lang/String, is shown in the following example:

0x00000000E0000B00 [32] OBJ [C\n

The following example shows an object instance (24 bytes in length) of type array of java/lang/String:

0x00000000FFF07498 [24] OBJ [Ljava/lang/String;\n    0x00000000E0005D78 0x00000000E0005D50 0x00000000E0005D28 0x00000000E0005D00\n
"},{"location":"dump_heapdump/#class-records_1","title":"Class records","text":"

A record of each class in the following format:

<class object address, in hexadecimal> [<length in bytes of class object, in decimal>] CLS <class type>\n<heap reference, in hexadecimal> <heap reference, in hexadecimal>...\n

The following class types (<class type>) might be shown:

These types are abbreviated in the record. To determine the type, see the Java VM Type Signature table.

Any references found in the class block are also listed, excluding NULL references.

The following example shows a class object (80 bytes in length) for java/util/Date, with heap references:

0x00000000E00174F0 [80] CLS java/util/Date\n    0x00000000FFF1BB60 0x00000000FFF29630\n
"},{"location":"dump_heapdump/#trailer-record-1","title":"Trailer record 1","text":"

A single record containing record counts, in decimal.

For example:

// Breakdown - Classes: 630, Objects: 3692, ObjectArrays: 576, PrimitiveArrays: 2249\n
"},{"location":"dump_heapdump/#trailer-record-2","title":"Trailer record 2","text":"

A single record containing totals, in decimal.

For example:

// EOF:  Total 'Objects',Refs(null) : 7147,22040(12379)\n

The values in the example reflect the following counts:

"},{"location":"dump_heapdump/#java-vm-type-signatures","title":"Java VM Type Signatures","text":"

The following table shows the abbreviations used for different Java types in the heap dump records:

Java VM Type Signature Java Type Z boolean B byte C char S short I int J long F float D double L<fully-qualified class>; <fully-qualified class> [<type> <type>[](array of <type>) (<arg-types>)<ret-type> method"},{"location":"dump_heapdump/#see-also","title":"See also","text":""},{"location":"dump_javadump/","title":"Java dump","text":""},{"location":"dump_javadump/#java-dump","title":"Java dump","text":"

Java\u2122 dumps, sometimes referred to as Java cores, are produced when the VM ends unexpectedly because of an operating system signal, OutOfMemoryError, or a user-initiated keystroke combination. You can also generate a Java dump by calling the Dump API programmatically from your application or specifying the -Xdump:java option on the command line.

If your Java application crashes or hangs, Java dumps can provide useful information to help you diagnose the root cause.

To help you understand how a Java dump can help you with problem diagnosis, this topic includes a few scenarios to help you interpret the data:

"},{"location":"dump_javadump/#java-dump-contents","title":"Java dump contents","text":"

Java dumps summarize the state of the VM when the event occurs, with most of the information relating to components of the VM. The file is made up of a number of sections that provide different types of information.

"},{"location":"dump_javadump/#title","title":"TITLE","text":"

The first section of the Java dump file provides information about the event that triggered the production of the dump. In the following example, you can see that a vmstop event triggered the dump at a specified date and time.

0SECTION       TITLE subcomponent dump routine\nNULL           ===============================\n1TICHARSET     UTF-8\n1TISIGINFO     Dump Event \"vmstop\" (00000002) Detail \"#0000000000000000\" received\n1TIDATETIMEUTC Date: 2021/04/23 at 18:02:44:017 (UTC)\n1TIDATETIME    Date: 2021/04/23 at 14:02:44:017\n1TITIMEZONE    Timezone: UTC-4 (EDT)\n1TINANOTIME    System nanotime: 379202644260787\n1TIFILENAME    Javacore filename:    /home/doc-javacore/javacore.20210423.140244.1175.0001.txt\n1TIREQFLAGS    Request Flags: 0x81 (exclusive+preempt)\n1TIPREPSTATE   Prep State: 0x106 (vm_access+exclusive_vm_access+trace_disabled)\n
"},{"location":"dump_javadump/#gpinfo","title":"GPINFO","text":"

The GPINFO section provides general information about the system that the VM is running on. The following example is taken from a Java dump that was generated on a Linux system.

NULL           ------------------------------------------------------------------------\n0SECTION       GPINFO subcomponent dump routine\nNULL           ================================\n2XHOSLEVEL     OS Level         : Linux 3.10.0-862.11.6.el7.x86_64\n2XHCPUS        Processors -\n3XHCPUARCH       Architecture   : amd64\n3XHNUMCPUS       How Many       : 4\n3XHNUMASUP       NUMA is either not supported or has been disabled by user\nNULL\n1XHERROR2      Register dump section only produced for SIGSEGV, SIGILL or SIGFPE.\nNULL\n

The content of this section can vary, depending on the cause of the dump. For example, if the dump was caused by a general protection fault (gpf), the library in which the crash occurred is also recorded, together with a value shown as VM flags. This value can provide some clues about which component of the VM might have been involved. Look for the following line in the output:

1XHFLAGS       VM flags:0000000000000000\n

The hexadecimal number that is recorded for VM flags ends in MSSSS, where M is the VM component and SSSS is component-specific code as shown in the following table:

Component Code value INTERPRETER 0x10000 GC 0x20000 GROW_STACK 0x30000 JNI 0x40000 JIT_CODEGEN 0x50000 BCVERIFY 0x60000 RTVERIFY 0x70000 SHAREDCLASSES 0x80000

A value of 0000000000000000 (0x00000) indicates that a crash occurred outside of the VM.

"},{"location":"dump_javadump/#envinfo","title":"ENVINFO","text":"

This section contains useful information about the environment in which the crash took place, including the following data:

For clarity, the following example shows a shortened version of this section, where ... indicates that lines are removed:

NULL           ------------------------------------------------------------------------\n0SECTION       ENVINFO subcomponent dump routine\nNULL           =================================\n1CIJAVAVERSION JRE 9 Linux amd64-64 (build 9.0.4-internal+0-adhoc..openj9-openjdk-jdk9)\n1CIVMVERSION   20180830_000000\n1CIJ9VMVERSION 8e7c6ec\n1CIJITVERSION  8e7c6ec\n1CIOMRVERSION  553811b_CMPRSS\n1CIJCLVERSION  ec1d223 based on jdk-9.0.4+12\n1CIJITMODES    JIT enabled, AOT enabled, FSD disabled, HCR enabled\n1CIRUNNINGAS   Running as a standalone JVM\n1CIVMIDLESTATE VM Idle State: ACTIVE\n1CICONTINFO    Running in container : FALSE\n1CICGRPINFO    JVM support for cgroups enabled : TRUE\n1CISTARTTIME   JVM start time: 2018/08/30 at 21:55:47:387\n1CISTARTNANO   JVM start nanotime: 22012135233549\n1CIPROCESSID   Process ID: 30285 (0x764D)\n1CICMDLINE     [not available]\n1CIJAVAHOMEDIR Java Home Dir:   /home/me/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-release/images/jdk\n1CIJAVADLLDIR  Java DLL Dir:    /home/me/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-release/images/jdk/bin\n1CISYSCP       Sys Classpath:\n1CIUSERARGS    UserArgs:\n2CIUSERARG               -Xoptionsfile=/home/me/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-release/images/jdk/lib/options.default\n...\n1CIIGNOREDARGS Ignored Args:\n2CIIGNOREDARG            -XX:+UseCompressedOop\n2CIIGNOREDARG            -XX:CompressedClassSpaceSize=528482304\nNULL\n1CIUSERLIMITS  User Limits (in bytes except for NOFILE and NPROC)\nNULL           ------------------------------------------------------------------------\nNULL           type                            soft limit           hard limit\n2CIUSERLIMIT   RLIMIT_AS                        unlimited            unlimited\n2CIUSERLIMIT   RLIMIT_CORE                              0            unlimited\n2CIUSERLIMIT   RLIMIT_CPU                       unlimited            unlimited\n2CIUSERLIMIT   RLIMIT_DATA                      unlimited            unlimited\n2CIUSERLIMIT   RLIMIT_FSIZE                     unlimited            unlimited\n2CIUSERLIMIT   RLIMIT_LOCKS                     unlimited            unlimited\n2CIUSERLIMIT   RLIMIT_MEMLOCK                       65536                65536\n2CIUSERLIMIT   RLIMIT_NOFILE                         4096                 4096\n2CIUSERLIMIT   RLIMIT_NPROC                          4096                30592\n2CIUSERLIMIT   RLIMIT_RSS                       unlimited            unlimited\n2CIUSERLIMIT   RLIMIT_STACK                       8388608            unlimited\n2CIUSERLIMIT   RLIMIT_MSGQUEUE                     819200               819200\n2CIUSERLIMIT   RLIMIT_NICE                              0                    0\n2CIUSERLIMIT   RLIMIT_RTPRIO                            0                    0\n2CIUSERLIMIT   RLIMIT_SIGPENDING                    30592                30592\nNULL\n1CIENVVARS     Environment Variables\nNULL           ------------------------------------------------------------------------\n2CIENVVAR      XDG_VTNR=1\n2CIENVVAR      SSH_AGENT_PID=2653\n...\nNULL\n1CISYSINFO     System Information\nNULL           ------------------------------------------------------------------------\n2CISYSINFO     /proc/sys/kernel/core_pattern = core\n2CISYSINFO     /proc/sys/kernel/core_uses_pid = 1\nNULL\n1CICPUINFO     CPU Information\nNULL           ------------------------------------------------------------------------\n2CIPHYSCPU     Physical CPUs: 8\n2CIONLNCPU     Online CPUs: 8\n2CIBOUNDCPU    Bound CPUs: 8\n2CIACTIVECPU   Active CPUs: 0\n2CITARGETCPU   Target CPUs: 8\n2CIJITFEATURE  CPU features (JIT): fpu cx8 cmov mmx sse sse2 ssse3 fma sse4_1 popcnt aesni osxsave avx avx2 rdt_m\n2CIAOTFEATURE  CPU features (AOT): fpu cx8 cmov mmx sse sse2 ssse3 fma sse4_1 popcnt aesni osxsave avx avx2 rdt_m\nNULL\n1CICGRPINFO    Cgroup Information\nNULL           ------------------------------------------------------------------------\n2CICGRPINFO    subsystem : cpu\n2CICGRPINFO    cgroup name : /\n3CICGRPINFO    CPU Period : 100000 microseconds\n3CICGRPINFO    CPU Quota : Not Set\n3CICGRPINFO    CPU Shares : 1024\n3CICGRPINFO    Period intervals elapsed count : 0\n3CICGRPINFO    Throttled count : 0\n3CICGRPINFO    Total throttle time : 0 nanoseconds\n2CICGRPINFO    subsystem : cpuset\n2CICGRPINFO    cgroup name : /\n3CICGRPINFO    CPU exclusive : 1\n3CICGRPINFO    Mem exclusive : 1\n3CICGRPINFO    CPUs : 0-7\n3CICGRPINFO    Mems : 0\n2CICGRPINFO    subsystem : memory\n2CICGRPINFO    cgroup name : /\n3CICGRPINFO    Memory Limit : Not Set\n3CICGRPINFO    Memory + Swap Limit : Not Set\n3CICGRPINFO    Memory Usage : 5363396608 bytes\n3CICGRPINFO    Memory + Swap Usage : 5363396608 bytes\n3CICGRPINFO    Memory Max Usage : 0 bytes\n3CICGRPINFO    Memory + Swap Max Usage : 0 bytes\n3CICGRPINFO    Memory limit exceeded count : 0\n3CICGRPINFO    Memory + Swap limit exceeded count : 0\n3CICGRPINFO    OOM Killer Disabled : 0\n3CICGRPINFO    Under OOM : 0\nNULL\n
"},{"location":"dump_javadump/#nativememinfo","title":"NATIVEMEMINFO","text":"

This section records information about native memory that is requested by using library functions such as malloc() and mmap(). Values are provided as a breakdown, per component, indicating the total number of bytes allocated and the number of native memory allocations. In the following example, 4,682,840 bytes of native memory are allocated (but not yet freed) to VM Classes, which correspond to 141 allocations.

NULL           ------------------------------------------------------------------------\n0SECTION       NATIVEMEMINFO subcomponent dump routine\nNULL           =================================\n0MEMUSER\n1MEMUSER       JRE: 2,569,088,312 bytes / 4653 allocations\n1MEMUSER       |\n2MEMUSER       +--VM: 2,280,088,336 bytes / 2423 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Classes: 4,682,840 bytes / 141 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Memory Manager (GC): 2,054,966,784 bytes / 433 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Java Heap: 2,014,113,792 bytes / 1 allocation\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Other: 40,852,992 bytes / 432 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Threads: 10,970,016 bytes / 156 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Java Stack: 197,760 bytes / 16 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Native Stack: 10,616,832 bytes / 17 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Other: 155,424 bytes / 123 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Trace: 180,056 bytes / 263 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--JVMTI: 17,776 bytes / 13 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--JNI: 36,184 bytes / 52 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Port Library: 208,179,632 bytes / 72 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Unused <32bit allocation regions: 208,168,752 bytes / 1 allocation\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Other: 10,880 bytes / 71 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Other: 1,055,048 bytes / 1293 allocations\n1MEMUSER       |\n2MEMUSER       +--JIT: 288,472,816 bytes / 140 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--JIT Code Cache: 268,435,456 bytes / 1 allocation\n2MEMUSER       |  |\n3MEMUSER       |  +--JIT Data Cache: 2,097,216 bytes / 1 allocation\n2MEMUSER       |  |\n3MEMUSER       |  +--Other: 17,940,144 bytes / 138 allocations\n1MEMUSER       |\n2MEMUSER       +--Class Libraries: 13,432 bytes / 25 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--VM Class Libraries: 13,432 bytes / 25 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--sun.misc.Unsafe: 3,184 bytes / 13 allocations\n4MEMUSER       |  |  |  |\n5MEMUSER       |  |  |  +--Direct Byte Buffers: 1,056 bytes / 12 allocations\n4MEMUSER       |  |  |  |\n5MEMUSER       |  |  |  +--Other: 2,128 bytes / 1 allocation\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Other: 10,248 bytes / 12 allocations\n1MEMUSER       |\n2MEMUSER       +--Unknown: 513,728 bytes / 2065 allocations\nNULL\n

This section does not record memory that is allocated by application or JNI code and is typically a little less than the value recorded by operating system tools.

"},{"location":"dump_javadump/#meminfo","title":"MEMINFO","text":"

This section relates to memory management, providing a breakdown of memory usage in the VM for the object heap, internal memory, memory used for classes, the JIT code cache, and JIT data cache in decimal and hexadecimal format. You can also find out which garbage collection policy is in use when the dump is produced.

The object memory area (1STHEAPTYPE) records each memory region in use, its start and end address, and region size. Further information is recorded about the memory segments that are used for internal memory, class memory, the JIT code cache, and JIT data cache (1STSEGMENT). This information includes the address of the segment control data structure, the start and end address of the native memory segment, as well as the segment size.

For clarity, the following example shows a shortened version of this section, where ... indicates that lines are removed:

NULL           ------------------------------------------------------------------------\n0SECTION       MEMINFO subcomponent dump routine\nNULL           =================================\nNULL\n1STHEAPTYPE    Object Memory\nNULL           id                 start              end                size               space/region\n1STHEAPSPACE   0x00007FF4F00744A0         --                 --                 --         Generational\n1STHEAPREGION  0x00007FF4F0074CE0 0x0000000087F40000 0x0000000088540000 0x0000000000600000 Generational/Tenured Region\n1STHEAPREGION  0x00007FF4F0074930 0x00000000FFE00000 0x00000000FFF00000 0x0000000000100000 Generational/Nursery Region\n1STHEAPREGION  0x00007FF4F0074580 0x00000000FFF00000 0x0000000100000000 0x0000000000100000 Generational/Nursery Region\nNULL\n1STHEAPTOTAL   Total memory:                     8388608 (0x0000000000800000)\n1STHEAPINUSE   Total memory in use:              2030408 (0x00000000001EFB48)\n1STHEAPFREE    Total memory free:                6358200 (0x00000000006104B8)\nNULL\n1STSEGTYPE     Internal Memory\nNULL           segment            start              alloc              end                type       size\n1STSEGMENT     0x00007FF4F004CBC8 0x00007FF4CD33C000 0x00007FF4CD33C000 0x00007FF4CE33C000 0x01000440 0x0000000001000000\n1STSEGMENT     0x00007FF4F004CB08 0x00007FF4DE43D030 0x00007FF4DE517770 0x00007FF4DE53D030 0x00800040 0x0000000000100000\nNULL\n1STSEGTOTAL    Total memory:                    17825792 (0x0000000001100000)\n1STSEGINUSE    Total memory in use:               894784 (0x00000000000DA740)\n1STSEGFREE     Total memory free:               16931008 (0x00000000010258C0)\nNULL\n1STSEGTYPE     Class Memory\nNULL           segment            start              alloc              end                type       size\n1STSEGMENT     0x00007FF4F03B5638 0x0000000001053D98 0x000000000105BD98 0x000000000105BD98 0x00010040 0x0000000000008000\n1STSEGMENT     0x00007FF4F03B5578 0x0000000001048188 0x0000000001050188 0x0000000001050188 0x00010040 0x0000000000008000\n...\nNULL\n1STSEGTOTAL    Total memory:                     3512520 (0x00000000003598C8)\n1STSEGINUSE    Total memory in use:              3433944 (0x00000000003465D8)\n1STSEGFREE     Total memory free:                  78576 (0x00000000000132F0)\nNULL\n1STSEGTYPE     JIT Code Cache\nNULL           segment            start              alloc              end                type       size\n1STSEGMENT     0x00007FF4F00961F8 0x00007FF4CE43D000 0x00007FF4CE445790 0x00007FF4DE43D000 0x00000068 0x0000000010000000\nNULL\n1STSEGTOTAL    Total memory:                   268435456 (0x0000000010000000)\n1STSEGINUSE    Total memory in use:                34704 (0x0000000000008790)\n1STSEGFREE     Total memory free:              268400752 (0x000000000FFF7870)\n1STSEGLIMIT    Allocation limit:               268435456 (0x0000000010000000)\nNULL\n1STSEGTYPE     JIT Data Cache\nNULL           segment            start              alloc              end                type       size\n1STSEGMENT     0x00007FF4F0096668 0x00007FF4CC553030 0x00007FF4CC753030 0x00007FF4CC753030 0x00000048 0x0000000000200000\nNULL\n1STSEGTOTAL    Total memory:                     2097152 (0x0000000000200000)\n1STSEGINUSE    Total memory in use:              2097152 (0x0000000000200000)\n1STSEGFREE     Total memory free:                      0 (0x0000000000000000)\n1STSEGLIMIT    Allocation limit:               402653184 (0x0000000018000000)\nNULL\n1STGCHTYPE     GC History\nNULL\n

In the example, the GC History (1STGCHTYPE) section is blank. This section is populated if a garbage collection cycle occurred in a VM that is being diagnosed with the trace facility.

"},{"location":"dump_javadump/#locks","title":"LOCKS","text":"

This section of the Java dump provides information about locks, which protect shared resources from being accessed by more than one entity at a time. The information is essential in a deadlock situation, where two threads attempt to synchronize on an object and lock an instance of a class. Precise information is recorded about the threads that are causing the problem, which enables you to identify the root cause.

The following example shows a typical LOCKS section, where no deadlocks existed at the time the dump was triggered. For clarity, the following example shows a shortened version of this section, where ... indicates that lines are removed:

NULL           ------------------------------------------------------------------------\n0SECTION       LOCKS subcomponent dump routine\nNULL           ===============================\nNULL\n1LKPOOLINFO    Monitor pool info:\n2LKPOOLTOTAL     Current total number of monitors: 3\nNULL\n1LKMONPOOLDUMP Monitor Pool Dump (flat & inflated object-monitors):\n2LKMONINUSE      sys_mon_t:0x00007FF4B0001D78 infl_mon_t: 0x00007FF4B0001DF8:\n3LKMONOBJECT       java/lang/ref/ReferenceQueue@0x00000000FFE26A10: <unowned>\n3LKNOTIFYQ            Waiting to be notified:\n3LKWAITNOTIFY            \"Common-Cleaner\" (J9VMThread:0x0000000000FD0100)\nNULL\n1LKREGMONDUMP  JVM System Monitor Dump (registered monitors):\n2LKREGMON          Thread global lock (0x00007FF4F0004FE8): <unowned>\n2LKREGMON          &(PPG_mem_mem32_subAllocHeapMem32.monitor) lock (0x00007FF4F0005098): <unowned>\n2LKREGMON          NLS hash table lock (0x00007FF4F0005148): <unowned>\n...\nNULL\n
"},{"location":"dump_javadump/#threads","title":"THREADS","text":"

The THREADS section of a Java dump file provides summary information about the VM thread pool and detailed information about Java threads, native threads, and stack traces. Understanding the content of this section can help you diagnose problems that are caused by blocked or waiting threads.

A Java thread runs on a native thread. Several lines are recorded for each Java thread in the Thread Details subsection, which include the following key pieces of information:

Java thread priorities are mapped to operating system priority values. Thread states are shown in the following table:

Thread state value Status Description R Runnable The thread is able to run CW Condition Wait The thread is waiting S Suspended The thread is suspended by another thread Z Zombie The thread is destroyed P Parked The thread is parked by java.util.concurrent B Blocked The thread is waiting to obtain a lock

For threads that are parked (P), blocked (B), or waiting (CW), an additional line (3XMTHREADBLOCK) is included in the output that shows what the thread is parked on, blocked on, or waiting for. For threads that are waiting for a class initialization lock (java/lang/J9VMInternals$ClassInitializationLock), this line includes the name of the thread that is currently working to progress the initialization of the class. You can use this information to diagnose deadlocks that are caused by class initialization, which might not be detected and reported in the LOCKS section.

For clarity, the following example shows a shortened version of a typical THREADS section, where ... indicates that lines are removed:

NULL           ------------------------------------------------------------------------\n0SECTION       THREADS subcomponent dump routine\nNULL           =================================\nNULL\n1XMPOOLINFO    JVM Thread pool info:\n2XMPOOLTOTAL       Current total number of pooled threads: 19\n2XMPOOLLIVE        Current total number of live threads: 18\n2XMPOOLDAEMON      Current total number of live daemon threads: 15\nNULL\n1XMTHDINFO     Thread Details\nNULL\n...\n3XMTHREADINFO      \"JIT Diagnostic Compilation Thread-007 Suspended\" J9VMThread:0x0000000000035200, omrthread_t:0x00007F3F8C0D02C8, java/lang/Thread:0x00000000FFF42120, state:R, prio=10\n3XMJAVALTHREAD            (java/lang/Thread getId:0x9, isDaemon:true)\n3XMJAVALTHRCCL            sun/misc/Launcher$AppClassLoader(0x00000000FFF3BF98)\n3XMTHREADINFO1            (native thread ID:0x618F, native priority:0xB, native policy:UNKNOWN, vmstate:CW, vm thread flags:0x00000081)\n3XMTHREADINFO2            (native stack address range from:0x00007F3F879C5000, to:0x00007F3F87AC5000, size:0x100000)\n3XMCPUTIME               CPU usage total: 0.052410771 secs, current category=\"JIT\"\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=0 (0x0)\n3XMTHREADINFO3           No Java callstack associated with this thread\n...\nNULL\n...\n3XMTHREADINFO      \"Class Initialization Thread 2\" J9VMThread:0x0000000000124D00, omrthread_t:0x00007F3F8C1494C8, java/lang/Thread:0x00000000FFF53EE8, state:CW, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x13, isDaemon:false)\n3XMJAVALTHRCCL            sun/misc/Launcher$AppClassLoader(0x00000000FFF3BF98)\n3XMTHREADINFO1            (native thread ID:0x6199, native priority:0x5, native policy:UNKNOWN, vmstate:CW, vm thread flags:0x00000181)\n3XMTHREADINFO2            (native stack address range from:0x00007F3F74AB4000, to:0x00007F3F74AF4000, size:0x40000)\n3XMCPUTIME               CPU usage total: 0.008712260 secs, current category=\"Application\"\n3XMTHREADBLOCK     Waiting on: java/lang/J9VMInternals$ClassInitializationLock@0x00000000FFF61C90 Owned by: <unowned> Initializing thread: \"Class Initialization Thread 1\"\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=4096 (0x1000)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at java/lang/Class.forNameImpl(Native Method)\n4XESTACKTRACE                at java/lang/Class.forName(Class.java:339)\n4XESTACKTRACE                at ClassInitLockBug$ClassInitThread.run(ClassInitLockBug.java:16)\n...\nNULL\n...\nNULL\n3XMTHREADINFO      \"Class Initialization Thread 1\" J9VMThread:0x0000000000124100, omrthread_t:0x00007F3F8C148F50, java/lang/Thread:0x00000000FFF53D80, state:CW, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x12, isDaemon:false)\n3XMJAVALTHRCCL            sun/misc/Launcher$AppClassLoader(0x00000000FFF3BF98)\n3XMTHREADINFO1            (native thread ID:0x6198, native priority:0x5, native policy:UNKNOWN, vmstate:CW, vm thread flags:0x00000481)\n3XMTHREADINFO2            (native stack address range from:0x00007F3F74AF5000, to:0x00007F3F74B35000, size:0x40000)\n3XMCPUTIME               CPU usage total: 0.010221701 secs, current category=\"Application\"\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=12736 (0x31C0)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at java/lang/Thread.sleepImpl(Native Method)\n4XESTACKTRACE                at java/lang/Thread.sleep(Thread.java:983)\n4XESTACKTRACE                at java/lang/Thread.sleep(Thread.java:966)\n4XESTACKTRACE                at TestClass.<clinit>(ClassInitLockBug.java:29)\n4XESTACKTRACE                at java/lang/Class.forNameImpl(Native Method)\n4XESTACKTRACE                at java/lang/Class.forName(Class.java:339)\n4XESTACKTRACE                at ClassInitLockBug$ClassInitThread.run(ClassInitLockBug.java:16)\n...\nNULL\n...\nNULL\n1XMTHDSUMMARY  Threads CPU Usage Summary\nNULL           =========================\nNULL\n1XMTHDCATINFO  Warning: to get more accurate CPU times for the GC, the option -XX:-ReduceCPUMonitorOverhead can be used. See the user guide for more information.\nNULL\n1XMTHDCATEGORY All JVM attached threads: 0.698865000 secs\n1XMTHDCATEGORY |\n2XMTHDCATEGORY +--System-JVM: 0.653723000 secs\n2XMTHDCATEGORY |  |\n3XMTHDCATEGORY |  +--GC: 0.047248000 secs\n2XMTHDCATEGORY |  |\n3XMTHDCATEGORY |  +--JIT: 0.512971000 secs\n1XMTHDCATEGORY |\n2XMTHDCATEGORY +--Application: 0.045142000 secs\n
"},{"location":"dump_javadump/#hooks","title":"HOOKS","text":"

This section shows internal VM event callbacks, which are used for diagnosing performance problems in the VM. Multiple hook interfaces are listed, which include their individual hook events.

The following example shows data for the J9VMHookInterface, including the total time for all previous events, the call site location (<source file>:<line number>), start time, and duration of the last callback and the longest callback (all times measured in microseconds). The hook data is reset after each Java dump.

NULL           ------------------------------------------------------------------------\nSECTION HOOK   subcomponent dump routine\nNULL           =========================\n1NOTE          These data are reset every time a javacore is taken\n1HKINTERFACE   MM_OMRHookInterface\nNULL           ------------------------------------------------------------------------\n1HKINTERFACE   MM_PrivateHookInterface\nNULL           ------------------------------------------------------------------------\n1HKINTERFACE   MM_HookInterface\nNULL           ------------------------------------------------------------------------\n1HKINTERFACE   J9VMHookInterface\nNULL           ------------------------------------------------------------------------\n2HKEVENTID     1\n3HKCALLCOUNT       1239\n3HKTOTALTIME       219564us\n3HKLAST            Last Callback\n4HKCALLSITE            trcengine.c:395\n4HKSTARTTIME           Start Time: 2019-10-18T00:15:14.664\n4HKDURATION            Duration : 16us\n3HKLONGST          Longest Callback\n4HKCALLSITE            trcengine.c:395\n4HKSTARTTIME           Start Time: 2019-10-18T21:28:34.895\n4HKDURATION            Duration : 5012us\nNULL\n...\n1HKINTERFACE   J9VMZipCachePoolHookInterface\nNULL           ------------------------------------------------------------------------\n1HKINTERFACE   J9JITHookInterface\nNULL           ------------------------------------------------------------------------\n2HKEVENTID     3\n3HKCALLCOUNT       3113\n3HKTOTALTIME       4904us\n3HKLAST            Last Callback\n4HKCALLSITE            common/mgmtinit.c:193\n4HKSTARTTIME           Start Time: 2019-10-18T16:04:15.320\n4HKDURATION            Duration : 3us\n3HKLONGST          Longest Callback\n4HKCALLSITE            common/mgmtinit.c:193\n4HKSTARTTIME           Start Time: 2019-10-18T16:37:17.633\n4HKDURATION            Duration : 27us\nNULL\n...\n
"},{"location":"dump_javadump/#shared-classes","title":"SHARED CLASSES","text":"

If the shared classes cache is enabled at run time, the information that is provided in a Java dump file describes settings that were used when creating the cache, together with summary information about the size and content of the cache.

In the following example, the shared classes cache was created with a Class Debug Area (-Xnolinenumbers=false). Byte code instrumentation (BCI) is enabled, which is the default, and VMs sharing the cache are allowed to store classpaths, which is also the default.

The Cache Summary shows a cache size (2SCLTEXTCSZ) of 16776608 bytes, with a soft maximum size (2SCLTEXTSMB) also of 16776608 bytes, which leaves 12691668 bytes of free space (2SCLTEXTFRB). The size of the Class Debug Area (2SCLTEXTDAS) is 1331200 bytes and only 11% of this space is used.

In the Cache Memory Status subsection, the line 2SCLTEXTCMDT indicates the name and location of the shared cache and cr indicates that the cache is a 64-bit compressed references cache.

NULL           ------------------------------------------------------------------------\n0SECTION       SHARED CLASSES subcomponent dump routine\nNULL           ========================================\nNULL\n1SCLTEXTCRTW   Cache Created With\nNULL           ------------------\nNULL\n2SCLTEXTXNL        -Xnolinenumbers       = false\n2SCLTEXTBCI        BCI Enabled           = true\n2SCLTEXTBCI        Restrict Classpaths   = false\nNULL\n1SCLTEXTCSUM   Cache Summary\nNULL           ------------------\nNULL\n2SCLTEXTNLC        No line number content                    = false\n2SCLTEXTLNC        Line number content                       = true\nNULL\n2SCLTEXTRCS        ROMClass start address                    = 0x00007F423061C000\n2SCLTEXTRCE        ROMClass end address                      = 0x00007F42307B9A28\n2SCLTEXTMSA        Metadata start address                    = 0x00007F42313D42FC\n2SCLTEXTCEA        Cache end address                         = 0x00007F4231600000\n2SCLTEXTRTF        Runtime flags                             = 0x00102001ECA6028B\n2SCLTEXTCGN        Cache generation                          = 35\nNULL\n2SCLTEXTCSZ        Cache size                                = 16776608\n2SCLTEXTSMB        Softmx bytes                              = 16776608\n2SCLTEXTFRB        Free bytes                                = 12691668\n2SCLTEXTRCB        ROMClass bytes                            = 1694248\n2SCLTEXTAOB        AOT code bytes                            = 0\n2SCLTEXTADB        AOT data bytes                            = 0\n2SCLTEXTAHB        AOT class hierarchy bytes                 = 32\n2SCLTEXTATB        AOT thunk bytes                           = 0\n2SCLTEXTARB        Reserved space for AOT bytes              = -1\n2SCLTEXTAMB        Maximum space for AOT bytes               = -1\n2SCLTEXTJHB        JIT hint bytes                            = 308\n2SCLTEXTJPB        JIT profile bytes                         = 2296\n2SCLTEXTJRB        Reserved space for JIT data bytes         = -1\n2SCLTEXTJMB        Maximum space for JIT data bytes          = -1\n2SCLTEXTNOB        Java Object bytes                         = 0\n2SCLTEXTZCB        Zip cache bytes                           = 919328\n2SCLTEXTSHB        Startup hint bytes                        = 0\n2SCLTEXTRWB        ReadWrite bytes                           = 114080\n2SCLTEXTJCB        JCL data bytes                            = 0\n2SCLTEXTBDA        Byte data bytes                           = 0\n2SCLTEXTMDA        Metadata bytes                            = 23448\n2SCLTEXTDAS        Class debug area size                     = 1331200\n2SCLTEXTDAU        Class debug area % used                   = 11%\n2SCLTEXTDAN        Class LineNumberTable bytes               = 156240\n2SCLTEXTDAV        Class LocalVariableTable bytes            = 0\nNULL\n2SCLTEXTNRC        Number ROMClasses                         = 595\n2SCLTEXTNAM        Number AOT Methods                        = 0\n2SCLTEXTNAD        Number AOT Data Entries                   = 0\n2SCLTEXTNAH        Number AOT Class Hierarchy                = 1\n2SCLTEXTNAT        Number AOT Thunks                         = 0\n2SCLTEXTNJH        Number JIT Hints                          = 14\n2SCLTEXTNJP        Number JIT Profiles                       = 20\n2SCLTEXTNCP        Number Classpaths                         = 1\n2SCLTEXTNUR        Number URLs                               = 0\n2SCLTEXTNTK        Number Tokens                             = 0\n2SCLTEXTNOJ        Number Java Objects                       = 0\n2SCLTEXTNZC        Number Zip Caches                         = 5\n2SCLTEXTNSH        Number Startup Hint Entries               = 0\n2SCLTEXTNJC        Number JCL Entries                        = 0\n2SCLTEXTNST        Number Stale classes                      = 0\n2SCLTEXTPST        Percent Stale classes                     = 0%\nNULL\n2SCLTEXTCPF        Cache is 24% full\nNULL\n1SCLTEXTCMST   Cache Memory Status\nNULL           ------------------\n1SCLTEXTCNTD       Cache Name                    Feature                  Memory type              Cache path\nNULL\n2SCLTEXTCMDT       sharedcc_doc-javacore         CR                       Memory mapped file       /tmp/javasharedresources/C290M4F1A64P_sharedcc_doc-javacore_G35\nNULL\n1SCLTEXTCMST   Cache Lock Status\nNULL           ------------------\n1SCLTEXTCNTD       Lock Name                     Lock type                TID owning lock\nNULL\n2SCLTEXTCWRL       Cache write lock              File lock                Unowned\n2SCLTEXTCRWL       Cache read/write lock         File lock                Unowned\nNULL\n

The following example shows information for a layered cache:

NULL           ------------------------------------------------------------------------\n0SECTION       SHARED CLASSES subcomponent dump routine\nNULL           ========================================\nNULL\n1SCLTEXTCSTL   Cache Statistics for Top Layer\nNULL\n1SCLTEXTCRTW       Cache Created With\nNULL               ------------------\nNULL\n2SCLTEXTXNL            -Xnolinenumbers       = false\n2SCLTEXTBCI            BCI Enabled           = true\n2SCLTEXTBCI            Restrict Classpaths   = false\nNULL\n1SCLTEXTCSUM       Cache Summary\nNULL               ------------------\nNULL\n2SCLTEXTNLC            No line number content                    = false\n2SCLTEXTLNC            Line number content                       = false\nNULL\n2SCLTEXTRCS            ROMClass start address                    = 0x00007F0EDB567000\n2SCLTEXTRCE            ROMClass end address                      = 0x00007F0EDB567000\n2SCLTEXTMSA            Metadata start address                    = 0x00007F0EDC40241C\n2SCLTEXTCEA            Cache end address                         = 0x00007F0EDC54B000\n2SCLTEXTRTF            Runtime flags                             = 0x80102001ECA602BB\n2SCLTEXTCGN            Cache generation                          = 41\n2SCLTEXTCLY            Cache layer                               = 1\nNULL\n2SCLTEXTCSZ            Cache size                                = 16776608\n2SCLTEXTSMB            Softmx bytes                              = 16776608\n2SCLTEXTFRB            Free bytes                                = 15315996\n2SCLTEXTARB            Reserved space for AOT bytes              = -1\n2SCLTEXTAMB            Maximum space for AOT bytes               = -1\n2SCLTEXTJRB            Reserved space for JIT data bytes         = -1\n2SCLTEXTJMB            Maximum space for JIT data bytes          = -1\n2SCLTEXTRWB            ReadWrite bytes                           = 114080\n2SCLTEXTDAS            Class debug area size                     = 1331200\n2SCLTEXTDAU            Class debug area % used                   = 0%\n2SCLTEXTDAN            Class LineNumberTable bytes               = 0\n2SCLTEXTDAV            Class LocalVariableTable bytes            = 0\nNULL\n2SCLTEXTCPF            Cache is 8% full\nNULL\n1SCLTEXTCMST       Cache Memory Status\nNULL               ------------------\n1SCLTEXTCNTD           Cache Name                    Feature                  Memory type              Cache path\nNULL\n2SCLTEXTCMDT           Cache1                        CR                       Memory mapped file       /tmp/javasharedresources/C290M4F1A64P_Cache1_G41L01\nNULL\n1SCLTEXTCMST       Cache Lock Status\nNULL               ------------------\n1SCLTEXTCNTD           Lock Name                     Lock type                TID owning lock\nNULL\n2SCLTEXTCWRL           Cache write lock              File lock                Unowned\n2SCLTEXTCRWL           Cache read/write lock         File lock                Unowned\nNULL\n1SCLTEXTCSAL   Cache Statistics for All Layers\nNULL\n2SCLTEXTRCB            ROMClass bytes                            = 1459040\n2SCLTEXTAOB            AOT code bytes                            = 57624\n2SCLTEXTADB            AOT data bytes                            = 272\n2SCLTEXTAHB            AOT class hierarchy bytes                 = 1840\n2SCLTEXTATB            AOT thunk bytes                           = 632\n2SCLTEXTJHB            JIT hint bytes                            = 484\n2SCLTEXTJPB            JIT profile bytes                         = 0\n2SCLTEXTNOB            Java Object bytes                         = 0\n2SCLTEXTZCB            Zip cache bytes                           = 1134016\n2SCLTEXTSHB            Startup hint bytes                        = 0\n2SCLTEXTJCB            JCL data bytes                            = 0\n2SCLTEXTBDA            Byte data bytes                           = 0\nNULL\n2SCLTEXTNRC            Number ROMClasses                         = 503\n2SCLTEXTNAM            Number AOT Methods                        = 16\n2SCLTEXTNAD            Number AOT Data Entries                   = 1\n2SCLTEXTNAH            Number AOT Class Hierarchy                = 28\n2SCLTEXTNAT            Number AOT Thunks                         = 11\n2SCLTEXTNJH            Number JIT Hints                          = 15\n2SCLTEXTNJP            Number JIT Profiles                       = 0\n2SCLTEXTNCP            Number Classpaths                         = 1\n2SCLTEXTNUR            Number URLs                               = 0\n2SCLTEXTNTK            Number Tokens                             = 0\n2SCLTEXTNOJ            Number Java Objects                       = 0\n2SCLTEXTNZC            Number Zip Caches                         = 21\n2SCLTEXTNSH            Number Startup Hint Entries               = 0\n2SCLTEXTNJC            Number JCL Entries                        = 0\n2SCLTEXTNST            Number Stale classes                      = 0\n2SCLTEXTPST            Percent Stale classes                     = 0%\n
"},{"location":"dump_javadump/#classes","title":"CLASSES","text":"

The classes section shows information about class loaders. The first part is a summary that records each available class loader (2CLTEXTCLLOADER) followed by the number of libraries and classes that it loaded. This information is followed by a more detailed list of libraries (1CLTEXTCLLIB) and classes (1CLTEXTCLLO) that are loaded.

In the example you can see that the java/lang/InternalAnonymousClassLoader loaded two classes, jdk/internal/loader/BuiltinClassLoader$$Lambda$2/00000000F03876A0(0x0000000001030F00) and jdk/internal/loader/BuiltinClassLoader$$Lambda$1/00000000F00D2460(0x0000000001018A00).

NULL           ------------------------------------------------------------------------\n0SECTION       CLASSES subcomponent dump routine\nNULL           =================================\n1CLTEXTCLLOS    Classloader summaries\n1CLTEXTCLLSS        12345678: 1=primordial,2=extension,3=shareable,4=middleware,5=system,6=trusted,7=application,8=delegating\n2CLTEXTCLLOADER     p---st-- Loader *System*(0x00000000FFE1D258)\n3CLNMBRLOADEDLIB        Number of loaded libraries 5\n3CLNMBRLOADEDCL         Number of loaded classes 638\n2CLTEXTCLLOADER     -x--st-- Loader jdk/internal/loader/ClassLoaders$PlatformClassLoader(0x00000000FFE1D4F0), Parent *none*(0x0000000000000000)\n3CLNMBRLOADEDLIB        Number of loaded libraries 0\n3CLNMBRLOADEDCL         Number of loaded classes 0\n2CLTEXTCLLOADER     ----st-- Loader java/lang/InternalAnonymousClassLoader(0x00000000FFE1DFD0), Parent *none*(0x0000000000000000)\n3CLNMBRLOADEDLIB        Number of loaded libraries 0\n3CLNMBRLOADEDCL         Number of loaded classes 2\n2CLTEXTCLLOADER     -----ta- Loader jdk/internal/loader/ClassLoaders$AppClassLoader(0x00000000FFE1DAD0), Parent jdk/internal/loader/ClassLoaders$PlatformClassLoader(0x00000000FFE1D4F0)\n3CLNMBRLOADEDLIB        Number of loaded libraries 0\n3CLNMBRLOADEDCL         Number of loaded classes 0\n1CLTEXTCLLIB    ClassLoader loaded libraries\n2CLTEXTCLLIB        Loader *System*(0x00000000FFE1D258)\n3CLTEXTLIB              /home/me/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-release/images/jdk/lib/compressedrefs/jclse9_29\n3CLTEXTLIB              /home/me/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-release/images/jdk/lib/java\n3CLTEXTLIB              /home/me/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-release/images/jdk/lib/compressedrefs/j9jit29\n3CLTEXTLIB              /home/me/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-release/images/jdk/lib/zip\n3CLTEXTLIB              /home/me/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-release/images/jdk/lib/nio\n1CLTEXTCLLOD    ClassLoader loaded classes\n2CLTEXTCLLOAD       Loader *System*(0x00000000FFE1D258)\n3CLTEXTCLASS            [Ljava/lang/Thread$State;(0x0000000001056400)\n...\n2CLTEXTCLLOAD       Loader jdk/internal/loader/ClassLoaders$PlatformClassLoader(0x00000000FFE1D4F0)\n2CLTEXTCLLOAD       Loader java/lang/InternalAnonymousClassLoader(0x00000000FFE1DFD0)\n3CLTEXTCLASS            jdk/internal/loader/BuiltinClassLoader$$Lambda$2/00000000F03876A0(0x0000000001030F00)\n3CLTEXTCLASS            jdk/internal/loader/BuiltinClassLoader$$Lambda$1/00000000F00D2460(0x0000000001018A00)\n2CLTEXTCLLOAD       Loader jdk/internal/loader/ClassLoaders$AppClassLoader(0x00000000FFE1DAD0)\n
"},{"location":"dump_javadump/#scenarios","title":"Scenarios","text":""},{"location":"dump_javadump/#general-protection-fault","title":"General Protection Fault","text":"

In this scenario, a Java application has crashed due to a General Protection Fault (GPF), automatically generating a Java dump file.

The first section of the file (TITLE) tells you that the GPF triggered the Java dump.

0SECTION       TITLE subcomponent dump routine\nNULL           ===============================\n1TICHARSET     UTF-8\n1TISIGINFO     Dump Event \"gpf\" (00002000) received\n1TIDATETIMEUTC Date: 2021/04/23 at 18:02:44:017 (UTC)\n1TIDATETIME    Date: 2021/04/23 at 14:02:44:017\n1TITIMEZONE    Timezone: UTC-4 (EDT)\n1TINANOTIME    System nanotime: 379202644260787\n1TIFILENAME    Javacore filename:    /home/test/JNICrasher/javacore.20210423.140244.29399.0002.txt\n1TIREQFLAGS    Request Flags: 0x81 (exclusive+preempt)\n1TIPREPSTATE   Prep State: 0x100 (trace_disabled)\n1TIPREPINFO    Exclusive VM access not taken: data may not be consistent across javacore sections\n

To troubleshoot this problem, you need to know which thread caused the GPF to occur. The thread that was running at the time of the crash is reported as the current thread in the THREADS section of the Java dump. Here is an extract from the THREADS section:

NULL           ------------------------------------------------------------------------\n0SECTION       THREADS subcomponent dump routine\nNULL           =================================\nNULL\n1XMPOOLINFO    JVM Thread pool info:\n2XMPOOLTOTAL       Current total number of pooled threads: 16\n2XMPOOLLIVE        Current total number of live threads: 15\n2XMPOOLDAEMON      Current total number of live daemon threads: 14\nNULL\n1XMCURTHDINFO  Current thread\n3XMTHREADINFO      \"main\" J9VMThread:0xB6B60E00, omrthread_t:0xB6B049D8, java/lang/Thread:0xB55444D0, state:R, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x1, isDaemon:false)\n3XMTHREADINFO1            (native thread ID:0x72D8, native priority:0x5, native policy:UNKNOWN, vmstate:R, vm thread flags:0x00000000)\n3XMTHREADINFO2            (native stack address range from:0xB6CE3000, to:0xB74E4000, size:0x801000)\n3XMCPUTIME               CPU usage total: 0.319865924 secs, current category=\"Application\"\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=778008 (0xBDF18)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at JNICrasher.doSomethingThatCrashes(Native Method)\n4XESTACKTRACE                at JNICrasher.main(JNICrasher.java:7)\n3XMTHREADINFO3           Native callstack:\n4XENATIVESTACK               (0xB6C6F663 [libj9prt29.so+0x3b663])\n4XENATIVESTACK               (0xB6C52F6E [libj9prt29.so+0x1ef6e])\n4XENATIVESTACK               (0xB6C6F1CE [libj9prt29.so+0x3b1ce])\n4XENATIVESTACK               (0xB6C6F2C6 [libj9prt29.so+0x3b2c6])\n4XENATIVESTACK               (0xB6C6ED93 [libj9prt29.so+0x3ad93])\n4XENATIVESTACK               (0xB6C52F6E [libj9prt29.so+0x1ef6e])\n4XENATIVESTACK               (0xB6C6ED07 [libj9prt29.so+0x3ad07])\n4XENATIVESTACK               (0xB6C6AA3D [libj9prt29.so+0x36a3d])\n4XENATIVESTACK               (0xB6C6C3A4 [libj9prt29.so+0x383a4])\n4XENATIVESTACK               (0xB667FA19 [libj9dmp29.so+0xfa19])\n4XENATIVESTACK               (0xB6C52F6E [libj9prt29.so+0x1ef6e])\n4XENATIVESTACK               (0xB66878CF [libj9dmp29.so+0x178cf])\n4XENATIVESTACK               (0xB6688083 [libj9dmp29.so+0x18083])\n4XENATIVESTACK               (0xB6C52F6E [libj9prt29.so+0x1ef6e])\n4XENATIVESTACK               (0xB6680C0D [libj9dmp29.so+0x10c0d])\n4XENATIVESTACK               (0xB667F9D7 [libj9dmp29.so+0xf9d7])\n4XENATIVESTACK               (0xB6C52F6E [libj9prt29.so+0x1ef6e])\n4XENATIVESTACK               (0xB668B02F [libj9dmp29.so+0x1b02f])\n4XENATIVESTACK               (0xB668B4D3 [libj9dmp29.so+0x1b4d3])\n4XENATIVESTACK               (0xB66740F1 [libj9dmp29.so+0x40f1])\n4XENATIVESTACK               (0xB66726FA [libj9dmp29.so+0x26fa])\n4XENATIVESTACK               (0xB6C52F6E [libj9prt29.so+0x1ef6e])\n4XENATIVESTACK               (0xB66726A9 [libj9dmp29.so+0x26a9])\n4XENATIVESTACK               (0xB6676AE4 [libj9dmp29.so+0x6ae4])\n4XENATIVESTACK               (0xB668D75A [libj9dmp29.so+0x1d75a])\n4XENATIVESTACK               (0xB6A28DD4 [libj9vm29.so+0x81dd4])\n4XENATIVESTACK               (0xB6C52F6E [libj9prt29.so+0x1ef6e])\n4XENATIVESTACK               (0xB6A289EE [libj9vm29.so+0x819ee])\n4XENATIVESTACK               (0xB6A29A40 [libj9vm29.so+0x82a40])\n4XENATIVESTACK               (0xB6C52B6A [libj9prt29.so+0x1eb6a])\n4XENATIVESTACK               __kernel_rt_sigreturn+0x0 (0xB7747410)\n4XENATIVESTACK               (0xB75330B6 [libffi29.so+0x50b6])\n4XENATIVESTACK               ffi_raw_call+0xad (0xB7531C53 [libffi29.so+0x3c53])\n4XENATIVESTACK               (0xB69BE4AB [libj9vm29.so+0x174ab])\n4XENATIVESTACK               (0xB6A665BC [libj9vm29.so+0xbf5bc])\n4XENATIVESTACK               (0xB6A15552 [libj9vm29.so+0x6e552])\n4XENATIVESTACK               (0xB6A30894 [libj9vm29.so+0x89894])\n4XENATIVESTACK               (0xB6A6F169 [libj9vm29.so+0xc8169])\n4XENATIVESTACK               (0xB6C52F6E [libj9prt29.so+0x1ef6e])\n4XENATIVESTACK               (0xB6A6F1FA [libj9vm29.so+0xc81fa])\n4XENATIVESTACK               (0xB6A30994 [libj9vm29.so+0x89994])\n4XENATIVESTACK               (0xB6A2CE4C [libj9vm29.so+0x85e4c])\n4XENATIVESTACK               (0xB770487D [libjli.so+0x787d])\n4XENATIVESTACK               (0xB7719F72 [libpthread.so.0+0x6f72])\n4XENATIVESTACK               clone+0x5e (0xB763543E [libc.so.6+0xee43e])\n

The extract tells you that the current thread was java/lang/Thread, and information is provided about the Java call stack and native call stack (3XMTHREADINFO3) at the point at which the crash occurred. To simulate a crash caused by a bug in an application, this example calls a JNI method whose native implementation causes a crash. The Java call stack shows the call to the JNI native method (JNIcrasher), and the native call stack shows the point of failure. In this example, the native call stack does not include any function names to help you isolate the error in the native code. You can get this information from a system dump, which is usually produced alongside the Java dump. Open the system dump with the Dump viewer and use the info thread command to print the Java and native stack for the current thread.

The next time you run the application, you can use the -XX:+ShowNativeStackSymbols=all command line option to display the corresponding function names in the native call stack.

4XENATIVESTACK               protectedBacktrace+0x12 (0x00007F3F9213E312 [libj9prt29.so+0x25312])\n4XENATIVESTACK               omrsig_protect+0x1e3 (0x00007F3F92142AD3 [libj9prt29.so+0x29ad3])\n4XENATIVESTACK               omrintrospect_backtrace_thread_raw+0xbf (0x00007F3F9213E80F [libj9prt29.so+0x2580f])\n4XENATIVESTACK               omrsig_protect+0x1e3 (0x00007F3F92142AD3 [libj9prt29.so+0x29ad3])\n4XENATIVESTACK               omrintrospect_backtrace_thread+0x70 (0x00007F3F9213E1D0 [libj9prt29.so+0x251d0])\n4XENATIVESTACK               setup_native_thread+0x1d2 (0x00007F3F9213F652 [libj9prt29.so+0x26652])\n4XENATIVESTACK               omrintrospect_threads_startDo_with_signal+0x474 (0x00007F3F921403F4 [libj9prt29.so+0x273f4])\n4XENATIVESTACK               omrsig_protect+0x1e3 (0x00007F3F92142AD3 [libj9prt29.so+0x29ad3])\n
"},{"location":"dump_javadump/#java-outofmemoryerror","title":"Java OutOfMemoryError","text":"

In this scenario, the Java heap runs out of memory, causing an OutOfMemoryError, which automatically generates a Java dump file.

The first section of the file (TITLE) tells you that a systhrow event triggered the Java dump as a result of an OOM (java/lang/OutOfMemoryError) for Java heap space.

0SECTION       TITLE subcomponent dump routine\nNULL           ===============================\n1TICHARSET     UTF-8\n1TISIGINFO     Dump Event \"systhrow\" (00040000) Detail \"java/lang/OutOfMemoryError\" \"Java heap space\" received\n1TIDATETIMEUTC Date: 2021/04/23 at 18:02:44:017 (UTC)\n1TIDATETIME    Date: 2021/04/23 at 14:02:44:017\n1TITIMEZONE    Timezone: UTC-4 (EDT)\n1TINANOTIME    System nanotime: 379202644260787\n1TIFILENAME    Javacore filename:    /home/cheesemp/test/javacore.20210423.140244.18885.0003.txt\n1TIREQFLAGS    Request Flags: 0x81 (exclusive+preempt)\n1TIPREPSTATE   Prep State: 0x104 (exclusive_vm_access+trace_disabled)\n

The MEMINFO section records how much memory is allocated to the Java heap (1STHEAPTYPE Object Memory), how much is in use, and how much is free. Solving your problem might be as simple as setting a larger heap size when you start your application.

If you don't know what size the Java heap was set to, you might find that information in the ENVINFO section, which records the command-line options that were used when the application started. Look or search for the 1CIUSERARGS UserArgs: string and review the entries that are recorded for all lines that start 2CIUSERARG. The Java heap size is set by the -Xmx option. If the size has not been set on the command line by -Xmx, the default value applies, which you can find in Default Settings.

In this scenario, the solution to the problem is not an adjustment to the Java heap size. Here is the MEMINFO section:

0SECTION       MEMINFO subcomponent dump routine\nNULL           =================================\nNULL\n1STHEAPTYPE    Object Memory\nNULL           id         start      end        size       space/region\n1STHEAPSPACE   0xB6B49D20     --         --         --     Generational\n1STHEAPREGION  0xB6B4A078 0x95750000 0xB5470000 0x1FD20000 Generational/Tenured Region\n1STHEAPREGION  0xB6B49F10 0xB5470000 0xB54C0000 0x00050000 Generational/Nursery Region\n1STHEAPREGION  0xB6B49DA8 0xB54C0000 0xB5750000 0x00290000 Generational/Nursery Region\nNULL\n1STHEAPTOTAL   Total memory:         536870912 (0x20000000)\n1STHEAPINUSE   Total memory in use:  302603160 (0x12095B98)\n1STHEAPFREE    Total memory free:    234267752 (0x0DF6A468)\n

The output shows that only 56% of the Java heap is in use, so this suggests that the application is trying to do something suboptimal. To investigate further, you need to work out which thread was the current thread when the OOM occurred to see what it was trying to do. As in the previous scenario, you can find the current thread in the THREADS section. Here is an extract from the output:

0SECTION       THREADS subcomponent dump routine\nNULL           =================================\nNULL\n1XMPOOLINFO    JVM Thread pool info:\n2XMPOOLTOTAL       Current total number of pooled threads: 16\n2XMPOOLLIVE        Current total number of live threads: 16\n2XMPOOLDAEMON      Current total number of live daemon threads: 15\nNULL\n1XMCURTHDINFO  Current thread\n3XMTHREADINFO      \"main\" J9VMThread:0xB6B60C00, omrthread_t:0xB6B049D8, java/lang/Thread:0x95764520, state:R, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x1, isDaemon:false)\n3XMTHREADINFO1            (native thread ID:0x49C6, native priority:0x5, native policy:UNKNOWN, vmstate:R, vm thread flags:0x00001020)\n3XMTHREADINFO2            (native stack address range from:0xB6CB5000, to:0xB74B6000, size:0x801000)\n3XMCPUTIME               CPU usage total: 8.537823831 secs, current category=\"Application\"\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=0 (0x0)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at java/lang/StringBuffer.ensureCapacityImpl(StringBuffer.java:696)\n4XESTACKTRACE                at java/lang/StringBuffer.append(StringBuffer.java:486(Compiled Code))\n5XESTACKTRACE                   (entered lock: java/lang/StringBuffer@0x957645B8, entry count: 1)\n4XESTACKTRACE                at java/lang/StringBuffer.append(StringBuffer.java:428(Compiled Code))\n4XESTACKTRACE                at HeapBreaker.main(HeapBreaker.java:34(Compiled Code))\n3XMTHREADINFO3           Native callstack:\n4XENATIVESTACK               (0xB6C535B3 [libj9prt29.so+0x3b5b3])\n4XENATIVESTACK               (0xB6C36F3E [libj9prt29.so+0x1ef3e])\n4XENATIVESTACK               (0xB6C5311E [libj9prt29.so+0x3b11e])\n4XENATIVESTACK               (0xB6C53216 [libj9prt29.so+0x3b216])\n4XENATIVESTACK               (0xB6C52CE3 [libj9prt29.so+0x3ace3])\n4XENATIVESTACK               (0xB6C36F3E [libj9prt29.so+0x1ef3e])\n4XENATIVESTACK               (0xB6C52C57 [libj9prt29.so+0x3ac57])\n4XENATIVESTACK               (0xB6C4E9CD [libj9prt29.so+0x369cd])\n4XENATIVESTACK               (0xB6C502FA [libj9prt29.so+0x382fa])\n

To simulate a Java OutOfMemoryError, this example application repeatedly appends characters to a StringBuffer object in an infinite loop. The Java call stack shows the HeapBreaker.main method appending characters (java/lang/StringGuffer.append) until the method java/lang/StringBuffer.ensureCapacityImpl() throws the OutOfMemoryError.

StringBuffer objects are wrappers for character arrays (char[]) and when the capacity of the underlying array is reached, the contents are automatically copied into a new, larger array. The new array is created in the StringBuffer.ensureCapacity() method, which more or less doubles the size of the old array. In this scenario, the array takes up all the remaining space in the Java heap.

The MEMINFO section of the Java dump file can also tell you when an unexpectedly large allocation request causes an OOM. Look for the GC History (1STGCHTYPE) section, which details allocation requests that trigger GC activity. In the sample output you can see that a large allocation request (requestedbytes=603979784) triggered a global GC. When the GC could not free up sufficient space in the heap to satisfy the request, the allocation failure generated the OOM.

1STGCHTYPE     GC History\n3STHSTTYPE     14:29:29:580239000 GMT j9mm.101 -   J9AllocateIndexableObject() returning NULL! 0 bytes requested for object of class B6BBC300 from memory space 'Generational' id=B6B49D20\n3STHSTTYPE     14:29:29:579916000 GMT j9mm.134 -   Allocation failure end: newspace=2686912/3014656 oldspace=231597224/533856256 loa=5338112/5338112\n3STHSTTYPE     14:29:29:579905000 GMT j9mm.470 -   Allocation failure cycle end: newspace=2686912/3014656 oldspace=231597224/533856256 loa=5338112/5338112\n3STHSTTYPE     14:29:29:579859000 GMT j9mm.475 -   GlobalGC end: workstackoverflow=0 overflowcount=0 memory=234284136/536870912\n3STHSTTYPE     14:29:29:579807000 GMT j9mm.90 -   GlobalGC collect complete\n3STHSTTYPE     14:29:29:579776000 GMT j9mm.137 -   Compact end: bytesmoved=301989896\n3STHSTTYPE     14:29:29:313899000 GMT j9mm.136 -   Compact start: reason=compact to meet allocation\n3STHSTTYPE     14:29:29:313555000 GMT j9mm.57 -   Sweep end\n3STHSTTYPE     14:29:29:310772000 GMT j9mm.56 -   Sweep start\n3STHSTTYPE     14:29:29:310765000 GMT j9mm.94 -   Class unloading end: classloadersunloaded=0 classesunloaded=0\n3STHSTTYPE     14:29:29:310753000 GMT j9mm.60 -   Class unloading start\n3STHSTTYPE     14:29:29:310750000 GMT j9mm.55 -   Mark end\n3STHSTTYPE     14:29:29:306013000 GMT j9mm.54 -   Mark start\n3STHSTTYPE     14:29:29:305957000 GMT j9mm.474 -   GlobalGC start: globalcount=9\n3STHSTTYPE     14:29:29:305888000 GMT j9mm.475 -   GlobalGC end: workstackoverflow=0 overflowcount=0 memory=234284136/536870912\n3STHSTTYPE     14:29:29:305837000 GMT j9mm.90 -   GlobalGC collect complete\n3STHSTTYPE     14:29:29:305808000 GMT j9mm.137 -   Compact end: bytesmoved=189784\n3STHSTTYPE     14:29:29:298042000 GMT j9mm.136 -   Compact start: reason=compact to meet allocation\n3STHSTTYPE     14:29:29:297695000 GMT j9mm.57 -   Sweep end\n3STHSTTYPE     14:29:29:291696000 GMT j9mm.56 -   Sweep start\n3STHSTTYPE     14:29:29:291692000 GMT j9mm.55 -   Mark end\n3STHSTTYPE     14:29:29:284994000 GMT j9mm.54 -   Mark start\n3STHSTTYPE     14:29:29:284941000 GMT j9mm.474 -   GlobalGC start: globalcount=8\n3STHSTTYPE     14:29:29:284916000 GMT j9mm.135 -   Exclusive access: exclusiveaccessms=0.016 meanexclusiveaccessms=0.016 threads=0 lastthreadtid=0xB6B61100 beatenbyotherthread=0\n3STHSTTYPE     14:29:29:284914000 GMT j9mm.469 -   Allocation failure cycle start: newspace=2678784/3014656 oldspace=80601248/533856256 loa=5338112/5338112 requestedbytes=603979784\n3STHSTTYPE     14:29:29:284893000 GMT j9mm.470 -   Allocation failure cycle end: newspace=2678784/3014656 oldspace=80601248/533856256 loa=5338112/5338112\n3STHSTTYPE     14:29:29:284858000 GMT j9mm.560 -   LocalGC end: rememberedsetoverflow=0 causedrememberedsetoverflow=0 scancacheoverflow=0 failedflipcount=0 failedflipbytes=0 failedtenurecount=0 failedtenurebytes=0 flipcount=2 flipbytes=64 newspace=2678784/3014656 oldspace=80601248/533856256 loa=5338112/5338112 tenureage=0\n3STHSTTYPE     14:29:29:284140000 GMT j9mm.140 -   Tilt ratio: 89\n3STHSTTYPE     14:29:29:283160000 GMT j9mm.64 -   LocalGC start: globalcount=8 scavengecount=335 weakrefs=0 soft=0 phantom=0 finalizers=0\n3STHSTTYPE     14:29:29:283123000 GMT j9mm.135 -   Exclusive access: exclusiveaccessms=0.016 meanexclusiveaccessms=0.016 threads=0 lastthreadtid=0xB6B61100 beatenbyotherthread=0\n3STHSTTYPE     14:29:29:283120000 GMT j9mm.469 -   Allocation failure cycle start: newspace=753616/3014656 oldspace=80601248/533856256 loa=5338112/5338112 requestedbytes=603979784\n3STHSTTYPE     14:29:29:283117000 GMT j9mm.133 -   Allocation failure start: newspace=753616/3014656 oldspace=80601248/533856256 loa=5338112/5338112 requestedbytes=603979784\n3STHSTTYPE     14:29:29:269762000 GMT j9mm.134 -   Allocation failure end: newspace=2686928/3014656 oldspace=80601248/533856256 loa=5338112/5338112\n3STHSTTYPE     14:29:29:269751000 GMT j9mm.470 -   Allocation failure cycle end: newspace=2686976/3014656 oldspace=80601248/533856256 loa=5338112/5338112\n3STHSTTYPE     14:29:29:269718000 GMT j9mm.560 -   LocalGC end: rememberedsetoverflow=0 causedrememberedsetoverflow=0 scancacheoverflow=0 failedflipcount=0 failedflipbytes=0 failedtenurecount=0 failedtenurebytes=0 flipcount=0 flipbytes=0 newspace=2686976/3014656 oldspace=80601248/533856256 loa=5338112/5338112 tenureage=0\n3STHSTTYPE     14:29:29:268981000 GMT j9mm.140 -   Tilt ratio: 89\n3STHSTTYPE     14:29:29:268007000 GMT j9mm.64 -   LocalGC start: globalcount=8 scavengecount=334 weakrefs=0 soft=0 phantom=0 finalizers=0\n3STHSTTYPE     14:29:29:267969000 GMT j9mm.135 -   Exclusive access: exclusiveaccessms=0.016 meanexclusiveaccessms=0.016 threads=0 lastthreadtid=0xB6B61100 beatenbyotherthread=0\n3STHSTTYPE     14:29:29:267966000 GMT j9mm.469 -   Allocation failure cycle start: newspace=0/3014656 oldspace=80601248/533856256 loa=5338112/5338112 requestedbytes=48\n3STHSTTYPE     14:29:29:267963000 GMT j9mm.133 -   Allocation failure start: newspace=0/3014656 oldspace=80601248/533856256 loa=5338112/5338112 requestedbytes=48\n3STHSTTYPE     14:29:29:249015000 GMT j9mm.134 -   Allocation failure end: newspace=2686928/3014656 oldspace=80601248/533856256 loa=5338112/5338112\n3STHSTTYPE     14:29:29:249003000 GMT j9mm.470 -   Allocation failure cycle end: newspace=2686976/3014656 oldspace=80601248/533856256 loa=5338112/5338112\n3STHSTTYPE     14:29:29:248971000 GMT j9mm.560 -   LocalGC end: rememberedsetoverflow=0 causedrememberedsetoverflow=0 scancacheoverflow=0 failedflipcount=0 failedflipbytes=0 failedtenurecount=0 failedtenurebytes=0 flipcount=0 flipbytes=0 newspace=2686976/3014656 oldspace=80601248/533856256 loa=5338112/5338112 tenureage=0\n

Although the Java code that was used in this scenario deliberately triggered an OutOfMemoryError in a pronounced way, similar allocation issues can and do occur when dealing with large data sets such as XML files.

The next step in diagnosing the problem is to open the system dump that gets generated automatically when an OutOfMemoryError occurs. Open the dump with the Eclipse Memory Analyzer\u2122 tool (MAT) and search for the StringBuffer object, which should provide further clues about what went wrong. A common example is seeing the same String duplicated over and over again, which might indicate that code is stuck in a loop.

Note: If you want to use MAT to analyze your system dump, you must install the Diagnostic Tool Framework for Java (DTFJ) plug-in in the Eclipse IDE. Select the following menu items:

Help > Install New Software > Work with \"IBM Diagnostic Tool Framework for Java\" >\n

If, unlike the previous scenario, you receive an OutOfMemoryError and the MEMINFO section shows that there is very little space left on the Java heap, the current thread information is typically not important. The current thread is simply the thread that happened to be current when the space ran out. In this situation, you might want to increase your Java heap size. For help with this task, see How to do heap sizing.

"},{"location":"dump_javadump/#native-outofmemoryerror","title":"Native OutOfMemoryError","text":"

In this scenario, the VM runs out of native memory. Native memory is memory that is used by the VM for storing all virtualized resources and data that it needs for VM operations. Native memory that is available to the VM process is limited by the operating system. The native memory available to the VM might also be subject to additional limits imposed by the operating system, for example Unix ulimits.

When a NativeOutOfMemoryError occurs, a Java dump is generated by default. The first section of the file (TITLE) tells you that a systhrow event triggered the Java dump as a result of an OOM (java/lang/OutOfMemoryError) for native memory.

0SECTION       TITLE subcomponent dump routine\nNULL           ===============================\n1TICHARSET     UTF-8\n1TISIGINFO     Dump Event \"systhrow\" (00040000) Detail \"java/lang/OutOfMemoryError\" \"native memory exhausted\" received\n1TIDATETIMEUTC Date: 2021/04/23 at 18:02:44:017 (UTC)\n1TIDATETIME    Date: 2021/04/23 at 14:02:44:017\n1TITIMEZONE    Timezone: UTC-4 (EDT)\n1TINANOTIME    System nanotime: 379202644260787\n1TIFILENAME    Javacore filename:    /home/cheesemp/test/javacore.20210423.140244.19708.0003.txt\n1TIREQFLAGS    Request Flags: 0x81 (exclusive+preempt)\n1TIPREPSTATE   Prep State: 0x104 (exclusive_vm_access+trace_disabled)\n

Sometimes, the current thread is responsible for causing the NativeOutOfMemoryError. Information about the current thread can be found in the THREADS section, as shown in the following output.

0SECTION       THREADS subcomponent dump routine\nNULL           =================================\nNULL\n1XMPOOLINFO    JVM Thread pool info:\n2XMPOOLTOTAL       Current total number of pooled threads: 16\n2XMPOOLLIVE        Current total number of live threads: 16\n2XMPOOLDAEMON      Current total number of live daemon threads: 15\nNULL\n1XMCURTHDINFO  Current thread\n3XMTHREADINFO      \"main\" J9VMThread:0xB6C60C00, omrthread_t:0xB6C049D8, java/lang/Thread:0xB55E3C10, state:R, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x1, isDaemon:false)\n3XMTHREADINFO1            (native thread ID:0x4CFD, native priority:0x5, native policy:UNKNOWN, vmstate:R, vm thread flags:0x00001020)\n3XMTHREADINFO2            (native stack address range from:0xB6D4E000, to:0xB754F000, size:0x801000)\n3XMCPUTIME               CPU usage total: 3.654896026 secs, current category=\"Application\"\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=0 (0x0)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at sun/misc/Unsafe.allocateDBBMemory(Native Method)\n4XESTACKTRACE                at java/nio/DirectByteBuffer.<init>(DirectByteBuffer.java:127(Compiled Code))\n4XESTACKTRACE                at java/nio/ByteBuffer.allocateDirect(ByteBuffer.java:311)\n4XESTACKTRACE                at NativeHeapBreaker.main(NativeHeapBreaker.java:9)\n3XMTHREADINFO3           Native callstack:\n4XENATIVESTACK               (0xB6A9F5B3 [libj9prt29.so+0x3b5b3])\n...\n4XENATIVESTACK               (0xB582CC9C [libjclse7b_29.so+0x40c9c])\n4XENATIVESTACK               Java_sun_misc_Unsafe_allocateDBBMemory+0x88 (0xB5827F6B [libjclse7b_29.so+0x3bf6b])\n4XENATIVESTACK               (0x94A2084A [<unknown>+0x0])\n4XENATIVESTACK               (0xB6B2538B [libj9vm29.so+0x6c38b])\n4XENATIVESTACK               (0xB6B4074C [libj9vm29.so+0x8774c])\n4XENATIVESTACK               (0xB6B7F299 [libj9vm29.so+0xc6299])\n4XENATIVESTACK               (0xB6A82F3E [libj9prt29.so+0x1ef3e])\n4XENATIVESTACK               (0xB6B7F32A [libj9vm29.so+0xc632a])\n4XENATIVESTACK               (0xB6B4084C [libj9vm29.so+0x8784c])\n4XENATIVESTACK               (0xB6B3CD0C [libj9vm29.so+0x83d0c])\n4XENATIVESTACK               (0xB776F87D [libjli.so+0x787d])\n4XENATIVESTACK               (0xB7784F72 [libpthread.so.0+0x6f72])\n4XENATIVESTACK               clone+0x5e (0xB76A043E [libc.so.6+0xee43e])\n

For clarity in the Native callstack output, ... indicates that some lines are removed.

The Java call stack shows the transition from Java to native code (sun/misc/Unsafe.allocateDBBMemory(Native Method)), indicating a request for Direct Byte Buffer (DBB) storage. DBB storage is backed by native memory, with the Java heap containing only a reference to the native heap buffer. In this scenario, DBB storage is the likely culprit for this NativeOutOfMemoryError.

The next step is to investigate the NATIVEMEMINFO section of the Java dump file, which reports the amount of memory used by the JRE process, broken down into component areas.

0SECTION       NATIVEMEMINFO subcomponent dump routine\nNULL           =================================\n0MEMUSER\n1MEMUSER       JRE: 3,166,386,688 bytes / 4388 allocations\n1MEMUSER       |\n2MEMUSER       +--VM: 563,176,824 bytes / 1518 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Classes: 3,104,416 bytes / 120 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Memory Manager (GC): 548,181,888 bytes / 398 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Java Heap: 536,932,352 bytes / 1 allocation\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Other: 11,249,536 bytes / 397 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Threads: 10,817,120 bytes / 147 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Java Stack: 115,584 bytes / 16 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Native Stack: 10,616,832 bytes / 17 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Other: 84,704 bytes / 114 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Trace: 163,688 bytes / 268 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--JVMTI: 17,320 bytes / 13 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--JNI: 23,296 bytes / 55 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Port Library: 8,576 bytes / 74 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Other: 860,520 bytes / 443 allocations\n1MEMUSER       |\n2MEMUSER       +--JIT: 3,744,728 bytes / 122 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--JIT Code Cache: 2,097,152 bytes / 1 allocation\n2MEMUSER       |  |\n3MEMUSER       |  +--JIT Data Cache: 524,336 bytes / 1 allocation\n2MEMUSER       |  |\n3MEMUSER       |  +--Other: 1,123,240 bytes / 120 allocations\n1MEMUSER       |\n2MEMUSER       +--Class Libraries: 2,599,463,024 bytes / 2732 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Harmony Class Libraries: 1,024 bytes / 1 allocation\n2MEMUSER       |  |\n3MEMUSER       |  +--VM Class Libraries: 2,599,462,000 bytes / 2731 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--sun.misc.Unsafe: 2,598,510,480 bytes / 2484 allocations\n4MEMUSER       |  |  |  |\n5MEMUSER       |  |  |  +--Direct Byte Buffers: 2,598,510,480 bytes / 2484 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Other: 951,520 bytes / 247 allocations\n1MEMUSER       |\n2MEMUSER       +--Unknown: 2,112 bytes / 16 allocations\nNULL\n

In the VM Class Libraries section, the amount of memory allocated for Direct Byte Buffers is shown. Because the NativeOutOfMemoryError was received on a small 32-bit system, a value of 2,598,510,480 bytes indicates that the operating system has run out of memory. On a larger UNIX\u00ae system, the process might have run out of memory because of the ulimit setting. Increasing the value for ulimit might avoid the error, which you can do temporarily by setting ulimit -f unlimited in your current session.

The theoretical maximum size for a 32-bit process is the size of the 32-bit address space, which is 4 GB. On most operating systems, a portion of the address space for each process is used by the kernel, such that the real limit for 32-bit processes is actually significantly less than 4 GB. As a result, running out of native memory with a 32-bit VM is quite common.

The same 4 GB limit is also important if you are using a 64-bit VM with compressed references. In compressed references mode, all references to objects, classes, threads, and monitors are represented by 32-bit values for performance reasons, so these structures can be allocated only at 32-bit addresses. However, the operating system might place other allocations within this 4 GB of address space, and if this area becomes sufficiently full or fragmented, the VM throws a native NativeOutOfMemoryError error. These errors typically occur when the VM tries to create a new thread or load a class. The Current Thread History section should contain more information about what the thread was doing at the VM level when the NativeOutOfMemoryError error occurred.

You can usually avoid this type of problem by using the -Xmcrs option to reserve a contiguous area of memory within the lowest 4 GB of memory at VM startup.

Another common cause of a NativeOutOfMemoryError is when an application loads duplicate classes. Classes are allocated outside of the Java heap in native memory. If the value reported for Classes in the NATIVEMEMINFO section is very large, duplicate classes might be the cause of your problem. The Eclipse Memory Analyzer tool (MAT) can tell you if you have duplicate classes by using the Class Loader Explorer feature. Because a system dump is automatically generated as well as a Java dump in response to a NativeOutOfMemoryError, simply open the system dump in MAT to continue your diagnosis.

"},{"location":"dump_javadump/#deadlock","title":"Deadlock","text":"

Deadlocks occur when two threads attempt to synchronize on an object and lock an instance of a class. When this happens, your application stops responding and hangs. Generating a Java dump file will quickly tell you whether you have a deadlock situation. Trigger the Java dump by sending a SIGQUIT signal (kill -3) to the VM.

The VM can detect the most common types of deadlock scenario involving Java monitors. If this type of deadlock is detected, information is provided in the LOCKS section. More complex deadlocks, including those that involve a mixture of native mutexes and Java monitors, are not detected.

Here is the output from the code that was used to cause a common deadlock scenario:

NULL\n1LKDEADLOCK    Deadlock detected !!!\nNULL           ---------------------\nNULL\n2LKDEADLOCKTHR  Thread \"Worker Thread 2\" (0x94501D00)\n3LKDEADLOCKWTR    is waiting for:\n4LKDEADLOCKMON      sys_mon_t:0x08C2B344 infl_mon_t: 0x08C2B384:\n4LKDEADLOCKOBJ      java/lang/Object@0xB5666698\n3LKDEADLOCKOWN    which is owned by:\n2LKDEADLOCKTHR  Thread \"Worker Thread 3\" (0x94507500)\n3LKDEADLOCKWTR    which is waiting for:\n4LKDEADLOCKMON      sys_mon_t:0x08C2B3A0 infl_mon_t: 0x08C2B3E0:\n4LKDEADLOCKOBJ      java/lang/Object@0xB5666678\n3LKDEADLOCKOWN    which is owned by:\n2LKDEADLOCKTHR  Thread \"Worker Thread 1\" (0x92A3EC00)\n3LKDEADLOCKWTR    which is waiting for:\n4LKDEADLOCKMON      sys_mon_t:0x08C2B2E8 infl_mon_t: 0x08C2B328:\n4LKDEADLOCKOBJ      java/lang/Object@0xB5666688\n3LKDEADLOCKOWN    which is owned by:\n2LKDEADLOCKTHR  Thread \"Worker Thread 2\" (0x94501D00)\n

This output tells you that Worker Thread 2 is waiting for Worker Thread 3, which is waiting for Worker Thread 1. Because Worker Thread 1 is also waiting for Worker Thread 2, there is a deadlock. The next place to look is the output for Java and native stacks, in the THREADS section. By looking at the stack for each of these worker threads, you can trace the problem back to specific lines in your application code.

In this example, you can see from the following output that for all worker threads, the stack traces (4XESTACKTRACE/5XESTACKTRACE) indicate a problem in line 35 of the application DeadLockTest.java:

3XMTHREADINFO      \"Worker Thread 1\" J9VMThread:0x92A3EC00, omrthread_t:0x92A3C2B0, java/lang/Thread:0xB5666778, state:B, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x13, isDaemon:false)\n3XMTHREADINFO1            (native thread ID:0x52CF, native priority:0x5, native policy:UNKNOWN, vmstate:B, vm thread flags:0x00000201)\n3XMTHREADINFO2            (native stack address range from:0x9297E000, to:0x929BF000, size:0x41000)\n3XMCPUTIME               CPU usage total: 0.004365543 secs, current category=\"Application\"\n3XMTHREADBLOCK     Blocked on: java/lang/Object@0xB5666688 Owned by: \"Worker Thread 2\" (J9VMThread:0x94501D00, java/lang/Thread:0xB56668D0)\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=0 (0x0)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at WorkerThread.run(DeadLockTest.java:35)\n5XESTACKTRACE                   (entered lock: java/lang/Object@0xB5666678, entry count: 1)\n...\n3XMTHREADINFO      \"Worker Thread 2\" J9VMThread:0x94501D00, omrthread_t:0x92A3C8F0, java/lang/Thread:0xB56668D0, state:B, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x14, isDaemon:false)\n3XMTHREADINFO1            (native thread ID:0x52D0, native priority:0x5, native policy:UNKNOWN, vmstate:B, vm thread flags:0x00000201)\n3XMTHREADINFO2            (native stack address range from:0x946BF000, to:0x94700000, size:0x41000)\n3XMCPUTIME               CPU usage total: 0.004555580 secs, current category=\"Application\"\n3XMTHREADBLOCK     Blocked on: java/lang/Object@0xB5666698 Owned by: \"Worker Thread 3\" (J9VMThread:0x94507500, java/lang/Thread:0xB5666A18)\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=0 (0x0)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at WorkerThread.run(DeadLockTest.java:35)\n5XESTACKTRACE                   (entered lock: java/lang/Object@0xB5666688, entry count: 1)\n...\n3XMTHREADINFO      \"Worker Thread 3\" J9VMThread:0x94507500, omrthread_t:0x92A3CC10, java/lang/Thread:0xB5666A18, state:B, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x15, isDaemon:false)\n3XMTHREADINFO1            (native thread ID:0x52D1, native priority:0x5, native policy:UNKNOWN, vmstate:B, vm thread flags:0x00000201)\n3XMTHREADINFO2            (native stack address range from:0x9467E000, to:0x946BF000, size:0x41000)\n3XMCPUTIME               CPU usage total: 0.003657010 secs, current category=\"Application\"\n3XMTHREADBLOCK     Blocked on: java/lang/Object@0xB5666678 Owned by: \"Worker Thread 1\" (J9VMThread:0x92A3EC00, java/lang/Thread:0xB5666778)\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=0 (0x0)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at WorkerThread.run(DeadLockTest.java:35)\n5XESTACKTRACE                   (entered lock: java/lang/Object@0xB5666698, entry count: 1)\n
"},{"location":"dump_javadump/#hang","title":"Hang","text":"

An application can hang for a number of reasons but the most common cause is excessive global garbage collection (GC) activity, where your application is repeatedly paused because your Java heap has almost run out of memory. You can identify this problem by looking at verbose GC output. Collect this output by specifying the -verbose:gc option.

Deadlock situations can also manifest themselves as hangs. For more information on diagnosing this type of problem from a Java dump, see the deadlock scenario.

If you have eliminated verbose GC activity and deadlocks, another common hang scenario involves threads that compete and wait for Java object locks. This type of problem can usually be diagnosed by examining a Java dump. The simplest hang scenario involving Java object locks is where a thread acquires a lock that other threads are waiting for, but it doesn't release the lock for some reason.

The first place to look in the Java dump output is the LOCKS section. This section lists all the monitors and shows which threads have acquired a lock and which threads are waiting. If the hang is caused by a thread not releasing a lock that other threads need, you can see a list of waiting threads in the output.

In this example scenario, the Java dump LOCKS section shows that Worker Thread 0 (3LKMONOBJECT) has acquired a lock and there are 19 other worker threads waiting to obtain the lock.

NULL           ------------------------------------------------------------------------\n0SECTION       LOCKS subcomponent dump routine\nNULL           ===============================\nNULL\n1LKPOOLINFO    Monitor pool info:\n2LKPOOLTOTAL     Current total number of monitors: 1\nNULL\n1LKMONPOOLDUMP Monitor Pool Dump (flat & inflated object-monitors):\n2LKMONINUSE      sys_mon_t:0x92711200 infl_mon_t: 0x92711240:\n3LKMONOBJECT       java/lang/Object@0xB56658D8: Flat locked by \"Worker Thread 0\" (J9VMThread:0x92A3EC00), entry count 1\n3LKWAITERQ            Waiting to enter:\n3LKWAITER                \"Worker Thread 1\" (J9VMThread:0x92703F00)\n3LKWAITER                \"Worker Thread 2\" (J9VMThread:0x92709C00)\n3LKWAITER                \"Worker Thread 3\" (J9VMThread:0x92710A00)\n3LKWAITER                \"Worker Thread 4\" (J9VMThread:0x92717F00)\n3LKWAITER                \"Worker Thread 5\" (J9VMThread:0x9271DC00)\n3LKWAITER                \"Worker Thread 6\" (J9VMThread:0x92723A00)\n3LKWAITER                \"Worker Thread 7\" (J9VMThread:0x92729800)\n3LKWAITER                \"Worker Thread 8\" (J9VMThread:0x92733700)\n3LKWAITER                \"Worker Thread 9\" (J9VMThread:0x92739400)\n3LKWAITER                \"Worker Thread 10\" (J9VMThread:0x92740200)\n3LKWAITER                \"Worker Thread 11\" (J9VMThread:0x92748100)\n3LKWAITER                \"Worker Thread 12\" (J9VMThread:0x9274DF00)\n3LKWAITER                \"Worker Thread 13\" (J9VMThread:0x92754D00)\n3LKWAITER                \"Worker Thread 14\" (J9VMThread:0x9275AA00)\n3LKWAITER                \"Worker Thread 15\" (J9VMThread:0x92760800)\n3LKWAITER                \"Worker Thread 16\" (J9VMThread:0x92766600)\n3LKWAITER                \"Worker Thread 17\" (J9VMThread:0x9276C300)\n3LKWAITER                \"Worker Thread 18\" (J9VMThread:0x92773100)\n3LKWAITER                \"Worker Thread 19\" (J9VMThread:0x92778F00)\nNULL\n

The next step is to determine why Worker Thread 0 is not releasing the lock. The best place to start is the stack trace for this thread, which you can find by searching on the thread name or J9VMThread ID in the THREADS section.

The following extract shows the details for \"Worker Thread 0\" (J9VMThread:0x92A3EC00):

NULL\n3XMTHREADINFO      \"Worker Thread 0\" J9VMThread:0x92A3EC00, omrthread_t:0x92A3C280, java/lang/Thread:0xB56668B8, state:CW, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x13, isDaemon:false)\n3XMTHREADINFO1            (native thread ID:0x511F, native priority:0x5, native policy:UNKNOWN, vmstate:CW, vm thread flags:0x00000401)\n3XMTHREADINFO2            (native stack address range from:0x9297E000, to:0x929BF000, size:0x41000)\n3XMCPUTIME               CPU usage total: 0.000211878 secs, current category=\"Application\"\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=0 (0x0)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at java/lang/Thread.sleep(Native Method)\n4XESTACKTRACE                at java/lang/Thread.sleep(Thread.java:941)\n4XESTACKTRACE                at WorkerThread.doWork(HangTest.java:37)\n4XESTACKTRACE                at WorkerThread.run(HangTest.java:31)\n5XESTACKTRACE                   (entered lock: java/lang/Object@0xB56658D8, entry count: 1)\n

In the last line of this output, you can see where the thread acquired the lock. Working up from this line, you can see that WorkerThread.run was called, which in turn called WorkerThread.doWork. The stack shows that the thread then entered a call to java/lang/Thread.sleep in HangTest.java on line 37, which is preventing the thread from completing its work and releasing the lock. In this example, the sleep call was added to induce a hang, but in real-world scenarios the cause could be any blocking operation, such as reading from an input stream or socket. Another possibility is that the thread is waiting for another lock owned by yet another thread.

It is important to remember that each Java dump represents a single snapshot in time. You should generate at least three Java dumps separated by a short pause, for example 30 seconds, and compare the output. This comparison tells you whether the threads involved are stuck in a fixed state or whether they are moving.

In this example, the threads do not move and the investigation needs to focus on the logic in WorkerThread.doWork to understand why Worker Thread 0 entered the java/lang/Thread.sleep call.

Another common scenario is where each Java dump shows a number of threads waiting for a lock owned by another thread, but the list of waiting threads and the lock-owning thread change over time. In this case, the cause is likely to be a bottleneck caused by thread contention, where the threads are continually competing for the same lock. In severe cases, the lock is held only for a small amount of time but there are lots of threads trying to obtain it. Because more time is spent handling the lock and scheduling the thread than executing application code, the degradation in performance is manifested as a hang. Thread contention is usually caused by an application design problem. You can use a similar approach to the one used in this scenario to determine which lines of code are responsible for the contention.

"},{"location":"dump_systemdump/","title":"System dump","text":""},{"location":"dump_systemdump/#system-dump","title":"System dump","text":"

System dumps, often known as core dumps, are platform-specific and contain a raw binary dump of the process memory. This type of dump has a complete copy of the Java heap, including the contents of all Java objects in the application.

"},{"location":"dump_systemdump/#obtaining-system-dumps","title":"Obtaining system dumps","text":"

System dumps are produced in response to specific events. To discover which events generate a dump, run the -Xdump:what command. The following output captures the information shown for a system dump:

-Xdump:system:\n    events=gpf+abort+traceassert+corruptcache,\n    label=/home/user/core.%Y%m%d.%H%M%S.%pid.%seq.dmp,\n    range=1..0,\n    priority=999,\n    request=serial\n

This output shows that events such as a general protection fault (gpf) or native abort() call can trigger a system dump. For more information about controlling the behavior of dump agents, see Dump agents.

"},{"location":"dump_systemdump/#enabling-a-full-system-dump-aix-linux-and-macos","title":"Enabling a full system dump (AIX, Linux, and macOS)","text":"

If you require a system dump that contains details of all the native threads that are running, you must change the resource limits for your operating system. Otherwise, the native thread details that are stored in the dump are only for the native thread that was running when the VM ended.

  1. Set the system resource limits by running the following commands: ulimit -c unlimited; ulimit -n unlimited; ulimit -d unlimited; ulimit -f unlimited;

    Where:

  1. For AIX systems, use the system management interface tool (SMIT) to enable a full CORE dump that is not a pre-430 style CORE dump. You can also set this configuration with the following command line option:

chdev -l sys0 -a fullcore='true' -a pre430core='false'

"},{"location":"dump_systemdump/#analyzing-a-system-dump","title":"Analyzing a system dump","text":"

To examine a system dump you can use the Dump viewer (jdmpview), a platform-specific debugging tool, or the Eclipse Memory Analyzer\u2122 tool (MAT).

If you want to use MAT to analyze your system dump, you must install the Diagnostic Tool Framework for Java (DTFJ) plug-in in the Eclipse IDE. Select the following menu items:

Help > Install New Software > Work with \"IBM Diagnostic Tool Framework for Java\" > IBM Monitoring and Diagnostic Tools > Diagnostic Tool Framework for Java   \n
"},{"location":"enhancementstoopenjdksecurity/","title":"Enhancements to OpenJDK security","text":""},{"location":"enhancementstoopenjdksecurity/#enhancements-to-openjdk-security","title":"Enhancements to OpenJDK security","text":"

Eclipse OpenJ9\u2122 includes the following enhancements to the OpenJDK security components.

"},{"location":"enhancementstoopenjdksecurity/#support-for-pkcs11-token-labels","title":"Support for PKCS#11 token labels","text":"

(z/OS\u00ae and Linux on IBM Z\u00ae only)

On z/OS and Linux on IBM Z, OpenJ9 supports the use of an extra attribute, tokenlabel, in the SunPKCS11 configuration file. Use this attribute to assign a label to a PKCS#11 token.

The number of slots and their order depend on the number of tokens in the ICSF token database, their values, and the SAF CRYPTOZ class protection profiles that are currently defined. The ICSF PKCS#11 support ensures that a token resides in its current slot only for the duration of a PKCS#11 session (if the token is not deleted). If you restart an application, or tokens are created or removed, the token might move to a different slot. An application that uses the slot or slotListIndex attributes might fail if it doesn\u2019t first check which slot the token is in. You can avoid this issue by using the tokenlabel attribute instead.

You can specify only one of the attributes - slot, slotListIndex, or tokenlabel. If you do not specify any of these attributes, the default behavior is that the slotListIndex attribute is set to 0.

Note: To configure an ICSF token, add the ICSF token to openCryptoki by using the pkcsicsf utility. The openCryptoki library loads the tokens that provide hardware or software specific support for cryptographic functions. An openCryptoki token uses an RSA key pair of public and private keys to encrypt and decrypt data. You must have openCryptoki version 3.22 or later to generate RSA private keys with the ICA, CCA and EP11 tokens that openCryptoki supports.

For more information about the SunPKCS11 configuration file, see PKCS#11 Reference Guide.

"},{"location":"env_var/","title":"Environment variables","text":""},{"location":"env_var/#environment-variables","title":"Environment variables","text":"

Although the Eclipse OpenJ9\u2122 virtual machine (VM) recognizes many environment variables, most are superseded by command-line arguments. Use command-line arguments rather than environment variables, which are retained only for compatibility.

Note: Environment variables are overridden by command-line arguments.

"},{"location":"env_var/#finding-and-setting-environment-variables","title":"Finding and setting environment variables","text":"

To show the current environment, run:

To show a particular environment variable, run:

Use values exactly as shown in the documentation. The names of environment variables are case-sensitive in AIX, Linux, macOS, and z/OS.

To set the environment variable LOGIN_NAME to Fred, run:

These variables are set only for the current shell or command-line session.

If you are setting multiple values for an environment variable in a list:

"},{"location":"env_var/#general-options","title":"General options","text":"

General VM environment variables are shown in the following table:

Environment\u00a0variable Usage information OPENJ9_JAVA_COMMAND_LINE This variable is set by the VM after it starts. Using this variable, you can find the command-line parameters set when the VM started. See -XX:[+|-]OpenJ9CommandLineEnv for more information. OPENJ9_JAVA_OPTIONS=<option> Set this variable to store default Java options, including -X, -D, or -verbose:gc style options. For example, -Xms256m -Djava.compiler. Any options set are overridden by equivalent options that are specified when Java is started. This variable does not support certain options, see the list in -Xoptionsfile. If you specify the name of a trace output file either directly, or indirectly, by using a properties file, the output file might be accidentally overwritten if you run utilities such as the trace formatter, dump extractor, or dump viewer. To avoid this problem, add %d, %p or %t to the trace file names. See -Xtrace:output. Note: The equivalent to OPENJ9_JAVA_OPTIONS, IBM_JAVA_OPTIONS is deprecated and will be removed in a future release. JAVA_FONTS=<list of directories> Set this environment variable to specify the font directory. Setting this variable is equivalent to setting the property java.awt.fonts on Windows operating systems, and sun.java2d.fontpath on other operating systems. _JAVA_OPTIONS=<option> Set this variable to add Java options to the end of the command line. Supported options and trace file issues are the same as for OPENJ9_JAVA_OPTIONS."},{"location":"env_var/#dump-agent-options","title":"Dump agent options","text":"

The preferred mechanism for controlling the production of dumps is by using the -Xdump option. However, these legacy environment variables are preserved and can still be used. The following table describes dump agent options:

Environment Variable Usage Information JAVA_DUMP_OPTS Used to control the conditions under which dumps are produced.

If you set agents for a condition by using the JAVA_DUMP_OPTS environment variable, default dump agents for that condition are disabled; however, any -Xdump options that are specified on the command line are used.

The JAVA_DUMP_OPTS environment variable uses the following syntax:

JAVA_DUMP_OPTS=\"ON<condition>(<agent>[<count>],<agent>[<count>]),\nON<condition>(<agent>[<count>],...),...)\"\n

Where:

JAVA_DUMP_OPTS is parsed by taking the leftmost occurrence of each condition, so duplicates are ignored. The following setting produces a system dump for the first error condition only:

ONERROR(SYSDUMP[1]),ONERROR(JAVADUMP)\n

Also, the ONANYSIGNAL condition is parsed before all others, so

ONINTERRUPT(NONE),ONANYSIGNAL(SYSDUMP)\n

has the same effect as

ONANYSIGNAL(SYSDUMP),ONINTERRUPT(NONE)\n

If the JAVA_DUMP_TOOL environment variable is set, that variable is assumed to specify a valid executable name and is parsed for replaceable fields, such as %pid. If %pid is detected in the string, the string is replaced with the VM's own process ID. The tool that is specified by JAVA_DUMP_TOOL is run after any system dump or heap dump is taken, before anything else.

The dump settings are applied in the following order. Settings later in the list take precedence:

  1. Default VM dump behavior.
  2. -Xdump command-line options that specify -Xdump:<type>:defaults, see OpenJ9 default options.
  3. DISABLE_JAVADUMP, IBM_HEAPDUMP, and IBM_HEAP_DUMP environment variables.
  4. IBM_JAVADUMP_OUTOFMEMORY and IBM_HEAPDUMP_OUTOFMEMORY environment variables.
  5. JAVA_DUMP_OPTS environment variable.
  6. Remaining -Xdump command-line options.

Setting JAVA_DUMP_OPTS affects only those conditions that you specify. Actions on other conditions are unchanged.

"},{"location":"env_var/#signal-mapping","title":"Signal mapping","text":"

When setting the JAVA_DUMP_OPTS environment variable, the mapping of operating system signals to the \"condition\" is shown in the following table:

Condition z/OS Windows Linux, macOS, and AIX EXCEPTION SIGTRAP, SIGILL, SIGSEGV, SIGFPE, SIGBUS, SIGSYS, SIGXFSV SIGILL, SIGSEGV, SIGFPE SIGTRAP, SIGILL, SIGSEGV, SIGFPE, SIGBUS, SIGXFSV INTERRUPT SIGINT, SIGTERM, SIGHUP SIGINT, SIGTERM SIGINT, SIGTERM, SIGHUP ERROR SIGABRT SIGABRT SIGABRT DUMP SIGQUIT SIGBREAK SIGQUIT"},{"location":"env_var/#java-dump-options","title":"Java dump options","text":"

The preferred mechanism for controlling the production of Java dumps is by using the -Xdump:java option. However, these legacy environment variables are preserved and can still be used.

Environment Variable Usage Information DISABLE_JAVADUMP=[TRUE|FALSE] Setting DISABLE_JAVADUMP to TRUE is the equivalent of using -Xdump:java:none and stops the default production of Java dumps. IBM_JAVACOREDIR=<directory> The default location into which the Java dump is written. On z/OS, the _CEE_DMPTARG environment variable is used instead. IBM_JAVADUMP_OUTOFMEMORY=[TRUE|FALSE] By setting this environment variable to FALSE, you disable Java dumps for an out-of-memory exception. When not set, a Java dump is generated when an out-of-memory exception is thrown but not caught and handled by the application. Set to TRUE to generate a dump when an out-of-memory exception is thrown, even if it is handled by the application. Set to FALSE to disable Java dumps for an out-of-memory exception. TMPDIR=<directory> This variable specifies an alternative temporary directory. This directory is used only when Java dumps and Heap dumps cannot be written to their target directories, or the current working directory. The default is /tmp (C:\\temp for Windows).

Note: You can use the dump agent JAVA_DUMP_OPTS variable to control the conditions under which Java dumps are produced.

"},{"location":"env_var/#heap-dump-options","title":"Heap dump options","text":"

The preferred mechanism for controlling the production of Java dumps is by using the -Xdump:heap option. However, these legacy environment variables are preserved and can still be used.

Environment Variable Usage Information IBM_HEAPDUMP=[TRUE|FALSE] Setting this option to TRUE enables heap dump production by using signals. IBM_HEAP_DUMP=[TRUE|FALSE] Setting this option to TRUE enables heap dump production by using signals. IBM_HEAPDUMPDIR=<directory> The default location into which the heap dump is written. On z/OS, the _CEE_DMPTARG environment variable is used instead. IBM_HEAPDUMP_OUTOFMEMORY=[TRUE|FALSE] Controls the generation of a heap dump when an out-of-memory exception is thrown. When not set, a heap dump is generated when an out-of-memory exception is thrown but not caught and handled by the application. Set to TRUE to generate a dump when an out-of-memory exception is thrown, even if it is handled by the application. Set to FALSE to disable heap dump for an out-of-memory exception. IBM_JAVA_HEAPDUMP_TEST Use this environment variable to cause the VM to generate both PHD and text versions of heap dumps. Equivalent to opts=PHD+CLASSIC on the -Xdump:heap option. IBM_JAVA_HEAPDUMP_TEXT Use this environment variable to cause the VM to generate a text (human readable) Heap dump. Equivalent to opts=CLASSIC on the -Xdump:heap option. TMPDIR=<directory> This variable specifies an alternative temporary directory. This directory is used only when Java dumps and heap dumps cannot be written to their target directories, or the current working directory. The default is /tmp (C:\\temp for Windows).

Note: You can use the dump agent JAVA_DUMP_OPTS variable to control the conditions under which Heap dumps are produced.

"},{"location":"env_var/#other-diagnostic-options","title":"Other diagnostic options","text":"

The following table lists other environment variables that can be set for diagnostic purposes:

Environment variable Usage Instructions IBM_COREDIR=<directory> Set this variable to specify an alternative location for system dumps, JIT dumps, and snap trace. On z/OS, _CEE_DMPTARG is used instead for snap trace, and transaction dumps are written to TSO according to JAVA_DUMP_TDUMP_PATTERN. On Linux and macOS, the dump is written to the directory that is specified directory by the operating system before being moved to the specified location. IBM_JAVA_ABEND_ON_FAILURE=Y (z/OS only) This setting tells the Java launcher to mark the Task Control Block (TCB) with an abend code if the OpenJ9 VM fails to load or is terminated by an uncaught exception. By default, the Java launcher does not mark the TCB. JAVA_DUMP_TDUMP_PATTERN=<string> (z/OS only) The specified <string> is passed to IEATDUMP to use as the data/set name for the Transaction Dump. The default <string> is %uid.JVM.TDUMP.%job.D%y%m%d.T%H%M%S (31-bit) or %uid.JVM.%job.D%y%m%d.T%H%M%S.X&amp;DS (64-bit), where %uid is found from the C code fragment shown in Notes. JAVA_THREAD_MODEL=<string> <string> can be defined as one of the following values: NATIVE (all threads are created as _MEDIUM_WEIGHT), HEAVY (all threads are created as _HEAVY_WEIGHT), MEDIUM (same as NATIVE), or NULL. The default is NATIVE. IBM_XE_COE_NAME=<value> Set this variable to generate a system dump when the specified exception occurs. The value that is supplied is the package description of the exception; for example, java/lang/InternalError. A Signal 11 is followed by a JVMXE message and then the VM ends. JAVA_PLUGIN_TRACE=TRUE When this variable is set to TRUE or 1, a Java plug-in trace is produced for the session when an application runs. Traces are produced from both the Java and Native layer. By default, this variable is set to FALSE, so that a Java plug-in trace is not produced.

Notes: C code fragment to discover %uid for JAVA_DUMP_TDUMP_PATTERN=<string>:

pwd = getpwuid(getuid());\npwd->pw_name;\n
"},{"location":"env_var/#deprecated-jit-options","title":"Deprecated JIT options","text":"

The following table describes deprecated environment variables for the JIT compiler:

Environment Variable Usage Information IBM_MIXED_MODE_THRESHOLD Use -Xjit:count=<value> instead of this variable. JAVA_COMPILER Use -Djava.compiler=<value> instead of this variable."},{"location":"gc/","title":"GC policies","text":""},{"location":"gc/#garbage-collection-policies","title":"Garbage collection policies","text":"

Eclipse OpenJ9\u2122 provides several garbage collection (GC) policies that are designed around different application workloads and service level agreements. Each GC policy consists of a set of characteristics and features that aim to optimize one or more performance aspects of a running application. These performance aspects include application throughput, memory footprint, average pause times, worst-case pause times, and startup time.

Different policies require a Java heap that is configured in different ways in order to achieve different goals. The simplest configuration consists of a single area of memory, often referred to as a flat heap. Other configurations divide the heap into different areas or regions, which might contain objects of different ages (generations) or sizes.

A GC cycle is a repeatable process that involves a set of GC operations. These operations process all or parts of the Java heap to complete a discrete function and are discussed in more detail in GC operations.

GC policies use different GC cycles to manage different aspects of the heap. For example, the gencon policy runs a partial GC cycle on the nursery area of the heap to complete a scavenge operation. At other times, gencon also runs a global GC cycle on the entire Java heap to complete mark and sweep (and optionally compact) operations.

GC cycles might be divided into increments that run over a period of time to reduce maximum pause times. These increments might involve stop-the-world (STW) pauses that must halt application threads to give certain GC operations exclusive access to the Java heap. Alternatively, increments might include GC operations that can run concurrently with application processing.

The following table shows the heap configuration and the GC cycles and operations used by different policies:

Policy Heap configuration GC cycles / operations gencon Two areas: nursery and tenure Two generation groups: new/older Global GC cycle: concurrent mark-sweep operations, optionally followed by a compact operation Partial GC cycle: STW scavenge operation or concurrent scavenge operation (if optionally enabled) balanced Multiple regions of equal size Multiple generations Global GC mark cycle: incremental concurrent mark operation (global mark phase) Partial GC cycle: STW copy forward operation and optional mark, sweep, or compact operations optavgpause One area: flat One generation Global GC cycle: concurrent mark-sweep operations, optionally followed by a compact operation optthruput One area: flat One generation Global GC cycle: STW mark-sweep operations, optionally followed by a compact operation metronome Multiple regions by size class One generation Global GC cycle: incremental STW mark-sweep operation in small interruptible steps nogc One area: flat No GC cycles

Note: All OpenJ9 GC policies support compressed references on 64-bit platforms, which compresses heap pointers to 32 bits if the total heap size does not exceed the theoretical upper bound of 64 GB. Applications that require more heap space can select any heap size within the bounds imposed by the operating system and available system RAM, without using compressed references. For more information, see compressed references.

"},{"location":"gc/#policy-selection-and-tuning","title":"Policy selection and tuning","text":"

The default policy is the Generational Concurrent (gencon) GC policy, which suits a broad spectrum of applications. Choosing a different GC policy should be guided by the application dynamics and an observation of how the application interacts with the heap during startup and at steady state. To help with this analysis, all OpenJ9 GC policies are instrumented to collect a wide range of GC-related metric data for reporting in a GC log file.

To enable GC logging for the OpenJ9 Java runtime, include the -verbose:gc option on the command line. By default, this option prints output to stderr but you can send the output to a log file by using -Xverbosegclog. You can then visualize the output by loading the GC log into the Garbage Collector and Memory Visualizer (GCMV) plug-in for the Eclipse IDE. OpenJ9 Java GC logs can also be analyzed by some online services, such as GCEasy.

The following sections provide more information about each policy and when you might choose it for your application. To select a GC policy other than gencon, specify the -Xgcpolicy option on the command line. To adjust the initial and maximum size of the Java heap, use the -Xms and -Xmx command line options. For generational GC policies, you can also set the -Xmn, -Xmns, and -Xmnx options.

"},{"location":"gc/#gencon-policy-default","title":"gencon policy (default)","text":"

The Generational Concurrent GC policy (-Xgcpolicy:gencon) is probably best suited if you have a transactional application, with many short-lived objects. This policy aims to minimize GC pause times without compromising throughput. This is the default policy employed by the VM, so if you want to use it you don't need to specify it on the command line when you start your application.

If your application requires the allocation of objects of very different sizes and liveness on the Java heap, you might experience heap fragmentation, which in turn might lead to global heap compaction. In these circumstances, the Balanced GC policy might be more appropriate.

"},{"location":"gc/#gc-processing","title":"GC processing","text":"

With the gencon policy, the Java heap is divided into two main areas, the nursery area, where new objects are created and the tenure area, where objects are moved if they have reached tenure age.

The nursery area is subdivided into two further areas, the allocate space and the survivor space. A partial GC cycle that involves a GC scavenge operation is used to reclaim memory from the nursery area. This process is illustrated in the following diagram, which shows a sequence of four main events:

  1. Objects are created in the allocate space.
  2. The allocate space is full.
  3. A local GC scavenge process runs and reachable objects are either evacuated (copied) into the survivor space or into the tenure area if they have reached tenure age. Any objects that can't be reached are left untouched and subsequently cleared.
  4. The allocate and survivor spaces swap roles. The original survivor space becomes the allocate space where new objects are created, and the original allocate space becomes the survivor space ready for the next local GC scavenge process.

The relative sizes of the allocate and survivor spaces are dynamically adjusted by a technique called tilting. When the nursery area is first created, it is evenly divided between the allocate and survivor spaces. If, after a GC scavenge operation runs, the amount of space required for the survivor area is comparatively small, the boundary between the two spaces is adjusted by tilting. For example, if the survivor space requires only 10% of the nursery area, the tilt ratio is adjusted to give 90% of the nursery area to the allocate space. With more space available for new objects, the frequency of scavenge cycles is reduced.

The tenure age of an object is determined by the VM and reflects the number of times that an object has been copied between the allocate space and the survivor space. The age is in the range 1 - 14 and is adjusted dynamically by the VM depending on the object survival rate at particular ages. For example, if an object has a tenure age of 5, it has been copied backwards and forwards between allocate and survivor spaces five times. If the VM sets a tenure age of 5 based on the percentage of space remaining in the nursery area, the next scavenge moves the object from the nursery to the tenure area. You can set an initial tenure age with the -Xgc:scvTenureAge option. You can also prevent the VM dynamically adjusting the tenure age by setting the Xgc:scvNoAdaptiveTenure option so that the initial age is maintained throughout the run time of the VM.

Within the tenure area, new objects are allocated into the small object area (SOA), which is illustrated in the earlier diagram (see item 3). A large object area (LOA) is set aside for objects greater than 64 KB that cannot be allocated into the SOA to minimize fragmentation. The LOA is allocated by default but is reduced and removed after a few GC cycles if it isn't populated. To prevent the creation of an LOA, you can specify the -Xnoloa option on the command line when you start your application. When the tenure area is close to full a global GC cycle is triggered.

The partial GC cycle (scavenge) reduces pause times by frequently reclaiming memory in the nursery area which, for a transactional application with many short-lived objects, has the most recyclable space. While most of the objects stay in the nursery area after the scavenge operation is complete, a small fraction are moved to the tenure area. Over time the tenure area might become full. So, whilst a partial GC cycle is operating on the nursery area, a concurrent global GC cycle also runs alongside normal program execution to mark and remove unreachable objects from the tenure area. These two GC approaches combine to provide a good trade-off between shorter pause times and consistent throughput.

"},{"location":"gc/#concurrent-scavenge","title":"Concurrent Scavenge","text":"

A special mode of the gencon policy is known as Concurrent Scavenge. This mode aims to further reduce the average time spent in STW pauses by collecting garbage from the nursery area in parallel with running application threads. Whilst aiming to reduce the average time, this mode does not improve the worst case pause time when compared to running gencon without Concurrent Scavenge enabled.

To enable Concurrent Scavenge, see -Xgc:concurrentScavenge.

This mode can be enabled with hardware-based support and software-based support:

More information about Concurrent Scavenge mode can be found in the blog post Concurrent Scavenge Garbage Collection Policy.

"},{"location":"gc/#balanced-policy","title":"balanced policy","text":"

(64-bit only)

The Balanced GC policy (-Xgcpolicy:balanced) evens out pause times and reduces the overhead of some of the costlier operations that are typically associated with garbage collection, such as compaction and class unloading. The Java heap is divided into a large number of regions (1,000 - 2,000), which are managed individually by an incremental generational collector to reduce the maximum pause time on large heaps and increase the efficiency of garbage collection. The aim of the policy is to avoid global garbage collections by matching object allocation and survival rates.

"},{"location":"gc/#when-to-use","title":"When to use","text":"

The Balanced policy might be a good alternative for applications that experience unacceptable pause times with gencon.

However, even though pause times are typically evened out across GC operations, actual pause times are affected by object allocation rates, object survival rates, and fragmentation levels within the heap, and cannot therefore be bound to a certain maximum nor can a certain utilization level be guaranteed.

"},{"location":"gc/#gc-processing_1","title":"GC processing","text":"

During VM startup, the GC divides the heap memory into regions of equal size. These regions remain static for the lifetime of the VM and are the basic unit of garbage collection and allocation operations. For example, when the heap is expanded or contracted, the memory committed or released corresponds to a certain number of regions. Although the Java heap is a contiguous range of memory addresses, any region within that range can be committed or released from a pool as required. This enables the Balanced GC to contract the heap more dynamically and aggressively than other garbage collectors, which typically require the committed portion of the heap to be contiguous.

Regions impose a maximum object size. Objects are always allocated within the bounds of a single region and are never permitted to span regions. The region size is always a power of two; for example, 512 KB, 1 MB, and so on (where KB is 210 bytes and MB is 220 bytes). The region size is selected at startup based on the maximum heap size. The collector chooses the smallest power of two which will result in less than 2048 regions, with a minimum region size of 512 KB. Except for small heaps (less than about 512 MB) the VM aims to have between 1024 and 2047 regions.

Object ages are tracked for each region with a maximum of 24 possible generations. The following diagram illustrates the structure of the object heap:

The eden space is a set of regions of age 0, which contain the newest objects allocated. The size of the eden space is determined by the number of regions that it contains. When the region count for the eden space reaches a predetermined threshold (taxation threshold), a partial GC cycle runs to reduce the number of used regions, typically by using a copy forward operation. Empty regions can then be assigned to the eden space from the pool. In specific cases, mark and compact operations might be used, for example, when there are not enough free survivor regions available. The partial GC cycle is a STW operation that always includes the eden space, but might include older regions. Objects from collectible regions of age N are moved into another region of the same age N or to an empty region that is assigned an age of N. Then, the ages of all regions across the heap are incremented by 1, except for the maximum age 24 regions. Regions of age 24 are included in partial GC collection sets in order to defragment them.

Partial GC cycles work to reclaim free regions in the heap for allocating new objects. Because some objects from eden regions always survive, a partial GC cycle can reclaim only about 90% of this memory. To keep up with object allocation, partial GC cycles also reclaim free regions by defragmenting older regions. For example, a partial GC cycle that moves objects from 5 fragmented older regions into 2 empty regions, reclaims 3 regions for new object allocation. However, over time the overall amount of fragmented memory decreases and records about object liveness in older regions become less accurate. Eventually, the work done by partial GC cycles to reclaim memory cannot keep pace with memory consumption. Free regions become so scarce that a global mark operation (GMP), which is triggered by another taxation threshold, is required to build a new record of object liveness across the heap. A sweep operation uses this record to measure the amount of free memory in fragmented older regions, which later partial GC cycles can act upon to move objects and reclaim free regions.

A global sweep operation also runs to reclaim memory so that it can create empty regions. The global sweep operation, while logically associated with the global mark operation, runs in the same STW increment as the first partial GC cycle after the mark operation completes. Because the GC cycle responsible for the global mark operation runs concurrently, it might overlap and interleave with a few partial GC cycles.

With the balanced policy, a global GC cycle is sometimes required in addition to the global mark operations and partial GC cycle. This global GC cycle is rare, occurring only in very tight memory conditions when other GC cycles cannot free enough memory on the heap.

Most objects are easily contained within the minimum region size of 512 KB. However, to support large arrays, which cannot be contained in a region, the balanced GC policy uses an arraylet representation in the heap. For more information about structure and layout, see Arraylets.

Note: With arraylets, JNI access to array data might involve reconstituting arraylets as contiguous arrays, which can significantly slow down processing.

To learn about the default heap size and the tuning options that can be used with the balanced policy, see -Xgcpolicy:balanced.

"},{"location":"gc/#optavgpause-policy","title":"optavgpause policy","text":"

The optimize for pause time policy (-Xgcpolicy:optavgpause) uses a global GC to manage a flat heap comprised of a single area and to compact the heap if the heap becomes fragmented. The global GC cycle starts preemptively so that the cycle finishes before the heap is exhausted. By anticipating global collections and initiating some mark operations ahead of collection, the optavgpause policy reduces GC pause times when compared to optthruput. However, the reduction in pause time comes at the expense of some performance throughput.

"},{"location":"gc/#when-to-use_1","title":"When to use","text":"

Consider using this policy if you have a large heap size (available on 64-bit platforms), because this policy limits the effect of increasing heap size on the length of the GC pause.

Although optavgpause uses a write barrier to support concurrent mark operations, it does not use a generational write barrier. For some application workloads, such as those that frequently change large and old reference arrays, this strategy might be of greater benefit. However, in many situations, the default gencon policy offers better performance.

By using a flat heap, optavgpause avoids potential issues with very large objects. With gencon, the heap is divided into areas (nursery and tenure) in order to manage generations of objects. Although there might be sufficient free space on the overall Java heap for a very large object, it might not fit into the nursery area. If the allocator does succeed in allocating a very large object, further GC cycles might be required to create enough contiguous free space.

Overall, optavgpause, along with optthruput, is best suited to short-lived applications and to long-running services that involve concurrent sessions with short lifespans. Short-lived applications with adequate heap sizes usually complete without compaction. The flat heap fragments more slowly when session-bound objects are allocated and drop out of the live set in short overlapping clusters.

"},{"location":"gc/#gc-processing_2","title":"GC processing","text":"

The optavgpause policy requires a flat Java heap. A global GC cycle runs concurrent mark-sweep operations, optionally followed by compact operations. By running most operations concurrently with application threads, this strategy aims to reduce GC pause times as much as possible.

"},{"location":"gc/#optthruput-policy","title":"optthruput policy","text":"

The optimize for throughput policy (-Xgcpolicy:optthruput) uses a global GC cycle to manage a flat heap that is comprised of a single area and to compact the heap if the heap becomes fragmented. The global collector runs mark and sweep operations that are triggered by an allocation failure when the heap is exhausted. As a result, applications stop for long pauses while garbage collection takes place.

"},{"location":"gc/#when-to-use_2","title":"When to use","text":"

You might consider using this policy when a large heap application can tolerate longer GC pauses to obtain better overall throughput. Unlike gencon, the optthruput policy does not use object access barriers. In some workloads, the cost of these barriers might be high enough to make optthruput preferable. However, in many situations, the default gencon policy offers better performance.

By using a flat heap, optthruput avoids potential issues with very large objects. With gencon, the heap is divided into areas (nursery and tenure) in order to manage generations of objects. Although there might be sufficient free space on the overall Java heap for a very large object, it might not fit into the nursery area. If the allocator does succeed in allocating a very large object, further GC cycles might be required to create enough contiguous free space.

Overall, optthruput, along with optavgpause, is best suited to short-lived applications and to long-running services that involve concurrent sessions with short lifespans. Short-lived applications with adequate heap sizes usually complete without compaction. The flat heap fragments more slowly when session-bound objects are allocated and drop out of the live set in short overlapping clusters.

"},{"location":"gc/#gc-processing_3","title":"GC processing","text":"

The optthruput policy requires a flat Java heap. A global GC cycle runs mark-sweep operations, optionally followed by compact operations. The cycle requires exclusive access to the heap, causing application threads to halt while operations take place. As such, long pauses can occur.

"},{"location":"gc/#metronome-policy","title":"metronome policy","text":"

(Linux on x86-64 and AIX platforms only)

The metronome policy (-Xgcpolicy:metronome) is an incremental, deterministic garbage collector with short pause times. Applications that are dependent on precise response times can take advantage of this technology by avoiding potentially long delays from GC activity.

"},{"location":"gc/#when-to-use_3","title":"When to use","text":"

metronome is designed for applications that require a precise upper bound on collection pause times as well as specified application utilization: the proportion of time that the application is permitted to use, with the remainder being devoted to GC. The metronome GC runs in short interruptible bursts to avoid long STW pauses.

"},{"location":"gc/#gc-processing_4","title":"GC processing","text":"

The Java heap is allocated as a contiguous range of memory, partitioned into small regions of equal size (~64 KB). The metronome policy does not dynamically resize the heap; the heap is always fully expanded, even if -Xms is not set to -Xmx.

Each region of the heap is either empty, or contains only objects in one of 16 size classes. The heap also supports Arraylets for dealing with large arrays. This organization improves the use of available heap space, reducing the need for heap compaction and defragmentation, and providing more precise control over the incremental sweep operation.

Note: With arraylets, JNI access to array data might involve reconstituting arraylets as contiguous arrays, which can significantly slow down processing.

Although high application utilization is desirable for optimal throughput, the GC must be able to keep up with the application's memory allocation rate.

A higher utilization typically requires a larger heap because the GC isn't allowed to run as much as a lower utilization would permit. The relationship between utilization and heap size is highly application dependent, and striking an appropriate balance requires iterative experimentation with the application and VM parameters. You might need to adjust heap size or pause time or target utilization to achieve an acceptable runtime configuration.

To learn about default options and tuning options that can be used with the metronome policy, see -Xgcpolicy:metronome.

"},{"location":"gc/#nogc-policy","title":"nogc policy","text":"

-Xgcpolicy:nogc handles only memory allocation and heap expansion, but doesn't reclaim any memory. The GC impact on runtime performance is therefore minimized, but if the available Java heap becomes exhausted, an OutOfMemoryError exception is triggered and the VM stops.

"},{"location":"gc/#when-to-use_4","title":"When to use","text":"

This policy is not suited to the majority of Java applications. However, the following use cases apply:

Note: You should be especially careful when using any of the following techniques with nogc because memory is never released under this policy:

"},{"location":"gc/#troubleshooting","title":"Troubleshooting","text":"

You can diagnose problems with garbage collection operations by turning on verbose GC logging. By default, the information is printed to STDERR but can be redirected to a file by specifying the -Xverbosegclog option. The log files contain detailed information about all operations, including initialization, STW processing, finalization, reference processing, and allocation failures. For more information, see Verbose GC logs.

If verbose logs do not provide enough information to help you diagnose GC problems, you can use GC trace to analyze operations at a more granular level. For more information, see -Xtgc.

"},{"location":"gc_overview/","title":"Garbage Collection (GC)","text":""},{"location":"gc_overview/#garbage-collection","title":"Garbage collection","text":"

To prevent applications running out of memory, objects in the Java heap that are no longer required must be reclaimed. This process is known as garbage collection (GC). When garbage is collected, the garbage collector must obtain exclusive access to the heap, which causes an application to pause while the cleanup is done. This pause is often referred to as a stop-the-world (STW) pause because an application must halt until the process completes. In general, the first step in the GC process is to mark the objects that are reachable, which means they are still in use. The next step is to sweep away the unmarked objects to reclaim memory. The final step is to compact the heap if the heap is badly fragmented.

A GC cycle is a repeatable process that involves a set of GC operations. These operations process all or parts of the Java heap. When operating on the whole of the Java heap, the cycle is referred to as a global GC cycle; When operating on part of the heap, the cycle is referred to as a partial GC cycle.

A global GC cycle can be triggered explicitly or implicitly according to the following rules:

The System.gc() call triggers the GC cycle twice internally to clear unreachable objects that were not identified during the first GC cycle. This call also triggers finalization to release resources that were used by the unreachable objects so that the resources can be reused.

Partial GC cycles are triggered only implicitly under the control of a particular GC policy. For more information about the GC policies available with Eclipse OpenJ9\u2122, see Garbage collection policies.

The GC process is designed to operate without intervention from an application. Developers should not attempt to predict GC behavior, for example, by making calls to System.gc() to trigger a cycle or by using finalizers to clean up objects in memory. Such actions might degrade the performance of an application.

"},{"location":"gc_overview/#gc-operations","title":"GC operations","text":"

GC operations run discrete functions on the Java heap. For example, a mark operation traces all objects in the heap to determine which ones are reachable. A sweep operation runs to clear away unreachable objects. Together, a mark and sweep operation are capable of reclaiming used memory as part of a GC cycle. Not all GC cycles include operations to reclaim memory. For example, the balanced GC policy involves a global cycle that includes only a mark operation; reclaiming the memory with a sweep operation occurs as part of a separate partial GC cycle that evacuates younger regions and defragments older regions.

A GC operation might complete in one step, or it might involve multiple steps. For example, a mark operation consists of three steps, as described in the following section.

"},{"location":"gc_overview/#gc-mark-operation","title":"GC mark operation","text":"

A mark operation identifies which objects on the Java heap are reachable from outside of the heap and which objects are unreachable. Reachable objects are in use and must be retained, whereas unreachable objects are not in use and can be cleared away as garbage.

The process of marking involves a bit array called a mark map that is allocated by the VM at startup, based on the maximum heap size setting. Each bit in the mark map corresponds to 8 bytes of heap space. When an object is marked, its location in the heap is recorded by setting the appropriate bit in the mark map.

A mark operation can be broken down into the following steps:

  1. Initial

    A root object is an object that is accessible from outside of the heap such as a stack, class static field, or JNI reference. For other objects in the heap to be reachable, they must retain a connection from a root object. In the initial step, tracing identifies all root objects by running a root scan. Root objects are pushed onto a work stack for processing in the next step.

  2. Main

    The list of reachable root objects in the work stack is recursively traced for references to other objects in the heap. Objects that are not marked are new objects and these are added to the work stack. If an object is reachable, the appropriate bit is set in the mark map.

  3. Final

    The final step processes weakly reachable roots such as finalizable objects, weak references, monitor sets, and string sets. For more information about the processing of soft, weak, and phantom references, see Weak reference processing.

In general, helper threads are used in parallel to speed up mark operations on the heap. The helper threads share the work stack with the application thread and are involved in identifying root objects, tracing objects in the heap, and updating the mark map. By default, the number of helper threads is based on the number of CPUs reported by the operating system. You can control the number of helper threads available by specifying the -Xgcthreads command line option when starting your application.

In a verbose GC log, this operation is shown by the <gc-op type=\"mark\"> XML element. For more information, see Verbose GC logs.

"},{"location":"gc_overview/#concurrent-mark-processing","title":"Concurrent mark processing","text":"

A mark operation can run with exclusive access to the heap, which requires application threads to pause while processing takes place. Alternatively, it can run concurrently with application threads to avoid pauses in application processing.

With concurrent mark, the process of root scanning is handed over to application stack threads, which populate the work stack with root objects in their stack. The root objects in the work stack are then traced by a background thread and by each application thread during a heap lock allocation to find reachable objects and update the mark map. Because the mark operation runs concurrently with application threads, any changes to objects that are already traced must be updated. This process works by using a write barrier that can flag the update and trigger a further scan of part of the heap.

To track updates to objects, concurrent mark operations use single-byte cards in a card table. Each card corresponds to a 512-byte section of the Java heap. When an object is updated, the start address for the object in the heap is marked on the appropriate card. These cards are used to determine what must be retraced later in the GC cycle.

A GC cycle that includes concurrent mark operations aims to trace all reachable objects and complete processing at the same time as the heap is exhausted. Continuous adjustments are made to the start time of each cycle to get as close to heap exhaustion as possible. When the heap is exhausted a sweep operation is able to reclaim memory. This operation requires a STW pause. Before sweep operations start, the root objects are rescanned and the cards are checked to determine which areas of memory must be retraced.

An advantage of concurrent mark operations over STW mark operations is reduced pause times, because the garbage collector is able to identify garbage without halting application threads. Pause times are also more consistent because the collector is able to tune start times to maximize heap usage.

Disadvantages of concurrent mark operations include the additional CPU for operating the write barrier and additional work for application threads to trace objects when requesting a heap lock.

Concurrent mark operations are used by the gencon GC policy and the optavgpause GC policy.

"},{"location":"gc_overview/#incremental-concurrent-mark-processing","title":"Incremental concurrent mark processing","text":"

Incremental concurrent mark processing evens out pause times by avoiding global STW garbage collections. This type of marking is also known as the global mark phase, whereby mark operations take place incrementally across the entire heap. The global mark operations are interleaved with a partial GC cycle that is responsible for moving objects and clearing unreachable objects in the heap.

These operations also use mark map in a card table to manage updates to objects that occur whilst mark operations are in progress. However, unlike the concurrent mark operations used by other policies, application threads are not involved in tracing objects; only background threads are used to trace objects and update the mark map.

Incremental concurrent mark operations are used by the balanced GC policy.

"},{"location":"gc_overview/#gc-sweep-operation","title":"GC sweep operation","text":"

The purpose of a sweep operation is to identify memory that can be reclaimed for object allocation and update a central record, known as the freelist.

sweep operations occur in 2 steps:

  1. Initial

    This step analyzes the mark map for free memory.

  2. Final

    Based on the analysis, the sections of the heap are connected to the freelist.

As with mark operations, multiple helper threads can be used to sweep the Java heap in parallel to speed up processing times. Because these helper threads are the same ones that are used for parallel mark operations, the number of threads can be controlled by using the -Xgcthreads option.

Parallel sweep operations run on 256 KB sections of the heap. Each helper thread scans a section at a time. The results are stored and used to generate a freelist of empty regions.

In a verbose GC log, this operation is shown by the <gc-op type=\"sweep\"> XML element. For more information, see Verbose GC logs.

"},{"location":"gc_overview/#concurrent-sweep-processing","title":"Concurrent sweep processing","text":"

Concurrent sweep processing works in tandem with concurrent mark processing and uses the same mark map. Concurrent sweep operations start after a STW collection and complete a section of the heap before concurrent mark operations continue.

Concurrent sweep is used by the optavgpause GC policy.

"},{"location":"gc_overview/#gc-scavenge-operation","title":"GC scavenge operation","text":"

A GC scavenge operation is triggered by an allocation failure in the nursery area of the heap. The operation occurs in the following 3 steps:

  1. Initial

    A root object is an object that is accessible from outside of the heap such as a stack, class static field, or JNI reference. For other objects in the heap to be reachable, they must retain a connection from a root object. In the initial step, tracing identifies all root objects by running a root scan. Root objects are pushed onto a work stack for processing in the next step.

  2. Main

    The list of reachable root objects in the work stack is recursively traced for references to other objects in the heap by using the hierarchical scan ordering mode (-Xgc:hierarchicalScanOrdering). If new objects are found, they are added to the work stack. If an object is reachable, it is copied from the allocate space to the survivor space in the nursery area or to the tenure area if the object has reached a particular age.

  3. Final

    The final step processes weakly reachable roots such as finalizable objects, weak references, monitor sets, and string sets. For more information about the processing of soft, weak, and phantom references, see Weak reference processing.

In a verbose GC log, this operation is shown by the <gc-op type=\"scavenge\"> XML element. For more information, see Verbose GC logs.

The scavenge operation is used by the gencon GC policy.

"},{"location":"gc_overview/#gc-copy-forward-operation","title":"GC copy forward operation","text":"

A GC copy forward operation is similar to a scavenge operation but is triggered by a taxation threshold being reached. The operation occurs in the following 3 steps:

  1. Initial

    A root object is an object that is accessible from outside of the heap such as a stack, class static field, or JNI reference. For other objects in the heap to be reachable, they must retain a connection from a root object. In the initial step, tracing identifies all root objects by running a root scan. Root objects are pushed onto a work stack for processing in the next step.

  2. Main

    The list of reachable root objects in the work stack is recursively traced for references to other objects in the heap by using dynamic breadth first scan ordering mode (-Xgc:dynamicBreadthFirstScanOrdering). If new objects are found, they are added to the work stack. If an object is reachable, it is moved to another region of the same age or to an empty region of the same age in the heap. The age of all regions in the heap is then incremented by 1, except for the oldest region (age 24).

  3. Final

    The final step processes weakly reachable roots such as finalizable objects, weak references, monitor sets, and string sets. For more information about the processing of soft, weak, and phantom references, see Weak reference processing.

The operation aims to empty or evacuate fragmented regions that can then be reclaimed for new object allocation.

In a verbose GC log, this operation is shown by the <gc-op type=\"copy forward\"> XML element. For more information, see Verbose GC logs.

The copy forward operation is used by the balanced GC policy.

"},{"location":"gc_overview/#gc-classunloading-operation","title":"GC classunloading operation","text":"

The classunloading operation is single threaded, not parallel threaded.

In a verbose GC log, this operation is shown by the <gc-op type=\"classunload\"> XML element. For more information, see Verbose GC logs.

"},{"location":"gc_overview/#gc-compact-operation","title":"GC compact operation","text":"

Compaction of the heap is an expensive operation because when objects are moved to defragment the heap, the references to each object change. Therefore, compact operations do not occur by default but only when the following triggers occur:

The following two options can be used to control compaction:

In a verbose GC log, this operation is shown by the <gc-op type=\"compact\"> XML element. For more information, see Verbose GC logs.

"},{"location":"gc_overview/#weak-reference-processing","title":"Weak reference processing","text":"

Weak reference processing includes soft references, weak references, and phantom references. These references are created by the user for specific use cases and allow some level of interaction with the garbage collector. For example, a soft reference to an object allows that object to persist in memory for a longer period of time before being cleared. For example, a software cache. The garbage collector handles the reference types in the order shown and with the behavior detailed in the following table:

Reference type Class Garbage collector behavior soft java.lang.ref.SoftReference A soft reference is cleared only when its referent is not marked for a number of GC cycles or if space on the heap is likely to cause an out of memory error. Use the -Xsoftrefthreshold option to control the collection of soft reference objects. weak java.lang.ref.WeakReference A weak reference is cleared as soon as its referent is not marked by a GC cycle. phantom java.lang.ref.PhantomReference A phantom reference is cleared automatically as soon as its referent is not marked by a GC cycle. The cleared reference is then added to the associated reference queue at the same time or later.

If your application uses the Java Native Interface (JNI) to interact with other application types, you can also create weak JNI object references. These references have a similar life cycle to a weak Java reference. The garbage collector processes weak JNI references after all other Java reference types.

"},{"location":"interface_dtfj/","title":"DTFJ","text":""},{"location":"interface_dtfj/#diagnostic-tool-framework-for-java","title":"Diagnostic Tool Framework for Java","text":"

The Diagnostic Tool Framework for Java\u2122 (DTFJ) is a Java application programming interface (API) that is used to support the building of Java diagnostic tools. DTFJ works with data from a system dump or a Java dump.

On Linux and AIX\u00ae operating systems, you can get more information from a system dump if you also have copies of executable files and libraries. You can run the jpackcore utility to collect these files into a single archive for use in subsequent problem diagnosis. For more information, see Dump extractor.

The DTFJ API helps diagnostic tools access the following information:

If your DTFJ application requests information that is not available in the Java dump, the API will return null or throw a DataUnavailable exception. You might need to adapt DTFJ applications written to process system dumps to make them work with Java dumps.

DTFJ is implemented in pure Java and tools written using DTFJ can be cross-platform. Therefore, you can analyze a dump taken from one workstation on another (remote and more convenient) machine. For example, a dump produced on an AIX\u00ae Power\u00ae system can be analyzed on a Windows laptop.

See the DTFJ API documentation.

Note: If the code that loads DTFJ is in a module, the module must require the openj9.dtfj module. For example:

module MyModule {\n  requires openj9.dtfj;\n}\n
"},{"location":"interface_dtfj/#using-the-dtfj-interface","title":"Using the DTFJ interface","text":"

To create applications that use DTFJ, you must use the DTFJ interface. Implementations of this interface have been written that work with system dumps and Java dumps.

The diagram that follows illustrates the DTFJ interface. The starting point for working with a dump is to obtain an Image instance by using the ImageFactory class supplied with the concrete implementation of the API.

"},{"location":"interface_dtfj/#working-with-a-system-dump","title":"Working with a system dump","text":"

The following example shows how to work with a system dump. In this example, the only section of code that ties the dump to a particular implementation of DTFJ is the generation of the factory class. Change the factory if you want to use a different implementation.

If there is a problem with the file that is passed to the getImage() method, an IOException is thrown and an appropriate message is issued. If a missing file is passed to the example shown, the following output is produced:

Could not find/use required file(s)\njava.io.FileNotFoundException: core_file.xml (The system cannot find the file specified.)\n        at java.io.FileInputStream.open(Native Method)\n        at java.io.FileInputStream.<init>(FileInputStream.java:135)\n        at com.ibm.dtfj.image.j9.ImageFactory.getImage(ImageFactory.java:47)\n        at com.ibm.dtfj.image.j9.ImageFactory.getImage(ImageFactory.java:35)\n        at DTFJEX1.main(DTFJEX1.java:23)Copy\n

In this case, the DTFJ implementation is expecting a dump file to exist. Different errors are caught if the file existed but was not recognized as a valid dump file.

Example of working with a system dump
import java.io.File;\nimport java.util.Iterator;\nimport java.io.IOException;\n\nimport com.ibm.dtfj.image.CorruptData;\nimport com.ibm.dtfj.image.Image;\nimport com.ibm.dtfj.image.ImageFactory;\n\npublic class DTFJEX1 {\n    public static void main(String[] args) {\n        Image image = null;\n        if (args.length > 0) {\n            File f = new File(args[0]);\n            try {\n                Class factoryClass = Class.forName(\"com.ibm.dtfj.image.j9.ImageFactory\");\n                ImageFactory factory = (ImageFactory) factoryClass.newInstance();\n                image = factory.getImage(f);\n            } catch (ClassNotFoundException e) {\n                System.err.println(\"Could not find DTFJ factory class\");\n                e.printStackTrace(System.err);\n            } catch (IllegalAccessException e) {\n                System.err.println(\"IllegalAccessException for DTFJ factory class\");\n                e.printStackTrace(System.err);\n            } catch (InstantiationException e) {\n                System.err.println(\"Could not instantiate DTFJ factory class\");\n                e.printStackTrace(System.err);\n            } catch (IOException e) {\n                System.err.println(\"Could not find/use required file(s)\");\n                e.printStackTrace(System.err);\n            }\n        } else {\n            System.err.println(\"No filename specified\");\n        }\n        if (image == null) {\n            return;\n        }\n\n        Iterator asIt = image.getAddressSpaces();\n        int count = 0;\n        while (asIt.hasNext()) {\n            Object tempObj = asIt.next();\n            if (tempObj instanceof CorruptData) {\n                System.err.println(\"Address Space object is corrupt: \"\n                        + (CorruptData) tempObj);\n            } else {\n                count++;\n            }\n        }\n        System.out.println(\"The number of address spaces is: \" + count);\n    }\n}\n
"},{"location":"interface_dtfj/#working-with-a-java-dump","title":"Working with a Java dump","text":"

To work with a Java dump, change the factory class to com.ibm.dtfj.image.javacore.JCImageFactory and pass the Java dump file to the getImage() method.

Example of working with a Java dump
import java.io.File;\nimport java.util.Iterator;\nimport java.io.IOException;\n\nimport com.ibm.dtfj.image.CorruptData;\nimport com.ibm.dtfj.image.Image;\nimport com.ibm.dtfj.image.ImageFactory;\n\npublic class DTFJEX2 {\n    public static void main(String[] args) {\n        Image image=null;\n\n        if (args.length > 0) {\n            File javacoreFile = new File(args[0]);\n\n            try {\n                Class factoryClass = Class.forName(\"com.ibm.dtfj.image.javacore.JCImageFactory\");\n                ImageFactory factory = (ImageFactory) factoryClass.newInstance();\n                image = factory.getImage(javacoreFile);\n            } catch (ClassNotFoundException e) {\n                System.err.println(\"Could not find DTFJ factory class\");\n                e.printStackTrace(System.err);\n            } catch (IllegalAccessException e) {\n                System.err.println(\"IllegalAccessException for DTFJ factory class\");\n                e.printStackTrace(System.err);\n            } catch (InstantiationException e) {\n                System.err.println(\"Could not instantiate DTFJ factory class\");\n                e.printStackTrace(System.err);\n            } catch (IOException e) {\n                System.err.println(\"Could not find/use required file(s)\");\n                e.printStackTrace(System.err);\n            }\n        } else {\n            System.err.println(\"No filename specified\");\n        }\n        if (image == null) {\n            return;\n        }\n\n        Iterator asIt = image.getAddressSpaces();\n        int count = 0;\n        while (asIt.hasNext()) {\n            Object tempObj = asIt.next();\n            if (tempObj instanceof CorruptData) {\n                System.err.println(\"Address Space object is corrupt: \"\n                        + (CorruptData) tempObj);\n            } else {\n                count++;\n            }\n        }\n        System.out.println(\"The number of address spaces is: \" + count);\n    }\n}\n
"},{"location":"interface_dtfj/#analyze-the-dump","title":"Analyze the dump","text":"

After you have obtained an Image instance, you can begin analyzing the dump. The Image instance is the second instance in the class hierarchy for DTFJ illustrated by the following diagram:

Some things to note from the diagram:

"},{"location":"interface_dtfj/#dtfj-example-application","title":"DTFJ example application","text":"

This example is a fully working DTFJ application. Many DTFJ applications will follow a similar model.

Sample DTFJ application
import java.io.File;\nimport java.util.Iterator;\nimport com.ibm.dtfj.image.CorruptData;\nimport com.ibm.dtfj.image.CorruptDataException;\nimport com.ibm.dtfj.image.DataUnavailable;\nimport com.ibm.dtfj.image.Image;\nimport com.ibm.dtfj.image.ImageAddressSpace;\nimport com.ibm.dtfj.image.ImageFactory;\nimport com.ibm.dtfj.image.ImageProcess;\nimport com.ibm.dtfj.java.JavaRuntime;\nimport com.ibm.dtfj.java.JavaThread;\nimport com.ibm.dtfj.image.ImageThread;\n\npublic class DTFJEX2\n{\n   public static void main( String[] args )\n   {\n      Image image = null;\n      if ( args.length > 0 )\n      {\n         File f = new File( args[0] );\n         try\n         {\n            Class factoryClass = Class\n                  .forName( \"com.ibm.dtfj.image.j9.ImageFactory\" );\n            ImageFactory factory = (ImageFactory) factoryClass.newInstance( );\n            image = factory.getImage( f );\n         }\n         catch ( Exception ex )\n         { /*\n             * Should use the error handling as shown in DTFJEX1.\n             */\n            System.err.println( \"Error in DTFJEX2\" );\n            ex.printStackTrace( System.err );\n         }\n      }\n      else\n      {\n         System.err.println( \"No filename specified\" );\n      }\n\n      if ( null == image )\n      {\n         return;\n      }\n\n      MatchingThreads( image );\n   }\n\n   public static void MatchingThreads( Image image )\n   {\n      ImageThread imgThread = null;\n\n      Iterator asIt = image.getAddressSpaces( );\n      while ( asIt.hasNext( ) )\n      {\n         System.out.println( \"Found ImageAddressSpace...\" );\n\n         ImageAddressSpace as = (ImageAddressSpace) asIt.next( );\n\n         Iterator prIt = as.getProcesses( );\n\n         while ( prIt.hasNext( ) )\n         {\n            System.out.println( \"Found ImageProcess...\" );\n\n            ImageProcess process = (ImageProcess) prIt.next( );\n\n            Iterator runTimesIt = process.getRuntimes( );\n            while ( runTimesIt.hasNext( ) )\n            {\n               System.out.println( \"Found Runtime...\" );\n               JavaRuntime javaRT = (JavaRuntime) runTimesIt.next( );\n\n               Iterator javaThreadIt = javaRT.getThreads( );\n\n               while ( javaThreadIt.hasNext( ) )\n               {\n                  Object tempObj = javaThreadIt.next( );\n                  /*\n                   * Should use CorruptData handling for all iterators\n                   */\n                  if ( tempObj instanceof CorruptData )\n                  {\n                     System.out.println( \"We have some corrupt data\" );\n                  }\n                  else\n                  {\n                     JavaThread javaThread = (JavaThread) tempObj;\n                     System.out.println( \"Found JavaThread...\" );\n                     try\n                     {\n                        imgThread = (ImageThread) javaThread.getImageThread( );\n\n                        // Now we have a Java thread we can iterator\n                        // through the image threads\n                        Iterator imgThreadIt = process.getThreads( );\n\n                        while ( imgThreadIt.hasNext( ) )\n                        {\n                           ImageThread imgThread2 = (ImageThread) imgThreadIt\n                                 .next( );\n                           if ( imgThread.equals( imgThread2 ) )\n                           {\n                              System.out.println( \"Found a match:\" );\n                              System.out.println( \"\\tjavaThread \"\n                                    + javaThread.getName( )\n                                    + \" is the same as \" + imgThread2.getID( ) );\n                           }\n                        }\n                     }\n                     catch ( CorruptDataException e )\n                     {\n                        System.err.println( \"ImageThread was corrupt: \"\n                              + e.getMessage( ) );\n                     }\n                     catch ( DataUnavailable e )\n                     {\n                        System.out.println( \"DataUnavailable: \"\n                              + e.getMessage( ) );\n                     }\n                  }\n               }\n            }\n         }\n      }\n   }\n}\n

For clarity, the example does not perform full error checking when constructing the main Image object and does not perform CorruptData handling in all of the iterators. In a production environment, you use the techniques illustrated in the previous examples under Working with a system dump and Working with a Java dump.

In the example, the program iterates through every available Java thread and checks whether it is equal to any of the available image threads. When they are found to be equal, the program displays the following message: \"Found a match\".

The example demonstrates:

"},{"location":"interface_jvmti/","title":"JVMTI","text":""},{"location":"interface_jvmti/#java-virtual-machine-tool-interface","title":"Java Virtual Machine Tool Interface","text":"

The Java\u2122 Virtual Machine Tool Interface (JVMTI) is a two-way interface that allows communication between the VM and a native agent. It replaces both the Java Virtual Machine Debug Interface (JVMDI) and Java Virtual Machine Profiler Interface (JVMPI).

"},{"location":"interface_jvmti/#overview","title":"Overview","text":"

The JVMTI allows third parties to develop debugging, profiling, and monitoring tools for the VM. The interface contains mechanisms for the agent to notify the VM about the kinds of information it requires, and also provides a means of receiving relevant notifications.

Several agents can be attached to a VM at any one time.

JVMTI agents can be loaded at startup using short or long forms of the command-line option:

-agentlib:<agent-lib-name>=<options>\n

or

-agentpath:<path-to-agent>=<options>\n

In the example that follows (see Sample JVMTI agent), the directory containing the jdwp library is assumed to be on the library path. If you require a specific library, such as jdwp, with your JVMTI agent, you can specify the path at startup, for example:

-agentlib:jdwp=<options>\n

For more information about JVMTI, see https://docs.oracle.com/javase/8/docs/technotes/guides/management/index.html.

For a guide about writing a JVMTI agent, see http://www.oracle.com/technetwork/articles/javase/jvmti-136367.html.

"},{"location":"interface_jvmti/#eclipse-openj9-extensions","title":"Eclipse OpenJ9 extensions","text":"

Eclipse OpenJ9\u2122 extensions to the JVMTI allow a JVMTI agent to query or automatically trigger operations in the VM, including the following tasks:

Task OpenJ9 extensions Get the OS thread ID GetOSThreadID Query, set, and reset the VM dump options QueryVmDump, SetVmDump, ResetVmDump Trigger a VM dump, and monitor JVMTI event functions when VM dumps start and end TriggerVmDump, VMDumpStart, VMDumpEnd Set VM trace options SetVmTrace Subscribe to and unsubscribe from VM tracepoints RegisterTracePointSubscriber, DeregisterTracePointSubscriber Query runtime environment native memory categories GetMemoryCategories Query and set VM log options QueryVmLogOptions, SetVmLogOptions Search for and remove a shared classes cache IterateSharedCaches, DestroySharedCache Subscribe to and unsubscribe from verbose garbage collection (GC) data logging RegisterVerboseGCSubscriber, DeregisterVerboseGCSubscriber

The definitions that you need when you write a JVMTI agent are provided in the header files jvmti.h and ibmjvmti.h, in the include directory.

"},{"location":"interface_jvmti/#sample-jvmti-agent","title":"Sample JVMTI agent","text":"

The following sample shows you how to write a simple JVMTI agent that uses OpenJ9 extensions to the JVMTI.

Sample JVMTI agent written in C/C++, which uses the OpenJ9 extensions
/*\n * tiSample.c\n *\n * Sample JVMTI agent to demonstrate the OpenJ9 JVMTI dump extensions\n */\n\n#include \"jvmti.h\"\n#include \"ibmjvmti.h\"\n\n/* Forward declarations for JVMTI callback functions */\nvoid JNICALL VMInitCallback(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread);\nvoid JNICALL DumpStartCallback(jvmtiEnv *jvmti_env, char* label, char* event, char* detail, ...);\n\n\n/*\n * Agent_Onload()\n *\n * JVMTI agent initialisation function, invoked as agent is loaded by the VM\n */\nJNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {\n\n  jvmtiEnv *jvmti = NULL;\n  jvmtiError rc;\n  jint extensionEventCount = 0;\n  jvmtiExtensionEventInfo *extensionEvents = NULL;\n  jint extensionFunctionCount = 0;\n  jvmtiExtensionFunctionInfo *extensionFunctions = NULL;\n  int i = 0, j = 0;\n\n  printf(\"tiSample: Loading JVMTI sample agent\\n\");\n\n    /* Get access to JVMTI */\n    (*jvm)->GetEnv(jvm, (void **)&jvmti, JVMTI_VERSION_1_0);\n\n     /* Look up all the JVMTI extension events and functions */\n   (*jvmti)->GetExtensionEvents(jvmti, &extensionEventCount, &extensionEvents);\n   (*jvmti)->GetExtensionFunctions(jvmti, &extensionFunctionCount, &extensionFunctions);\n\n    printf(\"tiSample: Found %i JVMTI extension events, %i extension functions\\n\", extensionEventCount, extensionFunctionCount);\n\n   /* Find the JVMTI extension event we want */\n   while (i++ < extensionEventCount) {\n\n        if (strcmp(extensionEvents->id, COM_IBM_VM_DUMP_START) == 0) {\n            /* Found the dump start extension event, now set up a callback for it */\n            rc = (*jvmti)->SetExtensionEventCallback(jvmti, extensionEvents->extension_event_index, &DumpStartCallback);\n            printf(\"tiSample: Setting JVMTI event callback %s, rc=%i\\n\", COM_IBM_VM_DUMP_START, rc);\n            break;\n        }\n        extensionEvents++; /* move on to the next extension event */\n    }\n\n    /* Find the JVMTI extension function we want */\n    while (j++ < extensionFunctionCount) {\n        jvmtiExtensionFunction function = extensionFunctions->func;\n\n        if (strcmp(extensionFunctions->id, COM_IBM_SET_VM_DUMP) == 0) {\n            /* Found the set dump extension function, now set a dump option to generate javadumps on\n          thread starts */\n            rc = function(jvmti, \"java:events=thrstart\");\n            printf(\"tiSample: Calling JVMTI extension %s, rc=%i\\n\", COM_IBM_SET_VM_DUMP, rc);\n            break;\n        }\n        extensionFunctions++; /* move on to the next extension function */\n     }\n\n     return JNI_OK;\n}\n\n\n/*\n * DumpStartCallback()\n * JVMTI callback for dump start event (IBM JVMTI extension)  */\nvoid JNICALL\nDumpStartCallback(jvmtiEnv *jvmti_env, char* label, char* event, char* detail, ...) {\n      printf(\"tiSample: Received JVMTI event callback, for event %s\\n\", event);\n}\n

The sample JVMTI agent consists of two functions, Agent_OnLoad() and DumpStartCallback():

"},{"location":"interface_jvmti/#agent_onload","title":"Agent_OnLoad()","text":"

This function is called by the VM when the agent is loaded at VM startup, which allows the JVMTI agent to modify VM behavior before initialization is complete. The sample agent obtains access to the JVMTI interface by using the JNI Invocation API function GetEnv(). The agent calls the APIs GetExtensionEvents() and GetExtensionFunctions() to find the JVMTI extensions that are supported by the VM. These APIs provide access to the list of extensions available in the jvmtiExtensionEventInfo and jvmtiExtensionFunctionInfo structures. The sample uses an extension event and an extension function in the following way:

Extension event: The sample JVMTI agent searches for the extension event VmDumpStart in the list of jvmtiExtensionEventInfo structures, by using the identifier COM_IBM_VM_DUMP_START provided in ibmjvmti.h. When the event is found, the JVMTI agent calls the JVMTI interface SetExtensionEventCallback() to enable the event, providing a function DumpStartCallback() that is called when the event is triggered.

Extension function: Next, the sample JVMTI agent searches for the extension function SetVMDump in the list of jvmtiExtensionFunctionInfo structures, by using the identifier COM_IBM_SET_VM_DUMP provided in ibmjvmti.h. The JVMTI agent calls the function by using the jvmtiExtensionFunction pointer to set a VM dump option java:events=thrstart. This option requests the VM to trigger a Java dump every time a VM thread is started.

"},{"location":"interface_jvmti/#dumpstartcallback","title":"DumpStartCallback()","text":"

This callback function issues a message when the associated extension event is called. In the sample code, DumpStartCallback() is used when the VmDumpStart event is triggered.

"},{"location":"interface_jvmti/#using-the-sample-jvmti-agent","title":"Using the sample JVMTI agent","text":""},{"location":"interface_jvmti/#api-reference","title":"API reference","text":"

The following sections provide reference information for the OpenJ9 extensions to the JVMTI.

"},{"location":"interface_jvmti/#getosthreadid","title":"GetOSThreadID","text":"

You can get the OS thread ID by using the GetOSThreadID() API:

jvmtiError GetOSThreadID(jvmtiEnv* jvmti_env, jthread thread, jlong * threadid_ptr);\n

Parameters

Returns

JVMTI_ERROR_NONE: Success JVMTI_ERROR_NULL_POINTER: The threadid_ptr parameter is null. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is invalid. JVMTI_ERROR_INVALID_THREAD: The thread is not valid. JVMTI_ERROR_THREAD_NOT_ALIVE: The VM state of the thread is not started or has died. JVMTI_ERROR_UNATTACHED_THREAD: The current thread is not attached to the VM. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI start or live phase.

Identifiers

JVMTI Extension Function identifier: com.ibm.GetOSThreadID Macro declaration in the ibmjvmti.h file: COM_IBM_GET_OS_THREAD_ID

"},{"location":"interface_jvmti/#queryvmdump","title":"QueryVmDump","text":"

You can query the VM dump options that are set for a VM by using the QueryVmDump() API:

jvmtiError QueryVmDump(jvmtiEnv* jvmti_env, jint buffer_size, void* options_buffer, jint* data_size_ptr)\n

This extension returns a set of dump option specifications as ASCII strings. The syntax of the option string is the same as the -Xdump command-line option, with the initial -Xdump: omitted. See -Xdump. The option strings are separated by newline characters. If the memory buffer is too small to contain the current VM dump option strings, you can expect the following results:

Parameters

Returns

JVMTI_ERROR_NONE: Success JVMTI_ERROR_NULL_POINTER: The options_buffer or data_size_ptr parameters are null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is invalid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_NOT_AVAILABLE: The dump configuration is locked because a dump is in progress. JVMTI_ERROR_ILLEGAL_ARGUMENT: The supplied memory buffer in options_buffer is too small.

Identifiers

JVMTI Extension Function identifier: com.ibm.QueryVmDump Macro declaration in the ibmjvmti.h file: COM_IBM_QUERY_VM_DUMP

"},{"location":"interface_jvmti/#setvmdump","title":"SetVmDump","text":"

You can set VM dump options by using the SetVmDump() API:

jvmtiError SetVmDump(jvmtiEnv* jvmti_env, char* option)\n

The dump option is passed in as an ASCII character string. Use the same syntax as the -Xdump command-line option, with the initial -Xdump: omitted. See -Xdump.

When dumps are in progress, the dump configuration is locked, and calls to SetVmDump() fail with a return value of JVMTI_ERROR_NOT_AVAILABLE.

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_NULL_POINTER: The parameter option is null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is invalid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_NOT_AVAILABLE: The dump configuration is locked because a dump is in progress. JVMTI_ERROR_ILLEGAL_ARGUMENT: The parameter option contains an invalid -Xdump string.

Identifiers

JVMTI Extension Function identifier: com.ibm.SetVmDump Macro declaration in the ibmjvmti.h file: COM_IBM_SET_VM_DUMP

"},{"location":"interface_jvmti/#triggervmdump","title":"TriggerVmDump","text":"

You can trigger a VM dump and specify the type of dump you want by using the TriggerVmDump() API:

jvmtiError TriggerVmDump(jvmtiEnv* jvmti_env, char* option)\n

Choose the type of dump required by specifying an ASCII string that contains one of the supported dump agent types. See -Xdump. JVMTI events are provided at the start and end of the dump.

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_NULL_POINTER: The option parameter is null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is invalid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_NOT_AVAILABLE: The dump configuration is locked because a dump is in progress.

Identifiers

JVMTI Extension Function identifier: com.ibm.TriggerVmDump Macro declaration in the ibmjvmti.h file: COM_IBM_TRIGGER_VM_DUMP

"},{"location":"interface_jvmti/#resetvmdump","title":"ResetVmDump","text":"

You can reset VM dump options to the values at VM initialization by using the ResetVmDump() API:

jvmtiError ResetVmDump(jvmtiEnv* jvmti_env)\n

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is invalid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_NOT_AVAILABLE: The dump configuration is locked because a dump is in progress.

Identifiers

JVMTI Extension Function identifier: com.ibm.ResetVmDump Macro declaration in the ibmjvmti.h file: COM_IBM_RESET_VM_DUMP

"},{"location":"interface_jvmti/#vmdumpstart","title":"VMDumpStart","text":"

The following JVMTI event function is called when a VM dump starts:

void JNICALL VMDumpStart(jvmtiEnv *jvmti_env, JNIEnv* jni_env, char* label, char* event, char* detail)\n

The event function provides the dump file name, the name of the JVMTI event, and the detail string from the dump event. The detail string provides additional information about the event that triggered the dump. This information is the same as the information detailed in the JVMDUMP039I message. For example:

JVMDUMP039I Processing dump event \"systhrow\", detail \"java/lang/OutOfMemoryError\" at 2014/10/17 13:31:03 - please wait.\"\n

Parameters

Returns

None

"},{"location":"interface_jvmti/#vmdumpend","title":"VMDumpEnd","text":"

The following JVMTI event function is called when a VM dump ends:

void JNICALL VMDumpEnd(jvmtiEnv *jvmti_env, JNIEnv* jni_env, char* label, char* event, char* detail)\n

The event function provides the dump file name, the name of the JVMTI event, and the detail string from the dump event. The detail string provides additional information about the event that triggered the dump. This information is the same as the information detailed in the JVMDUMP039I message. For example:

JVMDUMP039I Processing dump event \"systhrow\", detail \"java/lang/OutOfMemoryError\" at 2014/10/17 13:31:03 - please wait.\n

Parameters

Returns

None

"},{"location":"interface_jvmti/#setvmtrace","title":"SetVmTrace","text":"

You can set VM trace options by using the SetVmTrace() API:

jvmtiError SetVmTrace(jvmtiEnv* jvmti_env, char* option)\n

The trace option is passed in as an ASCII character string. Use the same syntax as the -Xtrace command-line option, with the initial -Xtrace: omitted. See -Xtrace.

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_NULL_POINTER: The option parameter is null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is invalid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_ILLEGAL_ARGUMENT: The option parameter contains an invalid -Xtrace string.

Identifiers

JVMTI Extension Function identifier: com.ibm.SetVmTrace Macro declaration in the ibmjvmti.h file: COM_IBM_SET_VM_TRACE

"},{"location":"interface_jvmti/#registertracepointsubscriber","title":"RegisterTracePointSubscriber","text":"

You can subscribe to VM tracepoints by using the RegisterTracePointSubscriber() API:

jvmtiError RegisterTracePointSubscriber(jvmtiEnv* jvmti_env, char *description, jvmtiTraceSubscriber subscriber, jvmtiTraceAlarm alarm, void *userData, void **subscriptionID)\n

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_NULL_POINTER: One of the supplied parameters is null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is not valid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_NOT_AVAILABLE: VM trace is not available. JVMTI_ERROR_INTERNAL: An internal error occurred.

Identifiers

JVMTI Extension Function identifier: com.ibm.RegisterTracePointSubscriber Macro declaration in the ibmjvmti.h file: COM_IBM_REGISTER_TRACEPOINT_SUBSCRIBER

"},{"location":"interface_jvmti/#jvmtitracesubscriber-function","title":"jvmtiTraceSubscriber function","text":"

The subscriber function type is defined as follows:

typedef jvmtiError (*jvmtiTraceSubscriber)(jvmtiEnv *jvmti_env, void *record, jlong length, void *user_data);\n

The subscriber function must be of type jvmtiTraceSubscriber, which is declared in ibmjvmti.h.

This function is called with each tracepoint record that is selected through the -Xtrace:external option.

The tracepoint record that is supplied to the subscriber function is valid only for the duration of the function. If the subscriber wants to save the data, the data must be copied elsewhere.

If the subscriber function returns an error, the alarm function is called, the subscription is disconnected, and no further tracepoints are sent to the subscriber.

Subscriber function parameters

"},{"location":"interface_jvmti/#jvmtitracealarm-function","title":"jvmtiTraceAlarm function","text":"

The alarm function type is defined as follows:

typedef jvmtiError (*jvmtiTraceAlarm)(jvmtiEnv *jvmti_env, void *subscription_id, void *user_data);\n

The alarm function must be of type jvmtiTraceAlarm, which is declared in ibmjvmti.h. This function is called if the subscriber function returns an error.

Alarm function parameters

"},{"location":"interface_jvmti/#deregistertracepointsubscriber","title":"DeregisterTracePointSubscriber","text":"

You can unsubscribe from VM tracepoints by using the DeregisterTracePointSubscriber() API:

jvmtiError DeregisterTracePointSubscriber(jvmtiEnv* jvmti_env, void *userData, void *subscription_id)\n

After the DeregisterTracePointSubscriber() API is called, no further calls are made to the subscriber function.

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_NULL_POINTER: The subscription_id parameter is null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is not valid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase.

Identifiers

JVMTI Extension Function identifier: com.ibm.DeregisterTracePointSubscriber Macro declaration in the ibmjvmti.h file: COM_IBM_DEREGISTER_TRACEPOINT_SUBSCRIBER

"},{"location":"interface_jvmti/#getmemorycategories","title":"GetMemoryCategories","text":"

You can query runtime environment native memory categories by using the GetMemoryCategories() API:

jvmtiError GetMemoryCategories(jvmtiEnv* env, jint version, jint max_categories, jvmtiMemoryCategory * categories_buffer, jint * written_count_ptr, jint * total_categories_ptr);\n

You can query the total native memory consumption of the runtime environment for each memory category by using this API. Native memory is memory requested from the operating system using library functions such as malloc() and mmap(). Runtime environment native memory use is grouped under high-level memory categories, as described in the NATIVEMEMINFO section of the Java dump topic. The data returned by the GetMemoryCategories() API is consistent with this format. See Java dump: NATIVEMEMINFO.

The extension writes native memory information to a memory buffer specified by the user. Each memory category is recorded as a jvmtiMemoryCategory structure, whose format is defined in ibmjvmti.h.

You can use the GetMemoryCategories() API to work out the buffer size you must allocate to hold all memory categories defined inside the VM. To calculate the size, call the API with a null categories_buffer argument and a non-null total_categories_ptr argument.

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_UNSUPPORTED_VERSION: Unrecognized value passed for version. JVMTI_ERROR_ILLEGAL_ARGUMENT: Illegal argument; categories_buffer, count_ptr, and total_categories_ptr all have null values. JVMTI_ERROR_INVALID_ENVIRONMENT: The env parameter is invalid. JVMTI_ERROR_OUT_OF_MEMORY: Memory category data is truncated because max_categories is not large enough.

Identifiers

JVMTI Extension Function identifier: com.ibm.GetMemoryCategories Macro declaration in the ibmjvmti.h file: COM_IBM_GET_MEMORY_CATEGORIES

"},{"location":"interface_jvmti/#queryvmlogoptions","title":"QueryVmLogOptions","text":"

You can query VM log options by using the QueryVmLogOptions() API:

jvmtiError QueryVmLogOptions(jvmtiEnv* jvmti_env, jint buffer_size, void* options, jint* data_size_ptr)\n

This extension returns the current log options as an ASCII string. The syntax of the string is the same as the -Xsyslog command-line option, with the initial -Xsyslog: omitted. For example, the string \"error,warn\" indicates that the VM is set to log error and warning messages only. For more information, see -Xsyslog.

Parameters

Returns

JVMTI_ERROR_NONE: Success JVMTI_ERROR_NULL_POINTER: The options or data_size_ptr parameters are null. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is invalid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_ILLEGAL_ARGUMENT: The supplied memory buffer is too small.

Identifiers

JVMTI Extension Function identifier: com.ibm.QueryVmLogOptions Macro declaration in the ibmjvmti.h file: COM_IBM_QUERY_VM_LOG_OPTIONS

"},{"location":"interface_jvmti/#setvmlogoptions","title":"SetVmLogOptions","text":"

You can set VM log options by using the SetVmLogOptions() API:

jvmtiError SetVmLogOptions(jvmtiEnv* jvmti_env, char* options_buffer)\n

The log option is passed in as an ASCII character string. Use the same syntax as the -Xsyslog command-line option, with the initial -Xsyslog: omitted. For example, to set the VM to log error and warning messages, pass in a string containing \"error,warn\". For more information, see -Xsyslog.

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_NULL_POINTER: The parameter option is null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is invalid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_ILLEGAL_ARGUMENT: The parameter option contains an invalid -Xsyslog string.

Identifiers

JVMTI Extension Function identifier: com.ibm.SetVmLogOptions Macro declaration in the ibmjvmti.h file: COM_IBM_SET_VM_LOG_OPTIONS

"},{"location":"interface_jvmti/#iteratesharedcaches","title":"IterateSharedCaches","text":"

You can search for shared classes caches that exist in a specified cache directory by using the IterateSharedCaches() API:

jvmtiError IterateSharedCaches(jvmtiEnv* env, jint version, const char *cacheDir, jint flags, jboolean useCommandLineValues, jvmtiIterateSharedCachesCallback callback, void *user_data);\n

Information about the caches is returned in a structure that is populated by a user-specified callback function. You can specify the search directory in two ways:

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The env parameter is not valid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_UNSUPPORTED_VERSION: The version parameter is not valid. JVMTI_ERROR_NULL_POINTER: The callback parameter is null. JVMTI_ERROR_NOT_AVAILABLE: The shared classes feature is not enabled in the VM. JVMTI_ERROR_ILLEGAL_ARGUMENT: The flags parameter is not valid. JVMTI_ERROR_INTERNAL: This error is returned when the jvmtiIterateSharedCachesCallback returns JNI_ERR.

Identifiers

JVMTI Extension Function identifier: com.ibm.IterateSharedCaches Macro declaration in the ibmjvmti.h file: COM_IBM_ITERATE_SHARED_CACHES

"},{"location":"interface_jvmti/#jvmtiiteratesharedcachescallback-function","title":"jvmtiIterateSharedCachesCallback function","text":"

Callback function parameters

Callback function returns

JNI_OK: Continue iterating. JNI_ERR: Stop iterating, which causes IterateSharedCaches to return JVMTI_ERROR_INTERNAL

"},{"location":"interface_jvmti/#jvmtisharedcacheinfo-structure","title":"jvmtiSharedCacheInfo structure","text":"

The structure of jvmtiSharedCacheInfo

typedef struct jvmtiSharedCacheInfo {\nconst char *name;      // the name of the shared cache\njboolean isCompatible; // if the shared cache is compatible with this VM\njboolean isPersistent; // true if the shared cache is persistent, false if its non-persistent\njint os_shmid;         // the OS shared memory ID associated with a non-persistent cache, -1 otherwise\njint os_semid;         // the OS shared semaphore ID associated with a non-persistent cache, -1 otherwise\njint modLevel;         // one of:\n                       //   COM_IBM_SHARED_CACHE_MODLEVEL_JAVA5\n                       //   COM_IBM_SHARED_CACHE_MODLEVEL_JAVA6\n                       //   COM_IBM_SHARED_CACHE_MODLEVEL_JAVA7\n                       //   COM_IBM_SHARED_CACHE_MODLEVEL_JAVA8\n                       //   COM_IBM_SHARED_CACHE_MODLEVEL_JAVA9\n                       //   from Java 10: the version number of the Java level on which the shared cache is created\njint addrMode;         // the address mode of the VM creating the shared cache: includes additional\n                       // information on whether it is a 64-bit compressedRefs cache when\n                       // COM_IBM_ITERATE_SHARED_CACHES_VERSION_3 or later is specified.\njboolean isCorrupt;    // if the cache is corrupted\njlong cacheSize;       // the total usable shared classes cache size, or -1 when isCompatible is false\njlong freeBytes;       // the number of free bytes in the shared classes cache, or -1 when isCompatible is false\njlong lastDetach;      // the last detach time specified in milliseconds since 00:00:00 on 1 January 1970 UTC,\n                       // or -1 when the last detach time is not available\njint cacheType;        // the type of the cache\njlong softMaxBytes;    // the soft limit for the available space in the cache\njint layer;            // the shared cache layer number\n} jvmtiSharedCacheInfo;\n

Notes:

To get the address mode, use:

COM_IBM_ITERATE_SHARED_CACHES_GET_ADDR_MODE(jvmtiSharedCacheInfo.addrMode)\n

This macro returns one of the following values: COM_IBM_SHARED_CACHE_ADDRMODE_32 COM_IBM_SHARED_CACHE_ADDRMODE_64

To get the compressed references mode, use:

COM_IBM_ITERATE_SHARED_CACHES_GET_CMPRSSREF_MODE(jvmtiSharedCacheInfo.addrMode)\n

This macro returns one of the following values: COM_IBM_ITERATE_SHARED_CACHES_UNKNOWN_COMPRESSED_POINTERS_MODE COM_IBM_ITERATE_SHARED_CACHES_COMPRESSED_POINTERS_MODE COM_IBM_ITERATE_SHARED_CACHES_NON_COMPRESSED_POINTERS_MODE

"},{"location":"interface_jvmti/#destroysharedcache","title":"DestroySharedCache","text":"

You can remove a shared classes cache by using the DestroySharedCache() API:

jvmtiError DestroySharedCache(jvmtiEnv *env, const char *cacheDir, const char *name, jint persistence, jboolean useCommandLineValues, jint *internalErrorCode);\n

This extension removes a named shared classes cache of a given persistence type, in a given directory. You can specify the cache name, persistence type, and directory in one of these ways:

Parameters

Returns

JVMTI_ERROR_NONE: Success. No cache exists or all existing caches of all generations are removed. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The env parameter is not valid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_NOT_AVAILABLE: The shared classes feature is not enabled in the VM. JVMTI_ERROR_ILLEGAL_ARGUMENT: The persistence parameter is not valid. JVMTI_ERROR_INTERNAL: Failed to remove any existing cache with the given name. See the value of the internalErrorCode parameter for more information about the failure.

Identifiers

JVMTI Extension Function identifier: com.ibm.DestroySharedCache Macro declaration in the ibmjvmti.h file: COM_IBM_DESTROY_SHARED_CACHE

"},{"location":"interface_jvmti/#registerverbosegcsubscriber","title":"RegisterVerboseGCSubscriber","text":"

You can subscribe to verbose garbage collection (GC) data logging by using the RegisterVerboseGCSubscriber() API:

jvmtiError RegisterVerboseGCSubscriber(jvmtiEnv* jvmti_env, char *description, jvmtiVerboseGCSubscriber subscriber, jvmtiVerboseGCAlarm alarm, void *user_data, void **subscription_id)\n

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_NULL_POINTER: One of the supplied parameters is null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is not valid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_NOT_AVAILABLE: GC verbose logging is not available. JVMTI_ERROR_INTERNAL: An internal error has occurred.

Identifiers

JVMTI Extension Function identifier: com.ibm.RegisterVerboseGCSubscriber Macro declaration in the ibmjvmti.h file: COM_IBM_REGISTER_VERBOSEGC_SUBSCRIBER

"},{"location":"interface_jvmti/#jvmtiverbosegcsubscriber-function","title":"jvmtiVerboseGCSubscriber function","text":"

The subscriber function type is defined as follows:

typedef jvmtiError (*jvmtiVerboseGCSubscriber)(jvmtiEnv *jvmti_env, const char *record, jlong length, void *user_data);\n

The subscriber function must be of type jvmtiVerboseGCSubscriber, which is declared in ibmjvmti.h.

This function is called with each record of verbose logging data produced by the VM.

This function runs under the same restrictions as the GarbageCollectionStart and GarbageCollectionFinish events in the standard JVMTI specification. For more information about these events, see the JVMTI Event Index for your OpenJDK version.

The verbose logging record supplied to the subscriber function is valid only for the duration of the function. If the subscriber wants to save the data, the data must be copied elsewhere.

If the subscriber function returns an error, the alarm function is called, and the subscription is deregistered.

Subscriber function parameters

"},{"location":"interface_jvmti/#jvmtiverbosegcalarm-function","title":"jvmtiVerboseGCAlarm function","text":"

The alarm function type is defined as follows:

typedef jvmtiError (*jvmtiVerboseGCAlarm)(jvmtiEnv *jvmti_env, void *subscription_id, void *user_data);\n

The alarm function must be of type jvmtiVerboseGCAlarm, which is declared in ibmjvmti.h. This function is called if the subscriber function returns an error.

This function runs under the same restrictions as the GarbageCollectionStart and GarbageCollectionFinish events in the standard JVMTI specification. For more information about these events, see the JVMTI Event Index for your OpenJDK version.

Alarm function parameters

"},{"location":"interface_jvmti/#deregisterverbosegcsubscriber","title":"DeregisterVerboseGCSubscriber","text":"

You can unsubscribe from verbose Garbage Collection (GC) data logging by using the DeregisterVerboseGCSubscriber() API:

jvmtiError DeregisterVerboseGCSubscriber(jvmtiEnv* jvmti_env, void *userData, void *subscription_id)\n

After the DeregisterVerboseGCSubscriber() API is called, no further calls are made to the previously registered subscriber function.

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_NULL_POINTER: The subscription_id parameter is null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is not valid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase.

Identifiers

JVMTI Extension Function identifier: com.ibm.DeregisterVerboseGCSubscriber Macro declaration in the ibmjvmti.h file: COM_IBM_DEREGISTER_VERBOSEGC_SUBSCRIBER

"},{"location":"interface_lang_management/","title":"Language Management","text":""},{"location":"interface_lang_management/#language-management-interface","title":"Language management interface","text":"

Eclipse OpenJ9\u2122 provides MXBean extensions to the standard java.lang.management API, which can be used to monitor and manage the Java\u2122 virtual machine. These extensions provide access to information about the state of the OpenJ9 VM and the environment in which it is running. The following tables list the MXBeans by package and describe the monitoring or management capabilities.

Package: com.ibm.lang.management

MXBean Description GarbageCollectorMXBean Discovers Garbage Collection (GC) operations (collection times, compactions, heap memory usage, and freed memory). JvmCpuMonitorMXBean Discovers CPU consumption by category (GC, JIT, or other threads). MemoryMXBean Discovers memory usage (minimum and maximum heap sizes, and shared classes cache sizes). MemoryPoolMXBean Discovers memory pool usage for specific GC policies. OperatingSystemMXBean Discovers information about the operating system (memory, CPU capacity/utilization). RuntimeMXBean Discovers information about the runtime environment (CPU load, Java process ID, and VM state) ThreadMXBean Discovers information about native thread IDs. UnixOperatingSystemMXBean Discovers information for Unix operating systems (memory, file descriptors, processors, processor usage, and hardware)

Package: com.ibm.virtualization.management

MXBean Description GuestOSMXBean Discovers CPU and memory statistics of a virtual machine or logical partition as seen by the Hypervisor. HypervisorMXBean Discovers whether the operating system is running on a hypervisor and provides information about the hypervisor.

Package: openj9.lang.management

MXBean Description OpenJ9DiagnosticsMXBean Configures and dynamically triggers dump agents.

For more information about using these MXBeans, read the API documentation. For Java 8, see the OpenJ9 Language Management API documentation.

"},{"location":"introduction/","title":"Getting started","text":""},{"location":"introduction/#getting-started-with-eclipse-openj9","title":"Getting started with Eclipse OpenJ9","text":"

Eclipse OpenJ9\u2122 is a high performance, scalable, Java\u2122 virtual machine (VM) implementation that is fully compliant with the Java Virtual Machine Specification.

At run time, the VM interprets the Java bytecode that is compiled by the Java compiler. The VM acts as a translator between the language and the underlying operating system and hardware. A Java program requires a specific VM to run on a particular platform, such as Linux\u00ae, z/OS\u00ae, or Windows\u2122.

This material provides information about the VM configuration and tuning options, together with the default settings. Follow the links provided for more detailed information.

"},{"location":"introduction/#configuring-your-system","title":"Configuring your system","text":"

Most Java applications should run on an OpenJDK that contains the OpenJ9 VM without changing anything on the underlying system. However, to get the most out of your system you might want to consider some configuration options. Read Configuring your system to learn more about the following options:

"},{"location":"introduction/#performance-tuning","title":"Performance tuning","text":"

OpenJ9 is configured to start with a set of default options that provide the optimal runtime environment for Java applications with typical workloads. However, if your application is atypical, you can improve performance by tuning the OpenJ9 VM. You can also improve performance by enabling hardware features or using specific APIs in your application code.

"},{"location":"introduction/#garbage-collection-policies","title":"Garbage collection policies","text":"

OpenJ9 includes several garbage collection policies. To learn more about these policies and the types of application workload that can benefit from them, see Garbage collection policies.

"},{"location":"introduction/#class-data-sharing","title":"Class data sharing","text":"

You can share class data between running VMs, which can reduce the startup time for a VM after the cache has been created. For more information, see Introduction to class data sharing.

"},{"location":"introduction/#native-data-operations","title":"Native data operations","text":"

If your Java application manipulates native data, consider writing your application to take advantage of methods in the Data Access Accelerator (DAA) API.

The following functions are provided:

You can gain a number of benefits by using the APIs provided:

For more information, see the API documentation.

"},{"location":"introduction/#cloud-optimizations","title":"Cloud optimizations","text":"

To improve the performance of applications that run in containers, try setting the following tuning options:

The OpenJ9 VM automatically detects when it is running in a docker container and uses a mechanism to detect when the VM is idle. When an idle state is detected, OpenJ9 runs a garbage collection cycle and releases free memory pages back to the operating system. The object heap is also compacted to make best use of the available memory for further application processing. Compaction is triggered by internal heuristics that look into the number of fragmented pages. Typically there is no need to force a compaction.

For cloud services that charge based on memory usage, maintaining a small footprint can generate cost savings. For more information about tuning options that control this process, see -XX:IdleTuningMinIdleWaitTime.

"},{"location":"introduction/#cryptographic-operations","title":"Cryptographic operations","text":"

OpenJDK uses the in-built Java cryptographic implementation by default. However, native cryptographic implementations typically provide better performance. OpenSSL is a native open source cryptographic toolkit for Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols, which is well established and used with many enterprise applications. For more information, see OpenSSL.

"},{"location":"introduction/#exploiting-gpus","title":"Exploiting GPUs","text":"

OpenJ9 provides both the CUDA4J API and the GPU API, which enables you to develop applications that can take advantage of graphics processing unit (GPU) processing for suitable functions, such as sorting arrays. You can also enable the JIT compiler to offload certain processing tasks to a GPU by specifying the -Xjit:enableGPU option on the command line. When enabled, the JIT compiler determines when to offload tasks based on performance heuristics.

GPU processing is supported only on Linux little-endian systems, such as x86-64 and IBM Power LE, and Windows x86-64 systems. For more information about enabling GPU processing, see Exploiting graphics processing units.

Special consideration is needed when using the WDDM driver model for GPUs on Windows. Using the WDDM driver model means the GPU is also used as a display device and as such is subject to the Timeout Detection and Recovery (TDR) mechanism of Windows. If you are running demanding GPU workloads, you should increase the timeout from the default 2 seconds. More detail may be found in NVIDIA's Installation Guide for Windows.

"},{"location":"introduction/#hardware-acceleration","title":"Hardware acceleration","text":"

On AIX\u00ae systems that contain the Nest accelerator (NX) co-processor, OpenJ9 can take advantage of the zlibNX library. This library is an enhanced version of the zlib compression library that supports hardware-accelerated data compression and decompression. The zlibNX library is supported on AIX version 7.2 TL4 and later and must be installed on the system. The Nest accelerator (NX) co-processor is available on IBM POWER9\u00ae systems. To learn more about zlibNX, see Data compression by using the zlibNX library.

"},{"location":"introduction/#runtime-options","title":"Runtime options","text":"

Runtime options are specified on the command line and include system properties, standard options, nonstandard (-X) options, and -XX options. For a detailed list of runtime options, see OpenJ9 command-line options

"},{"location":"introduction/#default-settings","title":"Default settings","text":"

If you do not specify any options on the command line at run time, the OpenJ9 VM starts with default settings that define how it operates. For more information about these settings, see Default settings for the OpenJ9 VM.

"},{"location":"introduction/#using-jlink","title":"Using jlink","text":"

On Java 11 and later, you can use the jlink utility to create a custom OpenJ9 runtime image, which allows you to optimize image size. If you do not require translations from the English language, the translation files can be removed to further optimize the size. You can achieve this by specifying the --exclude-files=**java_**.properties option when you run jlink. The default English java.properties file is unaffected.

"},{"location":"introduction/#using-jpackage","title":"Using jpackage","text":"

(Linux, macOS, and Windows only)

You can use the jpackage utility to package a Java application into a platform-specific package that includes all of the necessary dependencies. Full details of the tool are available at JEP 392: Packaging Tool. Instructions for using it and the various options available, are documented in the Oracle Tool Specifications: The jpackage Command.

"},{"location":"introduction/#troubleshooting","title":"Troubleshooting","text":"

The OpenJ9 diagnostic component contains extensive features to assist with problem determination. Diagnostic data is produced under default conditions, but can also be controlled by starting the VM with the -Xdump option or using the com.ibm.jvm.Dump API. You can also trace Java applications, methods, and VM operations by using the -Xtrace option.

To get started, read Diagnostic tools and data.

"},{"location":"jit/","title":"JIT Compiler","text":""},{"location":"jit/#the-jit-compiler","title":"The JIT compiler","text":"

The Just-In-Time (JIT) compiler is a key component of the Eclipse OpenJ9\u2122 VM that improves the performance of Java applications by compiling platform-neutral Java bytecode into native machine code at run time. Without the JIT, the VM has to interpret the bytecodes itself - a process that requires extra CPU and memory.

The JIT compiler doesn't compile every method that gets called because thousands of methods can be called at startup. Instead, OpenJ9 records the number of times a method is called. When the count reaches a pre-defined invocation threshold, JIT compilation is triggered. Once a method has been compiled by the JIT, the VM can call the compiled method rather than interpreting it.

"},{"location":"jit/#optimization-levels","title":"Optimization levels","text":"

The JIT compiler can compile a method at different optimization levels: cold, warm, hot, very hot (with profiling), or scorching. The hotter the optimization level, the better the expected performance, but the higher the cost in terms of CPU and memory.

For higher optimization levels, the VM uses a sampling thread to identify methods that continue to take a lot of time. Methods that consume more than 1% are compiled at hot. Methods that consume more than 12.5% are scheduled for a scorching compilation. However, before that happens the methods are compiled at very hot with profiling to collect detailed profile data that is used by the scorching compilation.

The higher optimization levels use special techniques such as escape analysis and partial redundancy elimination, or loop through certain optimization sequences more times. Although these techniques use more CPU and memory, the improved performance that is delivered by the optimizations can make the tradeoff worthwhile.

"},{"location":"jit/#troubleshooting","title":"Troubleshooting","text":"

The JIT compiler is enabled by default to optimize performance. However, if you experience a problem running your application, temporarily turning off the JIT will tell you whether the JIT is at fault.

Because JIT starts at the same time as the VM, you can only modify JIT behavior at startup.

There are a number of ways to disable the JIT:

Note: java.lang.Compiler is deprecated for removal in Java SE 9.

If turning off the JIT solves your problem, you can investigate JIT operations in more detail by using a number of options to control behavior.

Turning on verbose logging with the verbose suboption causes the JIT to record all compiler operations. However, the log file can be difficult to read because there are so many complex operations occuring in rapid succession. Follow these steps to simplify operations, which helps you pinpoint the root cause:

Turn off multiple compilation threads

The JIT compiler can use more than one compilation thread, which typically improves startup performance. The number of threads is determined by the VM, depending on the system configuration. You can turn off multiple threads by using the -XcompilationThreads option, which simplifies the output in the verbose log.

Lower the invocation threshold

When the invocation count is set to 0, the JIT compiles every method and your application will fail immediately when the method causing the problem is reached. You can alter the threshold with the count suboption.

Turn off inlining

Inlining is a complex process that generates larger and more complex code. To eliminate errors caused by these operations, use the disableInlining suboption.

Decrease the optimization levels

Use the optlevel suboption to gradually decrease the compiler optimization levels to see whether you can isolate the level at which your problem occurs.

More information about these suboptions and the command line syntax is covered in -Xjit.

"},{"location":"jit/#understanding-jit-verbose-logs","title":"Understanding JIT verbose logs","text":"

At first glance, a JIT verbose log can look very complex. To help you understand the log we'll look at JIT compiler operations when you run the java -version command.

The following option turns on verbose logging and directs output to a log file called vlogfile:

java -Xjit:verbose,vlog=vlogfile -version\n

The first section of the log includes lines that start with #INFO:, which provides information about the environment that the JIT is operating in. You can determine the version of the JIT and VM that you are using, and the type and number of processors that the JIT has access to.

#INFO:  _______________________________________\n#INFO:  Version Information:\n#INFO:       JIT Level  - e24e8aa9\n#INFO:       JVM Level  - 20180315_120\n#INFO:       GC Level   - e24e8aa9\n#INFO:  \n#INFO:  Processor Information:\n#INFO:       Platform Info:X86 Intel P6\n#INFO:       Vendor:GenuineIntel\n#INFO:       numProc=1\n#INFO:  \n#INFO:  _______________________________________\n#INFO:  AOT\n#INFO:  options specified:\n#INFO:       samplingFrequency=2\n#INFO:  \n#INFO:  options in effect:\n#INFO:       verbose=1\n#INFO:       vlog=vlogfile\n#INFO:       compressedRefs shiftAmount=0\n#INFO:       compressedRefs isLowMemHeap=1\n#INFO:  _______________________________________\n#INFO:  JIT\n#INFO:  options specified:\n#INFO:       verbose,vlog=vlogfile\n#INFO:  \n#INFO:  options in effect:\n#INFO:       verbose=1\n#INFO:       vlog=vlogfile\n#INFO:       compressedRefs shiftAmount=0\n#INFO:       compressedRefs isLowMemHeap=1\n#INFO:  StartTime: Apr 23 09:49:10 2018\n#INFO:  Free Physical Memory: 996188 KB\n#INFO:  CPU entitlement = 100.00\n

This section also shows the AOT and JIT options that are in force. The last few lines detail the start time of the compilation activity, how much free physical memory is available to the process, and the CPU entitlement.

The information section is followed by a sequence of lines that describe the methods that are being compiled, as well as other events significant to the operation of the JIT compiler.

Here is a typical line from the verbose log:

+ (cold) sun/reflect/Reflection.getCallerClass()Ljava/lang/Class; @ 00007FCACED1303C-00007FCACED13182 OrdinaryMethod - Q_SZ=0 Q_SZI=0 QW=1 j9m=00000000011E7EA8 bcsz=2 JNI compThread=0 CpuLoad=2%(2%avg) JvmCpu=0%\n

In this example:

Each line of output represents a method that is compiled.

The following example requests information about the performance of JIT compiler threads, with output written to vlogfile.

java -Xjit:verbose={compilePerformance},vlog=vlogfile -version\n

The output generated by using this command adds the values time and mem into each line, as shown in the following example:

+ (cold) java/lang/System.getEncoding(I)Ljava/lang/String; @ 00007F29183A921C-00007F29183A936D OrdinaryMethod - Q_SZ=0 Q_SZI=0 QW=1 j9m=0000000000F13A70 bcsz=3 JNI time=311us mem=[region=704 system=16384]KB compThread=0 CpuLoad=2%(2%avg) JvmCpu=0%\n

The following example can be used to create verbose output that includes lines to show when compilation for a method starts and ends, and any methods that are inlined during the compilation.

java '-Xjit:verbose={compileStart|compileEnd|inlining},count=5,vlog=vlogfile' -XcompilationThreads1 -version\n

Note: The suboptions count and -XcompilationThreads1 are included only to simplify the output for this example and are not recommended for production.

The following section is taken from the output and describes the compilation and inlining of one method java/lang/String.equals:

(warm) Compiling java/lang/String.equals(Ljava/lang/Object;)Z  OrdinaryMethod j9m=0000000001300B30 t=90 compThread=0 memLimit=262144 KB freePhysicalMemory=969 MB\n#INL: 7 methods inlined into 4dce72bd java/lang/String.equals(Ljava/lang/Object;)Z @ 00007F53190A3E40\n#INL: #0: 4dce72bd #-1 inlined 4dce72bd@22 -> 81670d20 bcsz=37 java/lang/String.lengthInternal()I\n#INL: #1: 4dce72bd #-1 inlined 4dce72bd@28 -> 81670d20 bcsz=37 java/lang/String.lengthInternal()I\n#INL: #2: 4dce72bd #-1 inlined 4dce72bd@104 -> bf62dcaf bcsz=182 java/lang/String.regionMatchesInternal(Ljava/lang/String;Ljava/lang/String;[C[CIII)Z\n#INL: #3: 4dce72bd #2 inlined bf62dcaf@121 -> bbb5af92 bcsz=39 java/lang/String.charAtInternal(I[C)C\n#INL: #4: 4dce72bd #2 inlined bf62dcaf@131 -> bbb5af92 bcsz=39 java/lang/String.charAtInternal(I[C)C\n#INL: #5: 4dce72bd #2 inlined bf62dcaf@156 -> bbb5af92 bcsz=39 java/lang/String.charAtInternal(I[C)C\n#INL: #6: 4dce72bd #2 inlined bf62dcaf@166 -> bbb5af92 bcsz=39 java/lang/String.charAtInternal(I[C)C\n#INL: 4dce72bd called 4dce72bd@120 -> f734b49c bcsz=233 java/lang/String.deduplicateStrings(Ljava/lang/String;Ljava/lang/String;)V\n#INL: 4dce72bd coldCalled 4dce72bd@104 -> bf62dcaf bcsz=182 java/lang/String.regionMatchesInternal(Ljava/lang/String;Ljava/lang/String;[C[CIII)Z\n#INL: 4dce72bd coldCalled 4dce72bd@104 -> bf62dcaf bcsz=182 java/lang/String.regionMatchesInternal(Ljava/lang/String;Ljava/lang/String;[C[CIII)Z\n+ (warm) java/lang/String.equals(Ljava/lang/Object;)Z @ 00007F53190A3E40-00007F53190A40D0 OrdinaryMethod - Q_SZ=277 Q_SZI=277 QW=1667 j9m=0000000001300B30 bcsz=127 GCR compThread=0 CpuLoad=2%(2%avg) JvmCpu=0%\n

The first line is included as a result of setting the compileStart suboption and shows the start of the warm method compilation:

(warm) Compiling java/lang/String.equals(Ljava/lang/Object;)Z OrdinaryMethod j9m=0000000001300B30 t=90 compThread=0 memLimit=262144 KB freePhysicalMemory=969 MB\n

Similarly, the last line shows the successful compilation of this method, as denoted by the +:

+ (warm) java/lang/String.equals(Ljava/lang/Object;)Z @ 00007F53190A3E40-00007F53190A40D0 OrdinaryMethod - Q_SZ=277 Q_SZI=277 QW=1667 j9m=0000000001300B30 bcsz=127 GCR compThread=0 CpuLoad=2%(2%avg) JvmCpu=0%\n

The lines inbetween that start with #INL describe the inlining operations that took place. A total of 7 methods were inlined into java/lang/String.equals:

The first three methods (#0, #1, #2) are inlined into the top level method, denoted as #-1:

#INL: #0: 4dce72bd #-1 inlined 4dce72bd@22 -> 81670d20 bcsz=37 java/lang/String.lengthInternal()I\n#INL: #1: 4dce72bd #-1 inlined 4dce72bd@28 -> 81670d20 bcsz=37 java/lang/String.lengthInternal()I\n#INL: #2: 4dce72bd #-1 inlined 4dce72bd@104 -> bf62dcaf bcsz=182 java/lang/String.regionMatchesInternal(Ljava/lang/String;Ljava/lang/String;[C[CIII)Z\n

The next four methods (#3, #4, #5, #6) are inlined into the method denoted by #2.

#INL: #3: 4dce72bd #2 inlined bf62dcaf@121 -> bbb5af92 bcsz=39 java/lang/String.charAtInternal(I[C)C\n#INL: #4: 4dce72bd #2 inlined bf62dcaf@131 -> bbb5af92 bcsz=39 java/lang/String.charAtInternal(I[C)C\n#INL: #5: 4dce72bd #2 inlined bf62dcaf@156 -> bbb5af92 bcsz=39 java/lang/String.charAtInternal(I[C)C\n#INL: #6: 4dce72bd #2 inlined bf62dcaf@166 -> bbb5af92 bcsz=39 java/lang/String.charAtInternal(I[C)C\n

Here's how to interpret the line for #INL: #0::

The method is inlined into 4dce72bd, where 4dce72bd is an internal pointer that corresponds to this method (in this case, java/lang/String.equals(Ljava/lang/Object;)Z). The value @22 at the end of the pointer is a bytecode index, which describes the bytecode index of the call that is being inlined. The call is 81670d20 bcsz=37 java/lang/String.lengthInternal()I, which shows the corresponding internal pointer, bytecode size (bcsz) and the name of the method that got inlined. Going through the #INL output line by line then:

java/lang/String.lengthInternal()I got inlined into its caller 4dce72bd at bytecode index @22.\njava/lang/String.lengthInternal()I also got inlined into its caller 4dce72bd at bytecode index @28.\njava/lang/String.regionMatchesInternal(...) got inlined at call reference 4dce72bd at bytecode index @104.\n

Then 4 distinct calls to java/lang/String.charAtInternal(I[C)C were also inlined into java/lang/String.regionMatchesInternal(...) :

#3 at bytecode index @121 of regionMatchesInternal\n#4 at bytecode index @131 of regionMatchesInternal\n#5 at bytecode index @156 of regionMatchesInternal\n#6 at bytecode index @166 of regionMatchesInternal\n

These were all the calls that the inliner decided to inline into the method being compiled. There is some additional output that describes calls to methods that weren't inlined:

#INL: 4dce72bd called 4dce72bd@120 -> f734b49c bcsz=233 java/lang/String.deduplicateStrings(Ljava/lang/String;Ljava/lang/String;)V\n#INL: 4dce72bd coldCalled 4dce72bd@104 -> bf62dcaf bcsz=182 java/lang/String.regionMatchesInternal(Ljava/lang/String;Ljava/lang/String;[C[CIII)Z\n#INL: 4dce72bd coldCalled 4dce72bd@104 -> bf62dcaf bcsz=182 java/lang/String.regionMatchesInternal(Ljava/lang/String;Ljava/lang/String;[C[CIII)Z\n

While the output does not specifically say why these methods were not inlined, the relatively larger bytecode size (bcsz=233) probably prevented the first method from being inlined. It's possible that, at a higher optimization level than cold, this deduplicateStrings method may get inlined. The coldCalled label on the last two lines, however, indicate that these calls are located in a part of the method that has not ever been executed, so the JIT decided that inlining those last two methods will probably increase compile time without much promise that it will improve performance.

By reading the log in this way you can reconstruct the tree of inlines that are taking place as the compilation proceeds. You can see which methods are being inlined and which methods are not being inlined.

"},{"location":"jit/#see-also","title":"See also","text":""},{"location":"jitserver/","title":"JITServer technology","text":""},{"location":"jitserver/#jitserver-technology","title":"JITServer technology","text":"

Linux\u00ae on x86, Linux on IBM Power\u00ae systems, Linux on AArch64 and Linux on IBM Z\u00ae systems (64-bit only)

JITServer technology decouples the JIT compiler from the VM and lets the JIT compiler run remotely in its own process. This mechanism prevents your Java\u2122 application suffering possible negative effects due to CPU and memory consumption caused by JIT compilation.

This technology can improve quality of service, robustness, and performance of Java applications. You might want to try this technology if the following criteria are met:

For more details about JITServer technology, including its advantages and disadvantages and when best to use it, see blog posts such as the following:

For a more in-depth description of the JITServer design and implementation, see the following research paper:

"},{"location":"jitserver/#using-jitserver-technology","title":"Using JITServer technology","text":"

JITServer technology is not enabled by default: you must explicitly invoke it. Running OpenJ9 without either of the following options launches it as a regular VM with embedded JIT compilation.

"},{"location":"jitserver/#launch-eclipse-openj9-in-client-mode","title":"Launch Eclipse OpenJ9 in client mode","text":"

Use the following command-line option to launch Eclipse OpenJ9\u2122 in client mode. In this mode, the VM sends compilation requests to an available JITServer. The client operates as a regular VM with its own JIT compiler if a server is not available.

 -XX:+UseJITServer\n
"},{"location":"jitserver/#launch-openj9-in-server-mode","title":"Launch OpenJ9 in server mode","text":"

Use the following command to start a JITServer process that listens for incoming compilation requests:

jitserver\n
"},{"location":"jitserver/#configuring-jitserver-technology","title":"Configuring JITServer technology","text":"

You can use command line options to further configure the JITServer and the client VM processes. For example:

If a JITServer server crashes, the client is forced to perform compilations locally. You can change this behavior by using the -XX:[+|-]RequireJITServer option so that the client crashes with an assert when it detects that the server is unavailable. This feature is useful when you are running a test suite with JITServer enabled and you want the server crash to cause the test to fail.

"},{"location":"jitserver/#security","title":"Security","text":"

You can encrypt network communication between the client VM and JITServer by using OpenSSL 1.0.x, 1.1.x, or 3.x. To enable encryption, you specify the private key and the certificate at the server and use the certificate at the client. For more information, see -XX:JITServerSSLCert / -XX:JITServerSSLKey / -XX:JITServerSSLRootCerts.

"},{"location":"jitserver/#tuning-jitserver","title":"Tuning JITServer","text":"

For best practices regarding JITServer configuration and tuning, see the document JITServer tuning and practical considerations.

"},{"location":"jitserver/#building-a-jdk-with-jitserver-technology","title":"Building a JDK with JITServer technology","text":"

If you want to build a JDK with JITServer technology, see Appendix A of Free your JVM from the JIT with JITServer Technology.

"},{"location":"jitserver/#see-also","title":"See also","text":""},{"location":"jitserver_tuning/","title":"JITServer tuning","text":""},{"location":"jitserver_tuning/#jitserver-tuning-and-practical-considerations","title":"JITServer tuning and practical considerations","text":""},{"location":"jitserver_tuning/#server-caches","title":"Server caches","text":""},{"location":"jitserver_tuning/#client-session-caches","title":"Client-session caches","text":"

Multiple client JVMs can be connected at the same time to a single JIT server. For each client, the server maintains a client-session cache with information about the environment the client is running in (Java classes, class hierarchy, profiling information, JVM options, and so on). Typically, the information in these caches is kept separately per client. However, if you specify the -XX:+JITServerShareROMClasses option, the read-only part of the Java classes (ROMClasses in Eclipse OpenJ9\u2122 parlance) is shared between the different clients. This option can generate memory savings at the server when the connected clients run identical or similar Java applications.

The client-session caches are deleted when the clients terminate, but this can happen only if the clients are shutdown gracefully, giving them the opportunity to send a termination message to the server. To address the scenario of clients ending abruptly, the server also deletes the cache for a client that hasn\u2019t issued a compilation request for 1000 minutes, or 5 minutes under memory pressure. If needed, you can change these values with the following options:

-Xjit:oldAge=<time-in-ms>,oldAgeUnderLowMemory=<time-in-ms>\n
"},{"location":"jitserver_tuning/#jitserver-aot-cache","title":"JITServer AOT cache","text":"

The JITServer technology can cache AOT compiled methods at the server. The JITServer can, therefore, avoid carrying out an AOT compilation when a compatible AOT method body already exists in the cache, thereby saving CPU resource and improving remote compilation latency. This mechanism uses the dynamic AOT technology, but does not require a shared class cache at the client.

When the JITServer receives an AOT compilation request, it checks its AOT cache for a compatible compiled method body. If one is not found, the server performs the AOT compilation, sends the response to the client JVM, then serializes the compiled method and stores it in its local AOT cache, for future use. If a compatible compiled method is found, the server sends the client the serialized compiled method from its cache, thus avoiding a compilation. The client deserializes the response and loads the compiled method as a regular dynamic AOT code.

This JITServer AOT caching feature is by default enabled at the server but disabled for the JITServer clients. To enable this feature for the JITServer clients, specify the -XX:+JITServerUseAOTCache command-line option for each client.

A JITServer instance can have several AOT caches, each with its own name. These named AOT caches address the situation when client JVMs with significantly different profiles of execution use the same JITServer instance. A client JVM can indicate a specific AOT cache that it wants to use by providing its name with the following command-line option -XX:JITServerAOTCacheName=<cache_name>. If the client doesn't specify a name for the AOT cache, the server uses a cache named default.

The maximum amount of memory that all the AOT cache instances combined can use at the server is 300 MB, by default. You can change this value by using the -XX:JITServerAOTmx=<size> option. When the cache size reaches the specified limit, new clients cannot create new AOT cache instances or add new compiled methods to the existing AOT cache instances.

Typically, each JITServer server populates its own AOT caches independently of other existing servers. To help with JITServer auto-scaling, and in particular with scaling down to zero, JITServer instances can save their AOT caches to files by setting the -XX:+JITServerAOTCachePersistence command-line option. Other JITServer instances that are started later can load the existing AOT cache files into their memory, and then continue to gradually add new AOT compiled methods. Saving an AOT cache to a file is performed periodically based on the following conditions:

Current limitation:

"},{"location":"jitserver_tuning/#number-of-concurrent-clients","title":"Number of concurrent clients","text":"

The amount of CPU and memory resources consumed by the server is expected to increase with the number of connected clients. Finding the appropriate number of clients to connect to a server is a tricky proposition that depends on many factors, such as the number of methods that need to be compiled by the clients, optimization levels for these compilations, how clients are started (staggered or not), and how clients are shutdown (gracefully or not).

Generally, you should have 10-20 JVMs simultaneously connected to a server with 1-2 GB of memory. With respect to CPU resources, in Kubernetes you might want to set a low \"request\" value at the server (1-2 vCPUs) and a larger \"limit\" value (4-8 vCPUs) in order to soak all those idle cycles. It is possible to connect even more clients to one server instance if memory and CPU resources are increased, but in general, two medium-sized server instances that are placed on different nodes are better than a single, larger server.

"},{"location":"jitserver_tuning/#alleviating-cpu-congestion-at-the-server","title":"Alleviating CPU congestion at the server","text":"

When too many clients connect to the server, the server can become flooded with compilation requests, leading to increased compilation times and slower start-up/ramp-up for applications. A client JVM issues most of its compilation requests during the start-up phase and ramp-up phase of an application, when load is first applied to it. Thus, from the CPU consumption point of view what matters is the number of clients that start-up or ramp-up concurrently. To alleviate the CPU strain on the server, you can start the client JVMs in a staggered fashion, rather than all at the same time. Sometimes the staggering happens naturally; for instance, when using Kubernetes horizontal pod auto-scaling, additional application instances are started gradually as the load increases.

Another idea is to use the -Xjit:enableJITServerHeuristics command-line option at the clients. When this option is present, the client JVMs share some of the compilation burden by performing the cheap compilations locally and send only expensive compilations to the server. What constitutes a cheap compilation is determined by JIT heuristics that look at the method size, optimization level and the amount of CPU and memory available to the JVM.

"},{"location":"jitserver_tuning/#avoiding-memory-shortages-at-the-server","title":"Avoiding memory shortages at the server","text":"

Roughly speaking, the server uses two types of memory: 1. \"Scratch\" memory. This memory is allocated during a compilation (for JIT internal data structures) and released to the operating system at the end of the compilation. 2. \"Persistent\" memory. This memory is used for client-session caches and gets deleted only when a client terminates gracefully (or when the JITServer purging mechanism is triggered).

The total amount of scratch memory at any particular moment depends on how many compilations are in progress and how expensive those compilations are. To reduce this amount, you can start the clients in a staggered fashion as suggested previously, or reduce the number of compilation threads per client. Note that the latter already happens automatically: when the server senses that it is about to run out of memory, it provides feedback to the connected clients to reduce their number of active compilation threads.

To reduce the amount of persistent memory, you can use the techniques that are described in section Server caches.

"},{"location":"jitserver_tuning/#traffic-encryption","title":"Traffic encryption","text":"

Enabling network encryption can increase the CPU overhead, both at the client and at the server. For this reason, you should turn on encryption only if needed. Note that some technologies like Istio, Weave, Linkerd, Calico, Cilium already encrypt all network traffic, so using JITServer encryption might be redundant.

"},{"location":"jitserver_tuning/#minimizing-application-stalls","title":"Minimizing application stalls","text":"

Usually, the compilation threads in OpenJ9 JVM execute in parallel with Java application threads. However, for correctness reasons a small number of compilations are performed synchronously, meaning that Java application threads have to wait for the compilation result before being allowed to execute the method being compiled. Since remote compilations typically take longer to complete due to network latency, application stalls that are caused by synchronous compilations can be more severe in a JITServer setting. If this becomes a problem, you should add the following command line option at the client:

-XX:+JITServerLocalSyncCompiles\n

This option instructs the client JVM to perform the synchronous compilations locally, at a low optimization level (thus the compilation is relatively quick), and to follow-on with remote asynchronous recompilations at a higher optimization level to avoid any performance loss.

"},{"location":"jitserver_tuning/#session-affinity","title":"Session affinity","text":"

For technical reasons, a client JVM must use a single JITServer at a time. In a Kubernetes environment, where a JITServer service can be backed up by several server instances, you can satisfy this requirement by using session affinity. Note that if a server crashes (or gets terminated by the Kubernetes controller) the clients can connect to another server instance. This scenario imposes some performance penalty because the client-session caches that the server maintains need to be built anew. Following is an example of a Kubernetes service definition that uses sessionAffinity:

apiVersion: v1\nkind: Service\nmetadata:\n  name: jitserver\nspec:\n  type: ClusterIP\nselector:\n    app: jitserver\n  ports:\n    - protocol: TCP\n      port: 38400\n      targetPort: 38400\n  sessionAffinity: ClientIP\n  sessionAffinityConfig:\n    clientIP:\n      timeoutSeconds: 86400\n
"},{"location":"jitserver_tuning/#resilience","title":"Resilience","text":"

If the client JVM does not find a compatible server to connect to, compilations are performed locally, by the client itself. To account for the case where the server is temporarily unavailable (for example, server crash followed by Kubernetes launching another server instance), from time to time the client retries to connect to a server at the indicated address and port. The retry mechanism uses an exponential back-off where the retry interval is doubled with each unsuccessful attempt.

"},{"location":"jitserver_tuning/#monitoring","title":"Monitoring","text":""},{"location":"jitserver_tuning/#performance-metrics","title":"Performance metrics","text":"

You can enable the provision of performance metrics by specifying the -XX:+JITServerMetrics command-line option. After enabling this option, you can use a monitoring tool that follows the OpenMetrics standard, such as Prometheus, to collect the data by issuing an HTTP GET request to the following url: http://<jitserveraddress>:<port>/metrics.

Note: There is a limit of four concurrent GET requests at any given time.

You can use the -XX:JITServerMetricsSSLKey and -XX:JITServerMetricsSSLCert options to encrypt the data with TLS or SSL.

For more information, including the types of metrics that are provided, see the -XX:[+|-]JITServerMetrics topic.

"},{"location":"jitserver_tuning/#verbose-logging","title":"Verbose logging","text":"

You can inspect the behavior of a JITServer instance by using the OpenJ9 verbose logging facility. Note that if the name of the verbose log is not specified, the relevant information is printed to stderr. When you use the -XX:+JITServerLogConnections command-line option, the server prints a message to the verbose log every time a new client JVM connects to it or disconnects from it. This is an easy way to determine that the clients are able to reach the server. Example of output:

#JITServer: t= 74232 A new client (clientUID=14692403771747196083) connected. Server allocated a new client session.\n#JITServer: t= 74282 A new client (clientUID=2599593246759846167) connected. Server allocated a new client session.\n#JITServer: t= 86281 Client (clientUID=14692403771747196083) disconnected. Client session deleted\n

The server has a heart-beat thread that periodically prints to the verbose log information related to the number of clients connected, the number of active compilation threads, the amount of CPU used, the amount of available memory and the number of times the internal server caches have been cleared. This last bit of information is important for diagnosing performance problems. The heart-beat information is enabled with the following option:

-Xjit:statisticsFrequency=<period-in-ms>\n

Example of output:

#JITServer: CurrentTime: Aug 06 17:25:15 2021\n#JITServer: Compilation Queue Size: 0\n#JITServer: Number of clients : 2\n#JITServer: Total compilation threads : 63\n#JITServer: Active compilation threads : 2\n#JITServer: Physical memory available: 14299 MB\n#JITServer: CpuLoad 206% (AvgUsage 25%) JvmCpu 113%\n...\n

A value greater than 0 for the Compilation Queue Size is a sign that the server is overloaded. Compilation requests that wait in the compilation queue face greater delays and run the risk of exceeding network timeouts. To avoid this scenario, you can reduce the number of connected clients, use the techniques that are described in section Alleviating CPU congestion at the server, or increase the number of compilation threads at the server by using the -XcompilationThreads option.

Increasing the maximum number of client threads can improve performance in high network latency settings because there can be more in-progress concurrent compilation requests. Increasing the number of threads at the server can improve performance if the server has many CPU cores available and serves a large number of clients concurrently.

More detailed diagnostics can be obtained with the option -Xjit:verbose={JITServer},verbose={compilePerformance}, which is typically used for debugging server behavior.

"},{"location":"legal/","title":"Legal","text":""},{"location":"legal/#legal","title":"Legal","text":"

License agreement, notices, copyright, and trademark information for the user documentation.

"},{"location":"legal/#license-agreement","title":"License agreement","text":"

See License

"},{"location":"legal/#notices","title":"Notices","text":"

See Notices

"},{"location":"legal/#copyright-information","title":"Copyright information","text":"

Eclipse OpenJ9\u2122 documentation is subject to the following copyright:

Copyright (c) 2017, 2024 IBM Corp.\n
"},{"location":"legal/#trademarks","title":"Trademarks","text":"

IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at \"Copyright and trademark information\" here.

Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates.

Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.

Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both.

"},{"location":"messages_intro/","title":"OpenJ9 messages","text":""},{"location":"messages_intro/#eclipse-openj9-vm-messages","title":"Eclipse OpenJ9 VM messages","text":"

Messages are issued by the Eclipse OpenJ9\u2122 virtual machine (VM) in response to certain conditions. Understanding what the messages mean can help you with problem determination.

"},{"location":"messages_intro/#message-categories","title":"Message categories","text":"

There are three main categories of message:

Information Information messages provide information about VM processing. For example, a dump information message is typically issued when a dump agent requests a dump. Warning Warning messages are issued by the VM to indicate conditions that might need user intervention. Error Error messages are issued by the VM when normal processing cannot proceed, because of unexpected conditions.

OpenJ9 virtual machine messages have the following format:

    JVM<type><number><code>\n

where:

These messages can help you with problem determination.

By default, all error and some information messages are routed to the system log and also written to stderr or stdout. The specific information messages are JVMDUMP039I, JVMDUMP032I, and JVMDUMP033I, which provide valuable additional information about dumps produced by the VM. To route additional message types to the system log, or turn off message logging to the system log, use the -Xsyslog option. The -Xsyslog option does not affect messages written to the standard error stream (stderr). See OpenJ9 command-line options.

Note: The -Xsyslog option replaces the -Xlog option in OpenJ9 version 0.24.0.

"},{"location":"messages_intro/#finding-logged-messages","title":"Finding logged messages","text":"

Logged messages can be found in different locations, according to platform.

"},{"location":"messages_intro/#finding-aix-messages","title":"Finding AIX messages","text":"

On AIX\u00ae, messages are logged by the syslog daemon (/usr/sbin/syslogd). Logged messages are written to the syslog file that is configured in /etc/syslog.conf. If the syslog daemon is not running, logged messages are lost.

You can redirect messages from the syslog daemon to the AIX error log facility by performing the following configuration steps:

  1. Set up a redirect in the file syslog.conf so that syslog messages are sent to the error log, by adding the following line:
        user.debug errlog\n
  1. If syslogd is already running, reload the updated configuration by running the following command:
        refresh -s syslogd\n
  1. The updated configuration is used each time syslogd starts. 4. Use the AIX errpt command or the System Management Interface Tool (SMIT) to read the messages sent to the error log.

For more information about AIX logging, see: Error-logging overview.

"},{"location":"messages_intro/#finding-linux-messages","title":"Finding Linux messages","text":"

On Linux\u00ae, messages are logged by the syslog daemon. To find where messages are logged, check the syslog configuration file.

"},{"location":"messages_intro/#finding-macos-messages","title":"Finding macOS messages","text":"

On macOS\u00ae, messages are logged by the syslog daemon. However, on Sierra and High Sierra, syslog does not work. If /var/log/system.log is not available, Console.app can be used instead.

"},{"location":"messages_intro/#finding-windows-messages","title":"Finding Windows messages","text":"

On Windows\u2122, messages are logged in the application events section of the event viewer.

"},{"location":"messages_intro/#finding-zos-messages","title":"Finding z/OS messages","text":"

On z/OS\u00ae, messages are sent to the operator console. To see the messages, go from the ispf panel to the sdsf panel, then open the log panel.

"},{"location":"messages_intro/#obtaining-detailed-message-descriptions","title":"Obtaining detailed message descriptions","text":"

Detailed message information is available to help with problem diagnosis.

Understanding the warning or error message issued by the VM can help you diagnose problems. All warning and error messages issued by the VM are listed by type in the messages guide: IBM\u00ae VM messages.

The messages, error codes, and exit codes in this guide apply to multiple versions of the VM.

Note: If the VM fills all available memory, the message number might be produced without a description for the error that caused the problem. Look for the message number in the relevant section of the J9 VM Messages guide to see the message description and the additional information provided.

"},{"location":"migrating11to17/","title":"Migrating from Java 11 to Java 17","text":""},{"location":"migrating11to17/#migrating-from-java-11-to-java-17","title":"Migrating from Java 11 to Java 17","text":"

Support for OpenJDK 17 was added in Eclipse OpenJ9\u2122 version 0.29.1.

The following new OpenJ9 changes apply when OpenJ9 is built with Java SE 17 class libraries. This information exists elsewhere in the documentation but is summarized here for convenience.

"},{"location":"migrating11to17/#support-for-jdk-enhancement-proposals-jep","title":"Support for JDK enhancement proposals (JEP)","text":"

The new JEPs that are supported are listed in the following topics:

"},{"location":"migrating11to17/#new-openj9-features-and-changes","title":"New OpenJ9 features and changes","text":"

The following table lists the new OpenJ9 features and notable changes with the OpenJ9 release in which they were added:

Features and changes OpenJ9 release Linux builds for all platforms use gcc 10.3 instead of gcc 7.5. See the list of build environments. 0.33.0 The default operating system stack size on x64 platforms is increased from 256 KB to 512 KB to accommodate vector support. You can change the operating system stack size by using the -Xmso option. 0.33.0"},{"location":"migrating17to21/","title":"Migrating from Java 17 to Java 21","text":""},{"location":"migrating17to21/#migrating-from-java-17-to-java-21","title":"Migrating from Java 17 to Java 21","text":"

Support for OpenJDK 21 was added in Eclipse OpenJ9\u2122 version 0.42.0.

The following new OpenJ9 changes apply when OpenJ9 is built with Java\u00ae SE 21 class libraries. This information exists elsewhere in the documentation but is summarized here for convenience.

"},{"location":"migrating17to21/#support-for-jdk-enhancement-proposals-jep","title":"Support for JDK enhancement proposals (JEP)","text":"

The new JEPs that are supported are listed in the following topics:

"},{"location":"migrating17to21/#new-openj9-features-and-changes","title":"New OpenJ9 features and changes","text":"

The following table lists the new OpenJ9 features and notable changes with the OpenJ9 release in which they were added:

Features and changes OpenJ9 release The OpenJ9 jextract tool is removed. 0.41.0 New -XX:[+\\|-]ShowCarrierFrames option added. You can use the -XX:+ShowCarrierFrames option to add the stack trace of the carrier thread in addition to the virtual thread stack trace to the Throwable.getStackTrace() method, if an exception occurs. 0.41.0 New -XX:ContinuationCache option added. You can optimize the virtual thread performance by tuning the continuation tier 1 and 2 cache size with the -XX:ContinuationCache option 0.41.0 Warnings are issued when the agents are loaded dynamically into a running VM after startup without specifying the -XX:+EnableDynamicAgentLoading option and the same agents were not loaded before. 0.41.0 Linux\u00ae builds for all platforms, except for the AArch64 64-bit, use gcc 11.2 instead of gcc 10.3. Linux AArch64 64-bit continues to use gcc 10.3. The Windows Visual Studio compiler is also changed from Microsoft Visual Studio 2019 to Microsoft Visual Studio 2022. See the list of build environments. 0.42.0"},{"location":"migrating8to11/","title":"Migrating from Java 8 to Java 11","text":""},{"location":"migrating8to11/#migrating-from-java-8-to-java-11","title":"Migrating from Java 8 to Java 11","text":"

Support for OpenJDK 11 was added in Eclipse OpenJ9\u2122 version 0.10.0.

The following new OpenJ9 features and notable changes apply when OpenJ9 is built with Java SE 11 class libraries. This information exists elsewhere in the documentation but is summarized here for convenience.

"},{"location":"migrating8to11/#support-for-jdk-enhancement-proposals-jep","title":"Support for JDK enhancement proposals (JEP)","text":"

The new JEPs that are supported are listed in the following topics:

"},{"location":"migrating8to11/#new-openj9-features-and-changes","title":"New OpenJ9 features and changes","text":"

The following table lists the new OpenJ9 features and notable changes with the OpenJ9 release in which they were added:

Features and changes OpenJ9 release The path that is specified by the default -Xoptionsfile value is the <java_home>/lib directory, where <java_home> is the directory for your runtime environment. For Java 8, the path is the VM directory that is listed in Directory conventions. First release Low-overhead heap profiling is supported. JEP 331 provides a mechanism for sampling Java heap allocations with a low overhead via the JVM Tool Interface (JVMTI). Restrictions: JEP 331 is implemented for OpenJ9 with the following limitations: 0.15.0 OpenSSL support for the ChaCha20 and ChaCha20-Poly1305 algorithms is available. The version of OpenSSL must be version 1.1.x or later. For more information, see -Djdk.nativeChaCha20. 0.15.0 The -verbose:module option, which writes information to stderr for each module that is loaded and unloaded, is now supported. 0.25.0 The default value of the -XX:MaxDirectMemorySize option, which limits the amount of heap memory that is used for direct byte buffers, is the same as the maximum heap size. For JDK 8, the VM default value is 87.5% of the maximum heap size. 0.32.0 OpenSSL support is added for the following algorithms:The version of OpenSSL must be version 1.1.1 or later for the -Djdk.nativeXDHKeyAgreement and -Djdk.nativeXDHKeyGen algorithms. 0.40.0"},{"location":"openj9_defaults/","title":"Default settings","text":""},{"location":"openj9_defaults/#default-settings-for-the-eclipse-openj9-vm","title":"Default settings for the Eclipse OpenJ9\u2122 VM","text":"

The following tables provide a quick reference to the default settings for the VM when it is first installed.

The last 2 columns show whether the default setting can be changed by a command-line parameter or an environment variable. Note that if both are set, the command-line parameter always takes precedence.

VM setting Default Command line Env. variable Javadump Enabled yes yes Heapdump Disabled yes yes System dump Enabled yes yes Snap traces Enabled yes yes JIT dump Enabled yes yes Verbose output Disabled yes no Compressed references (See Note 1) yes yes Boot classpath search Disabled yes no JNI checks Disabled yes no Remote debugging Disabled yes no Strict conformance checks Disabled yes no Quickstart Disabled yes no Remote debug info server Disabled yes no Reduced signaling Disabled yes no Signal handler chaining Enabled yes no Classpath Not set yes yes Class data sharing Disabled yes no Accessibility support Enabled no yes JIT compiler Enabled yes yes AOT compiler (See Note 2) Enabled yes no JIT debug options Disabled yes no Java2D max size of fonts with algorithmic bold 14 point no yes Java2D use rendered bitmaps in scalable fonts Enabled no yes Java2D freetype font rasterizing Enabled no yes Java2D use AWT fonts Disabled no yes

Notes:

  1. On AIX\u00ae, Linux\u00ae, macOS\u00ae x86, and Windows\u2122: Enabled for -Xmx values \u2264 57 GB, otherwise disabled.

    On z/OS\u00ae: Enabled for -Xmx values \u2264 25 GB, otherwise disabled. With APAR OA49416, enabled for -Xmx values \u2264 57 GB.

    On macOS AArch64 (Apple silicon): Disabled.

  2. AOT is not used by the VM unless shared classes are also enabled.

VM setting AIX Linux macOS Windows z/OS Command line Env. variable Default locale None None None N/A None no yes Time to wait before starting plug-in N/A Zero N/A N/A N/A no yes Temporary directory /tmp /tmp /tmp c:\\temp /tmp no yes Plug-in redirection None None None N/A None no yes IM switching Disabled Disabled Disabled N/A Disabled no yes IM modifiers Disabled Disabled Disabled N/A Disabled no yes Thread model N/A N/A N/A N/A Native no yes Initial stack size for Java Threads (32/64-bit). Use -Xiss<size> 2 KB 2 KB 2 KB 2 KB 2 KB yes no Maximum stack size for Java Threads (32-bit). Use -Xss<size> 320 KB 320 KB N/A 320 KB 320 KB yes no Maximum stack size for Java Threads (64-bit). Use -Xss<size> 1024 KB 1024 KB 1024 KB 1024 KB 1024 KB yes no Stack size for OS Threads (32-bit). Use -Xmso<size> 256 KB 256 KB N/A 32 KB 256 KB yes no Stack size for OS Threads (64-bit). Use -Xmso<size> 512 KB 512 KB (256 KB on IBM Z\u00ae) Earlier Java versions: 256 KB (512 KB on PPC) Architecture: x86: 512 KB, AArch64 (Apple silicon): 256 KB Earlier Java versions: 256 KB 512 KB Earlier Java versions: 256 KB 1 MB yes no Initial heap size. Use -Xms<size> 8 MB 8 MB 8 MB 8 MB 8 MB yes no Maximum Java heap size. Use -Xmx<size> See Notes See Notes See Notes See Notes See Notes yes no Page size for the Java object heap and code cache (For restrictions, see the -Xlp:codecache and -Xlp:objectheap options). Operating system default Architecture: x86: 2 MB, IBM Z: 1 MB, Other architectures: Operating system default Architecture: x86: 4 KB, AArch64 (Apple silicon): 16 KB Operating system default 1M pageable yes no

Notes:

The default value of -Xmx :

Available memory is defined as being the smallest of two values: The real or physical memory or the RLIMIT_AS value.

"},{"location":"openj9_directories/","title":"Directory conventions","text":""},{"location":"openj9_directories/#directory-conventions","title":"Directory conventions","text":"

The following tables provide a quick reference to the Eclipse OpenJ9\u2122 VM directory location on different Java\u2122 versions and different platform architectures. Some pages refer to the VM directory location as <vm_dir>.

Operating system Java 8 Java 11 and later AIX\u00ae <install_dir>/jre/lib/ppc[64]/default <install_dir>/ Linux\u00ae <install_dir>/jre/lib/<arch>/default <install_dir>/ macOS\u00ae <install_dir>/jre/lib/default <install_dir>/ Windows\u2122 <install_dir>\\jre\\bin\\default <install_dir>\\ z/OS\u00ae <install_dir>/jre/lib/s390[x]/default <install_dir>/

Where:

Architecture Value of <arch> x86 32-bit i386 x86 64-bit x86-64 IBM POWER\u00ae 32-bit (Big Endian) ppc IBM POWER 64-bit (Big Endian) ppc64 IBM POWER 64-bit (Little Endian) ppc64le IBM Z\u00ae 31-bit s390 IBM Z 64-bit s390x"},{"location":"openj9_newuser/","title":"New to OpenJ9?","text":""},{"location":"openj9_newuser/#new-to-eclipse-openj9","title":"New to Eclipse OpenJ9?","text":"

The Eclipse OpenJ9\u2122 virtual machine (VM) implements the Java Virtual Machine Specification. Most Java applications should run on an OpenJDK that contains the OpenJ9 VM without changing anything. However, because it is an independent implementation there are some differences compared to the HotSpot VM, which is the default OpenJDK VM and is also included in an Oracle JDK.

"},{"location":"openj9_newuser/#command-line-options","title":"Command-line options","text":"

Although OpenJ9 implements its own command-line interface, many HotSpot options are recognized and accepted by the VM for compatibility. Any -XX: options that are not recognized by the VM are ignored by default, which prevents an application failing to start. You can turn off this behavior with the -XX:-IgnoreUnrecognizedXXColonOptions option.

For a list of compatible options, equivalent options, and options that need to be set for compatibility, see Switching to OpenJ9.

"},{"location":"openj9_newuser/#garbage-collection-policies","title":"Garbage collection policies","text":"

Eclipse OpenJ9 has a number of garbage collection (GC) policies designed around different types of applications and workloads. By default, OpenJ9 uses the Generational Concurrent (gencon) GC policy, which is best suited for transactional applications that have many short-lived objects. The policy aims to minimize GC pause times without compromising throughput. If you are using Java 8, the gencon policy is similar to the HotSpot CMS (concurrent mark sweep). If you are using Java 11, the OpenJ9 balanced (balanced) policy is most similar to the default HotSpot policy.

If you have a different type of workload, you might want to select a different GC policy. For details about the available policies and when to choose them, see Garbage collection.

"},{"location":"openj9_newuser/#operational-tooling","title":"Operational tooling","text":"

If you are a Java application developer or you are responsible for managing large server or desktop deployments of a Java runtime environment, you probably use a number of tools for monitoring, management, and troubleshooting. Because OpenJ9 is an independent implementation, it has evolved with its own approach for these areas and, in some cases, its own unique tools.

In other cases, tools have been added for compatibility with the reference implementation, but these tools might differ in behavior from equivalent tools in HotSpot. For a list of these tools, see Switching to OpenJ9 in the Tools section.

"},{"location":"openj9_newuser/#dumps-logs-and-trace-files","title":"Dumps, logs, and trace files","text":"

OpenJ9 contains extensive trace and debugging capabilities to help identify, isolate, and solve run time problems.

If you are familiar with using HotSpot as part of an Oracle JDK or OpenJDK, you probably make use of the monitoring and diagnostic tools that are provided with the VM. OpenJ9 has implemented a different approach to providing similar data; rather than running a number of different tools to obtain a different piece of information, the Java dump file provides a comprehensive set of information in one place. You can find the following information in an OpenJ9 Java dump:

For more information, see Java dump.

"},{"location":"openj9_newuser/#tools","title":"Tools","text":"

OpenJ9 provides support for a number of monitoring and diagnostic tools that can be found in the Eclipse marketplace. Each tool provides a graphical user interface to help you visualize data and, in some cases, can provide tuning or debugging recommendations.

If you are familiar with using HotSpot as part of an Oracle JDK or OpenJDK, the Java VisualVM utility is functionally similar to Health Center. Most of the other tools provided with HotSpot are not officially supported, but equivalent functionality is available in OpenJ9 through command-line options, dump agents, and AttachAPI.

"},{"location":"openj9_newuser/#interfaces","title":"Interfaces","text":"

OpenJ9 provides the following interfaces, which can be used for monitoring and diagnostic purposes:

If you are familiar with using HotSpot as part of an Oracle JDK or OpenJDK, you might make use of certain com.sun.management interfaces. Although OpenJ9 implements some of these interfaces, a few are specific to the HotSpot VM. The following table indicates alternative classes or mechanisms that you can use for equivalent function in OpenJ9:

HotSpot-specific classes Alternatives for OpenJ9 HotSpotDiagnosticMXBean OpenJ9DiagnosticsMXBean (for heap dumps) MissionControl Use Health Center MissionControlMXBean Use Health Center ThreadMXBean JvmCpuMonitorMXBean (for thread time) VMOption OpenJ9 Java dump (option -Xdump:java) DiagnosticCommandMBean None

Note: OpenJ9 implements the following com.sun.management interfaces: GarbageCollectorMXBean, GarbageCollectionNotificationInfo, GcInfo, OperatingSystemMXBean, UnixOperatingSystemMXBean.

For information about OpenJ9 application programming interfaces, see API documentation.

"},{"location":"openj9_newuser/#other-differences","title":"Other differences","text":"

This topic describes the differences between the HotSpot VM and the Eclipse OpenJ9 VM. Therefore, if you are currently using an OpenJDK with the default HotSpot VM and you want to switch to using an OpenJDK with the OpenJ9 VM, these are the only differences you might be concerned about. If however, you are using an Oracle JDK, you might want to learn about differences between other components that make up an Oracle JDK or an OpenJDK from the AdoptOpenJDK community. For more information, read the Migration guide.

"},{"location":"openj9_releases/","title":"Overview","text":""},{"location":"openj9_releases/#overview","title":"Overview","text":"

New releases of Eclipse OpenJ9\u2122 are set to coincide with critical patch updates and new versions of the Java\u2122 SE class libraries. To learn more about when these releases take place, and the OpenJ9 support lifecycle, see Supported environments.

If you are interested in the content of future releases, plans are published in the Eclipse OpenJ9 project page.

High level information about the features and changes in final releases of OpenJ9 can be found in the topics that follow.

"},{"location":"openj9_signals/","title":"Signal handling","text":""},{"location":"openj9_signals/#signal-handling","title":"Signal handling","text":"

Signals used by the Eclipse OpenJ9\u2122 VM include the following types:

For exceptions and errors, if the VM cannot handle the condition and recover, dumps are produced and a controlled shut down sequence takes place. Interrupts also cause the VM to enter a controlled shut down sequence, but without generating dumps. The shutdown sequence is equivalent to calling System.exit(), which results in the following steps:

  1. The VM calls the equivalent application signal handler.
  2. The VM calls any hooks installed by the application (unexpected shutdown hooks for exceptions or errors, shutdown or exit hooks for interrupts).
  3. The VM does any final clean up.

Control signals are used for internal control purposes and do not cause the VM to end.

The VM takes control of any signals for Java\u2122 threads. For non-Java threads, the VM passes control to an application handler, if one is installed. If the application does not install a signal handler, or signal chaining is turned off, the signal is either ignored or the default action is taken. Signal chaining is controlled by the -Xsigchain / -Xnosigchain command-line option.

The signals relevant to each platform are detailed in the sections that follow.

When reading each table, a number supplied after the signal name is the standard numerical value for that signal.

Note that certain signals on VM threads cause OpenJ9 to shutdown. An application signal handler should not attempt to recover from these signals unless it no longer requires the VM.

"},{"location":"openj9_signals/#signals-on-linux","title":"Signals on Linux","text":"Signal Type Description Option to disable signal SIGBUS (7) Exc Incorrect memory access (data misalignment) -Xrs or -Xrs:sync SIGSEGV (11) Exc Incorrect memory access (write to inaccessible area) -Xrs or -Xrs:sync SIGILL (4) Exc Illegal instruction (attempt to call unknown machine instruction) -Xrs or -Xrs:sync SIGFPE (8) Exc Floating point exception (divide by zero) -Xrs or -Xrs:sync SIGABRT (6) Err Abnormal termination, raised by the VM when a VM fault is detected -Xrs or -Xrs:sync SIGINT (2) Int Interactive attention (CTRL-C), VM exits normally -Xrs SIGTERM (15) Int Termination request, VM exits normally -Xrs SIGHUP (1) Int Hang up, VM exits normally -Xrs SIGUSR2 (12) Int User-defined signal for triggering a dump agent -Xrs SIGQUIT (3) Con Quit signal from a terminal, which triggers a Java dump by default -Xrs SIGTRAP (5) Con Used by the JIT -Xrs or -Xrs:sync SIGRTMIN (34) Con Used by the VM for thread introspection - SIGRTMIN +1 (35) Con Used by the VM for Runtime Instrumentation (Linux for IBM Z\u00ae systems only) - SIGRTMAX -2 (62) Con Used by the java.net class library code - SIGCHLD (17) Con Used by the java.lang.Process implementation -

Notes:

"},{"location":"openj9_signals/#signals-on-macos","title":"Signals on macOS","text":"Signal Type Description Option to disable signal SIGBUS (10) Exc Incorrect memory access (data misalignment) -Xrs or -Xrs:sync SIGSEGV (11) Exc Incorrect memory access (write to inaccessible area) -Xrs or -Xrs:sync SIGILL (4) Exc Illegal instruction (attempt to call unknown machine instruction)) -Xrs or -Xrs:sync SIGFPE (8) Exc Floating point exception (divide by zero) -Xrs or -Xrs:sync SIGABRT (6) Err Abnormal termination, raised by the VM when a VM fault is detected -Xrs or -Xrs:sync SIGINT (2) Int Interactive attention (CTRL-C), VM exits normally -Xrs SIGTERM (15) Int Termination request, VM exits normally -Xrs SIGHUP (1) Int Hang up, VM exits normally -Xrs SIGUSR2 (31) Int User-defined signal for triggering a dump agent -Xrs SIGQUIT (3) Con Quit signal from a terminal, which triggers a Java dump by default -Xrs SIGTRAP (5) Con Used by the JIT -Xrs or -Xrs:sync SIGCHLD (20) Con Used by the java.lang.Process implementation - SIGUSR1 (30) Con Used by the VM for thread introspection - SIGIO (23) Con Used by the java.net class library code -

Note:

"},{"location":"openj9_signals/#signals-on-windows","title":"Signals on Windows","text":"Signal Type Description Option to disable signal SIGINT (2) Int Interactive attention (CTRL-C), VM exits normally -Xrs SIGTERM (15) Int Termination request, VM exits normally -Xrs SIGBREAK Con A break signal from a terminal. By default, this triggers a Java dump -Xrs

Notes:

The following mechanisms are used by OpenJ9 for signal handling:

All mechanisms can be disabled by using the -Xrs option. However, only structured exception handling and the use of the AddVectoredExceptionHandler() API can be disabled by using the -Xrs:sync option. The option -Xnosigchain, which turns off signal handler chaining, is ignored on Windows systems.

"},{"location":"openj9_signals/#signals-on-zos","title":"Signals on z/OS","text":"Signal Type Description Option to disable signal SIGBUS (10) Exc Incorrect memory access (data misalignment) -Xrs or -Xrs:sync SIGSEGV (11) Exc Incorrect memory access (write to inaccessible area) -Xrs or -Xrs:sync SIGILL (4) Exc Illegal instruction (attempt to call unknown machine instruction)) -Xrs or -Xrs:sync SIGFPE (8) Exc Floating point exception (divide by zero) -Xrs or -Xrs:sync SIGABRT (3) Err Abnormal termination, raised by the VM when a VM fault is detected -Xrs or -Xrs:sync SIGINT (2) Int Interactive attention (CTRL-C), VM exits normally -Xrs SIGTERM (15) Int Termination request, VM exits normally -Xrs SIGHUP (1) Int Hang up, VM exits normally -Xrs SIGUSR2 (17) Int User-defined signal for triggering a dump agent -Xrs SIGQUIT (24) Con Quit signal from a terminal, triggers a Java dump by default -Xrs SIGTRAP (26) Con Used by the JIT -Xrs or -Xrs:sync SIGCHLD (20) Con Used by the java.lang.Process implementation - SIGUSR1 (16) Con Used by the java.net class library code -

Note:

"},{"location":"openj9_signals/#signals-on-aix","title":"Signals on AIX","text":"Signal Type Description Option to disable signal SIGBUS (10) Exc Incorrect memory access (data misalignment) -Xrs or -Xrs:sync SIGSEGV (11) Exc Incorrect memory access (write to inaccessible area) -Xrs or -Xrs:sync SIGILL (4) Exc Illegal instruction (attempt to call unknown machine instruction)) -Xrs or -Xrs:sync SIGFPE (8) Exc Floating point exception (divide by zero) -Xrs or -Xrs:sync SIGABRT (6) Err Abnormal termination, raised by the VM when a VM fault is detected -Xrs or -Xrs:sync SIGINT (2) Int Interactive attention (CTRL-C), VM exits normally -Xrs SIGTERM (15) Int Termination request, VM exits normally -Xrs SIGHUP (1) Int Hang up, VM exits normally -Xrs SIGUSR2 (31) Int User-defined signal for triggering a dump agent -Xrs SIGQUIT (3) Con Triggers a Java dump by default -Xrs No Name (40) Con Used by the VM for control purposes -Xrs SIGRECONFIG (58) Con Reserved to detect changes to resources (CPUs, processing capacity, or physical memory) -Xrs SIGTRAP (5) Con Used by the JIT -Xrs or -Xrs:sync SIGRTMIN (50) Con Used by the VM for thread introspection - SIGRTMAX -1 (56) Con Used by the java.net class library code - SIGCHLD (20) Con Used by the java.lang.Process implementation -

Notes:

"},{"location":"openj9_signals/#signal-chaining","title":"Signal chaining","text":"

Signal chaining allows application code to interoperate with VM signal handling. By linking and loading a shared library, certain calls can be intercepted so that the application handlers do not replace the VM signal handlers already installed by the VM. Instead, the application handlers are chained behind the VM handlers. If signals that are raised do not target the VM, the application handlers take over. Signals that can be chained include signal(), sigset(), and sigaction().

The following table shows the shared library that must be linked with the application that creates or embeds a VM, and the command line syntax to use with the compiler, where available:

Operating system Shared library Method for linking Linux\u00ae, macOS\u00ae, and z/OS\u00ae libjsig.so gcc -L$JAVA_HOME/bin -ljsig -L$JAVA_HOME/lib/j9vm -ljvm <java_application>.c Windows jsig.dll Link the DLL with the application that creates or embeds a VM AIX libjsig.so cc_r [-q64] <other_compile/link_parameter> -L<java_install_dir> -ljsig -L<java_install_dir>/lib/j9vm -ljvm <java_application>.c

In the absence of signal chaining, the VM does not allow application signal handlers for certain signals that are used internally by the VM, including the SIGUSR2 signal. You can use the -XX:-HandleSIGUSR2 option instead, whereby the VM signal handler is not installed on VM startup. Therefore, the application signal handler, if available, takes over the handling of the SIGUSR2 signal. If there is no application signal handler, then the operating system's default signal handler is used.

For more information about this option that affects the handling of the SIGUSR2 signal, see -XX:[+|-]HandleSIGUSR2.

Note: On Linux, macOS, and z/OS systems, you can use the LD_PRELOAD environment variable as an alternative method to the command line for linking the shared library as shown in the following list:

"},{"location":"openj9_signals/#see-also","title":"See also","text":""},{"location":"openj9_support/","title":"Supported environments","text":""},{"location":"openj9_support/#supported-environments","title":"Supported environments","text":"

The Eclipse OpenJ9\u2122 project source code can be built against multiple JDK levels starting with JDK8, so the question of support has a more complicated answer than at OpenJDK. Our community is committed to supporting JDK levels as long as they are supported at the OpenJDK open source project with a significant user base. Currently, Eclipse OpenJ9 produces a new release every quarter that can build against all JDK levels that are currently supported by the OpenJDK community. We are committed to accepting problem reports when using Eclipse OpenJ9 against a supported OpenJDK level, with fixes being delivered in each release of Eclipse OpenJ9.

In order to track the OpenJDK 6-month release cadence, OpenJ9 also produces two releases a year that support only a single JDK level. These releases will occur in March and September with the intention of supporting only the corresponding new OpenJDK feature release.

The following table summarizes which JDK levels are expected to be supported by which Eclipse OpenJ9 releases, along with projected release dates. All future dates and support expectations are predictions that might change depending on how the OpenJDK and OpenJ9 projects evolve over time. To keep this table concise, some rows and columns will be removed over time.

"},{"location":"openj9_support/#eclipse-openj9-releases","title":"Eclipse OpenJ9 releases","text":"OpenJ9 release Release date JDK8 (LTS) JDK11 (LTS) JDK17 (LTS) JDK21 (LTS) JDK22 JDK23 0.42.0 Jan 2024 (3) no no no yes 0.43.0 Feb 2024 yes yes yes yes 0.44.0 May 2024 yes yes yes yes 0.45.0 Jun 2024 no no no no yes 0.46.0 Aug 2024 yes yes yes yes yes 0.47.0 Sep 2024 (1, 2) no no no no no yes

Notes:

  1. These future OpenJ9 releases are expected, in line with our support statement.
  2. These OpenJ9 releases are feature releases that support a new OpenJDK release only.
  3. These OpenJ9 releases support a new LTS OpenJDK release only.

For any issues or limitations of an Eclipse OpenJ9 release, read the release notes.

"},{"location":"openj9_support/#platform-support","title":"Platform support","text":"

The Eclipse OpenJ9 project is open to supporting any hardware or operating system platforms provided that we have community members available to maintain them. For practical reasons the Eclipse OpenJ9 JVM does not currently run on every platform.

"},{"location":"openj9_support/#openjdk-8","title":"OpenJDK 8","text":"

OpenJDK 8 binaries are expected to function on the minimum operating system levels shown in the following tables:

Linux\u00ae AArch64 x32 x64 ppc64le Z31 Z64 RHEL 8.8 yes no yes yes no yes RHEL 9.2 no no yes yes no yes SUSE Linux Enterprise Server (SLES) 12 SP5 no yes yes yes yes yes Ubuntu 20.04 yes no yes yes no yes Ubuntu 22.04 no no yes yes no yes

Notes:

Windows\u2122 x32 x64 Windows 10 yes yes Windows 11 yes yes Windows Server 2016 yes yes Windows Server 2019 yes yes Windows Server 2022 yes yes macOS\u00ae x64 OS X\u00ae 10.10.0+ yes macOS 11 yes macOS 12 yes macOS 13 yes macOS 14 yes AIX\u00ae ppc32 ppc64 AIX 7.2 TL5 yes yes

Important: AIX OpenJ9 builds require the XL C++ Runtime 16.1.0.7 or later.

When public support for an operating system version ends, OpenJ9 can no longer be supported on that level.

"},{"location":"openj9_support/#openjdk-11","title":"OpenJDK 11","text":"

OpenJDK 11 binaries are expected to function on the minimum operating system levels shown in the following tables:

Linux (Note 1) AArch64 x64 ppc64le Z64 RHEL 8.8 yes yes yes yes RHEL 9.2 no yes yes yes SUSE Linux Enterprise Server (SLES) 12 SP5 no yes yes yes Ubuntu 20.04 yes yes yes yes Ubuntu 22.04 no yes yes yes

Notes:

Windows x64 Windows 10 yes Windows 11 yes Windows Server 2016 yes Windows Server 2019 yes Windows Server 2022 yes macOS x64 AArch64 (Apple silicon) OS X 10.11+ yes no macOS 11 yes yes macOS 12 yes yes macOS 13 yes yes macOS 14 yes yes AIX ppc64 AIX 7.2 TL5 yes

Important: AIX OpenJ9 builds require the XL C++ Runtime 16.1.0.7 or later.

When public support for an operating system version ends, OpenJ9 can no longer be supported on that level.

"},{"location":"openj9_support/#openjdk-17","title":"OpenJDK 17","text":"

OpenJDK 17 binaries are expected to function on the minimum operating system levels shown in the following tables:

Linux (Note 1) AArch64 x64 ppc64le Z64 RHEL 8.8 yes yes yes yes RHEL 9.2 no yes yes yes SUSE Linux Enterprise Server (SLES) 12 SP5 no yes yes yes Ubuntu 20.04 yes yes yes yes Ubuntu 22.04 no yes yes yes

Note: Not all of these distributions are tested, but the following distributions are expected to function without problems:

Windows x64 Windows 10 yes Windows 11 yes Windows Server 2016 yes Windows Server 2019 yes Windows Server 2022 yes macOS x64 AArch64 (Apple silicon) macOS 10.14+ yes no macOS 11 yes yes macOS 12 yes yes macOS 13 yes yes macOS 14 yes yes AIX ppc64 AIX 7.2 TL5 yes

Important: AIX OpenJ9 builds require the XL C++ Runtime 16.1.0.7 or later.

When public support for an operating system version ends, OpenJ9 can no longer be supported on that level.

"},{"location":"openj9_support/#openjdk-21-and-later","title":"OpenJDK 21 and later","text":"

OpenJDK 21 and later binaries are expected to function on the minimum operating system levels shown in the following tables:

Linux (Note 1) AArch64 x64 ppc64le Z64 RHEL 8.8 yes yes yes yes RHEL 9.2 no yes yes yes SUSE Linux Enterprise Server (SLES) 12 SP5 no yes yes yes Ubuntu 20.04 yes yes yes yes Ubuntu 22.04 no yes yes yes

Note: Not all of these distributions are tested, but the following distributions are expected to function without problems:

Windows x64 Windows 10 yes Windows 11 yes Windows Server 2016 yes Windows Server 2019 yes Windows Server 2022 yes macOS x64 AArch64 (Apple silicon) macOS 11 yes yes macOS 12 yes yes macOS 13 yes yes macOS 14 yes yes

Note: OpenJDK 22 is supported only on macOS 12-14.

AIX ppc64 AIX 7.2 TL5 yes

Important: AIX OpenJ9 builds require the XL C++ Runtime 16.1.0.7 or later.

When public support for an operating system version ends, OpenJ9 can no longer be supported on that level.

"},{"location":"openj9_support/#build-environments","title":"Build environments","text":"

The project builds and tests OpenJDK with OpenJ9 on a number of platforms. The operating system and compiler levels for the build systems are shown in the following tables.

"},{"location":"openj9_support/#openjdk-8_1","title":"OpenJDK 8","text":"Platform Operating system Compiler Linux x86 64-bit CentOS 6.10 gcc 11.2 Linux on POWER\u00ae LE 64-bit CentOS 7.9 gcc 11.2 Linux on IBM Z\u00ae 64-bit RHEL 7.9 gcc 11.2 Linux AArch64 64-bit CentOS 7.9 gcc 10.3 Windows x86 32-bit Windows Server 2019 Microsoft Visual Studio 2022 Windows x86 64-bit Windows Server 2019 Microsoft Visual Studio 2022 macOS x86 64-bit OSX 10.15.7 xcode 12.4 and clang 12.0.0 AIX POWER BE 64-bit AIX 7.2 TL5 xlc/C++ 16.1.0.11"},{"location":"openj9_support/#openjdk-11_1","title":"OpenJDK 11","text":"Platform Operating system Compiler Linux x86 64-bit CentOS 6.10 gcc 11.2 Linux on POWER LE 64-bit CentOS 7.9 gcc 11.2 Linux on IBM Z 64-bit RHEL 7.9 gcc 11.2 Linux AArch64 64-bit CentOS 7.9 gcc 10.3 Windows x86 64-bit Windows Server 2019 Microsoft Visual Studio 2022 macOS x86 64-bit macOS 10.15.7 xcode 12.4 and clang 12.0.0 macOS AArch64 macOS 11.5.2 xcode 13.0 and clang 13.0.0 AIX POWER BE 64-bit AIX 7.2 TL5 xlc/C++ 16.1.0.11"},{"location":"openj9_support/#openjdk-17_1","title":"OpenJDK 17","text":"Platform Operating system Compiler Linux x86 64-bit CentOS 7.9 gcc 11.2 Linux on POWER LE 64-bit CentOS 7.9 gcc 11.2 Linux on IBM Z 64-bit RHEL 7.9 gcc 11.2 Linux AArch64 64-bit CentOS 7.9 gcc 10.3 Windows x86 64-bit Windows Server 2019 Microsoft Visual Studio 2022 macOS x86 64-bit macOS 10.15.7 xcode 12.4 and clang 12.0.0 macOS AArch64 macOS 11.5.2 xcode 13.0 and clang 13.0.0 AIX POWER BE 64-bit AIX 7.2 TL5 xlc/C++ 16.1.0.11"},{"location":"openj9_support/#openjdk-21-and-later_1","title":"OpenJDK 21 and later","text":"Platform Operating system Compiler Linux x86 64-bit CentOS 7.9 gcc 11.2 Linux on POWER LE 64-bit CentOS 7.9 gcc 11.2 Linux on IBM Z 64-bit RHEL 7.9 gcc 11.2 Linux AArch64 64-bit CentOS 7.9 gcc 10.3 Windows x86 64-bit Windows Server 2019 Microsoft Visual Studio 2022 macOS x86 64-bit macOS 10.15.7 xcode 12.4 and clang 12.0.0 macOS AArch64 macOS 11.5.2 xcode 13.0 and clang 13.0.0 AIX POWER BE 64-bit AIX 7.2 TL5 xlc/C++ 16.1.0.11"},{"location":"openssl/","title":"OpenSSL","text":""},{"location":"openssl/#openssl","title":"OpenSSL","text":"

OpenJDK uses the in-built Java\u2122 cryptographic implementation by default but Eclipse OpenJ9\u2122 also provides some support for the OpenSSL cryptographic library. OpenSSL is an open source cryptographic toolkit for Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols, which is well established and used with many enterprise applications. Because it is a native library, OpenSSL might provide better performance. To use OpenSSL cryptographic acceleration, install OpenSSL 1.0.x, 1.1.x, or 3.x on your system. The OpenSSL V1.0.x, V1.1.x, and V3.x implementations are currently supported for the Digest, CBC, GCM, RSA, ECDH key agreement, and EC key generation algorithms. The OpenSSL V1.1.x and V3.x implementations are also supported for the ChaCha20 and ChaCha20-Poly1305 algorithms. The OpenSSL V1.1.1 onwards implementations are supported for the XDH key agreement and XDH key generation algorithms.

On Linux\u00ae and AIX\u00ae operating systems, the OpenSSL 1.0.x, 1.1.x, or 3.x library is expected to be found on the system path. If you use a package manager to install OpenSSL, the system path will be updated automatically. On Windows\u2122 and MacOS\u00ae the OpenSSL 3.x library is bundled. Later levels of some Linux operating systems also bundle OpenSSL 3.x.

If you have multiple versions of OpenSSL on your system, the OpenJ9 VM uses the latest version.

Note: OpenSSL 3.x does not support initialization vector (IV) sizes above 16 Bytes for the GCM algorithm. (In earlier OpenSSL versions, you can use such sizes but they might cause unpredictable behavior.) If you need to use a larger size, disable OpenSSL support for the GCM algorithm.

OpenSSL support is enabled by default for all supported algorithms. If you want to limit support to specific algorithms, a number of system properties are available for tuning the implementation.

Each algorithm can be disabled individually by setting the following system properties on the command line:

You can turn off all the algorithms by setting the following system property on the command line:

-Djdk.nativeCrypto=false\n

To build a version of OpenJDK with OpenJ9 that includes OpenSSL support, follow the steps in our detailed build instructions:

Note: If you obtain an OpenJDK with OpenJ9 build that includes OpenSSL or build a version yourself that includes OpenSSL support, the following acknowledgments apply in accordance with the license terms:

"},{"location":"shrc/","title":"Introduction","text":""},{"location":"shrc/#introduction-to-class-data-sharing","title":"Introduction to class data sharing","text":"

Sharing class data between Eclipse OpenJ9\u2122 VMs improves start up performance and reduces memory footprint. Consider the following outcomes for two VMs that are running similar Java applications but sharing class data:

When class data sharing is enabled, OpenJ9 automatically creates shared memory that stores and shares the classes in memory between processes. This shared classes cache is updated dynamically; when an application loads new classes, the VM automatically stores them in the cache without any user intervention. By default, class data sharing is enabled for bootstrap classes, as described in Enabling class data sharing.

When class data sharing is enabled, Ahead-of-time (AOT) compilation is also enabled by default, which dynamically compiles certain methods into AOT code at runtime. By using these features in combination, startup performance is further improved because the cached AOT code can be used to quickly enable native code performance for subsequent runs of your application. For more information about AOT, see AOT Compiler. Further performance improvements are gained by storing JIT data and profiles in the shared classes cache.

The contents of a shared classes cache can include the following artifacts:

"},{"location":"shrc/#cache-utilities","title":"Cache utilities","text":"

Active caches can be managed by a set of cache utilities, which are invoked by specifying -Xshareclasses suboptions. These utilities control the following types of operations:

These cache utilities are discussed in more detail in the sections that follow.

"},{"location":"shrc/#enabling-class-data-sharing","title":"Enabling class data sharing","text":"

Class data sharing is enabled by default for bootstrap classes, unless your application is running in a container. Default behavior includes the following characteristics:

Shared class behavior is controlled by specifying the -Xshareclasses option on the command line when you start your application. The default settings are equivalent to specifying the following suboptions:

-Xshareclasses:bootClassesOnly,nonFatal,silent\n

You can enable class data sharing for non-bootstrap classes as well as bootstrap classes, by omitting the bootClassesOnly suboption. You can also disable all class data sharing by using the none suboption.

Further suboptions are available to configure a cache at startup, including name, location, and startup size. You can also use cache utilities to manage a shared classes cache after it is initialized and in use.

A shared classes cache can be persistent or non-persistent according to the following definition:

By default, a shared classes cache is persistent, except on the z/OS platform. Support for persistent shared class cache was added on z/OS in 0.40.0 release but the default cache type on z/OS is still nonpersistent.

If you are using a non-persistent cache, you can use a cache utility to create a snapshot of the cache, which can be reinitialized after a reboot. For more information see Saving a non-persistent shared classes cache.

If you have multiple VMs and you do not change the default shared classes behavior, the VMs share a single default cache, assuming that the VMs are from a single Java installation. If the VMs are from different Java installations, the cache might be deleted and re-created.

For a set of best practices when using class data sharing, see Creating a shared classes cache.

"},{"location":"shrc/#class-data-sharing-operations","title":"Class data sharing operations","text":"

When a VM loads a class and the class loader is enabled for class sharing, the VM looks in the shared classes cache to see if the class is already present. If the class is present and the classpath or URL to load the class is a match, the VM loads the class from the cache. Otherwise, it loads the class from the file system and writes it into the cache.

The VM detects file system updates by storing timestamp values into the cache and comparing the cached values with actual values. In this way, the VM detects when a class might be invalidated and can mark the class as stale. These operations happen transparently when classes are loaded, so users can modify and update as many classes as they like during the lifetime of a shared classes cache, knowing that the correct classes are always loaded. Stale classes are redeemed if the same class is subsequently fetched by the class loader from another VM and checked against the stale class in the cache.

Occasionally, caches that are created from one version of the VM might not be compatible with caches that are created from a different version. This situation typically occurs when an update is made in OpenJ9 that changes the internal cache data structure. If a VM detects an incompatible cache at start up, it creates a new cache that can coexist, even if it has the same name. The VM detects a conflict by checking an internal shared classes cache generation number.

Caches are not compatible between VMs that are using different object storage modes. For example, a 64-bit VM that uses compressed references to store 64-bit objects in a 32-bit representation, cannot share a cache with a 64-bit VM that is not using compressed references. For more information about object storage options, see Compressed references.

In the OpenJ9 implementation of java.net.URLClassLoader, classes are read from and written to the cache using the public Helper API. Therefore, any class loader that extends java.net.URLClassLoader gets class sharing support for free provided that it continues to use the methods in java.net.URLClassLoader to load classes. Custom class loaders that do not extend java.net.URLClassLoader must be adapted to share class data as described in Support for custom class loaders.

"},{"location":"shrc/#aot-code-and-jit-data","title":"AOT code and JIT data","text":"

OpenJ9 can automatically store small amounts of AOT code and JIT data, which helps improve performance in the following ways:

The default settings provide significant performance benefits. However, you can specify options on the command line to configure AOT code storage or JIT data storage in the shared classes cache, as shown in the following table:

Component Setting a minimum storage value Setting a maximum storage value Turning off storage AOT code -Xscminaot<size> -Xscmaxaot<size> -Xshareclasses:noaot JIT data -Xscminjitdata<size> -Xscmaxjitdata<size> -Xshareclasses:nojitdata

The following cache utilities are available to adjust the storage values when a cache is active:

Component Adjusting the minimum storage value Adjusting the maximum storage value AOT code -Xshareclasses:adjustminaot -Xshareclasses:adjustmaxaot JIT code -Xshareclasses:adjustminjit -Xshareclasses:adjustmaxjit

You can also use the -Xshareclasses:findAotMethods cache utility to list the AOT methods in a cache that match a method specification. This utility helps you identify methods that are causing a failure in an application. You can then invalidate the method without destroying the cache by using the -Xshareclasses:invalidateAotMethods cache utility. You can also revalidate an AOT method with the -Xshareclasses:revalidateAotMethods cache utility. To troubleshoot AOT problems, use the -Xshareclasses:verboseAOT suboption on the command line, which generates output about AOT code that is found or stored in the cache. For more information see -Xshareclasses.

"},{"location":"shrc/#creating-a-shared-classes-cache","title":"Creating a shared classes cache","text":"

The -Xshareclasses option is highly configurable, allowing you to specify where to create the cache, how much space to allocate, and more. The following best practices apply to using class data sharing:

"},{"location":"shrc/#creating-layer-caches","title":"Creating layer caches","text":"

Creating a layered cache might be useful when you are building a Docker image.

Normally, writing to an existing shared cache in a lower image layer results in Docker duplicating the shared cache to the top layer (following the Docker copy-on-write strategy). With a layered cache, you can instead write into a new cache in the top layer. The new cache builds on the existing cache, so space is saved in the image.

The following example shows a Docker container with four layers:

  1. The lowest layer is a Ubuntu Docker image.
  2. The next layer is an OpenJ9 Docker image that is built on the Ubuntu image. As part of this image, the -Xshareclasses:name=MyCache suboption is used to create a cache called MyCache. The layer number assigned to this cache is 0. The listAllCaches suboption shows the cache and the layer number:

    java -Xshareclasses:listAllCaches\n...\nCache name              level         cache-type      feature         layer       OS shmid       OS semid       last detach time\n\nCompatible shared caches\nMyCache                 Java8 64-bit  persistent      cr              0                                         Mon Sep 23 11:41:04 2019\n
  3. The next Docker layer up is a middleware image that is built on the OpenJ9 image. As part of this image, the -Xshareclasses:name=MyCache,layer=1 suboption is used to create another cache called MyCache. Because the layer=1 suboption is specified, this new cache is a layered cache, which builds on MyCache in the previous container layer. (Open Liberty starts two VMs, so if you instead use the createLayer suboption here, two layered caches are created, with layer numbers of 1 and 2.) Note that cache layers are different from, and independent of, container layers.

  4. In the same way, another Docker layer is added for an application, and another layered cache is created to add to MyCache. The listAllCaches suboption now shows all the caches and their layers:

    java -Xshareclasses:listAllCaches\n...\nCache name              level         cache-type      feature         layer       OS shmid       OS semid       last detach time\n\nCompatible shared caches\nMyCache                 Java8 64-bit  persistent      cr              0                                         Mon Sep 23 11:41:04 2019\nMyCache                 Java8 64-bit  persistent      cr              1                                         Mon Sep 23 11:46:25 2019\nMyCache                 Java8 64-bit  persistent      cr              2                                         In use\n

The caches are created in the same directory.

When you use the -Xshareclasses:name=MyCache suboption in future Java commands, all the caches are started. The top-layer cache is started in read/write mode, and lower-layer caches are started in read-only mode. Modifying a lower-layer cache will invalidate all the caches in the layers above.

The following options and cache utilities are available for creating, managing, and removing layered caches:

"},{"location":"shrc/#saving-a-non-persistent-shared-classes-cache","title":"Saving a non-persistent shared classes cache","text":"

As described in an earlier section, a shared classes cache can be persistent or non-persistent; persistent caches are memory-mapped files. By default, a cache is persistent on all platforms, except z/OS. Non-persistent caches are stored in shared memory and are removed when a system is rebooted. If you want to save a non-persistent cache beyond a reboot, you might want to consider taking a cache snapshot.

To create a snapshot of a non-persistent shared classes cache, use the -Xshareclasses:snapshotCache cache utility. The snapshot has the same name and location as the shared cache, as specified by the name and cacheDir suboptions. The shared cache can be in use when the snapshot is taken, but VMs are blocked when they try to write to the shared cache while the cache data is copied to the file.

Typically, after a system is reinitialized, the snapshot file is used to restore the copy of the non-persistent cache into shared memory, by using the -Xshareclasses:restoreFromSnapshot cache utility. Because this process removes all non-persistent caches from shared memory, restoring the cache from the snapshot file can result in better VM startup performance, because the contents of the shared cache, including classes and AOT code, do not have to be re-created.

The -Xshareclasses:listAllCaches cache utility can be used to identify snapshots on a system.

A snapshot can be created only if the user has sufficient permissions to create the destination snapshot file. If a snapshot of the same name exists already, it is overwritten. On platforms that support persistent caches, the nonpersistent suboption must be specified in order to create a snapshot. For information about removing snapshot files, see the destroySnapshot and destroyAllSnapshots cache utilities in Housekeeping.

Note: The snapshotCache and restoreFromCache cache utilities cannot be used on Windows systems.

"},{"location":"shrc/#housekeeping","title":"Housekeeping","text":"

Caches can be deleted if they contain many stale classes or if the cache is full and you want to create a bigger cache. Use one of the following utilities to remove unwanted caches:

Note: You must always use the utilities to remove non-persistent caches correctly from shared memory.

Caches can also be removed if they are unused for a specified amount of time. To configure time-based housekeeping, use the -Xshareclasses:expire option.

If you want to remove a cache but allow it to be re-created when the VM restarts, use the -Xshareclasses:reset option.

"},{"location":"shrc/#support-for-custom-class-loaders","title":"Support for custom class loaders","text":"

Classes are shared by the bootstrap class loader internally in the VM. The OpenJ9 implementation of java.net.URLClassLoader is modified to use SharedClassURLClasspathHelper and any class loaders that extend java.net.URLClassLoader can inherit this behavior. If you are using a custom class loader that does not extend java.net.URLClassLoader, you can use the Java Helper API to find and store classes in a shared classes cache.

If a running application uses its own class loader and you are using a SecurityManager, you must grant the class loader permission to SharedCachePermission before they can share classes. To grant permission, add shared class permissions to the java.policy file by specifying the ClassLoader class name. Permissions can be set for read, write, or read,write. For example:

permission com.ibm.oti.shared.SharedClassPermission\n        \"com.abc.customclassloaders.*\", \"read,write\";\n

If a running application is calling the com.ibm.oti.shared.SharedClassUtilities APIs getSharedCacheInfo() or destroySharedCache(), you must also grant the code calling these APIs the appropriate SharedClassesNamedPermission. For example:

permission com.ibm.oti.shared.SharedClassesNamedPermission \"getSharedCacheInfo\";\npermission com.ibm.oti.shared.SharedClassesNamedPermission \"destroySharedCache\";\n
"},{"location":"shrc/#the-java-shared-classes-helper-api","title":"The Java shared classes Helper API","text":"

The Java Helper API classes can be found in the com.ibm.oti.shared package.

Each class loader that wants to share classes must get a SharedClassHelper object from a SharedClassHelperFactory. The SharedClassHelper, when created, has a one to one relationship with the class loader. That is, it belongs to the class loader that requested it and can only store classes defined by that class loader. The SharedClassHelper gives the class loader a simple API for finding and storing classes in the class cache to which the VM is connected. If the class loader is garbage collected, its SharedClassHelper is also garbage collected.

The following main functions are available from the SharedClassHelper API:

You can also define partitions in a cache to store sets of classes separately from one another. For more information see SharedClassHelper cache partitions.

Each class loader that wants to share data must get a SharedDataHelper object from a SharedDataHelperFactory. A SharedDataHelperFactory provides an interface that can be used to create SharedDataHelpers, which are used for storing Java byte array data. A SharedDataHelper also has a one to one relationship with a class loader, although a class loader can exist without a SharedDataHelper.

"},{"location":"shrc/#the-java-shared-classes-utility-api","title":"The Java shared classes utility API","text":"

The following APIs are available for obtaining information about a shared classes cache:

"},{"location":"shrc/#support-for-bytecode-instrumentation","title":"Support for bytecode instrumentation","text":"

Modifying the bytecode of a set of classes at runtime is a useful mechanism for adding functions to a program, such as profiling or debugging. The JVM Tools Interface (JVMTI) includes hooks that allow you to instrument the byte code in this way. Alternatively, you can write your own Java agent that uses the java.lang.instrument API. Sharing classes that are changed before they are loaded adds complexity to the class sharing process.

By default, if OpenJ9 detects that a JVMTI agent or java.lang.instrument agent has registered to modify class bytes, modified classes are not stored in the cache. Instead, the VM stores original class byte data in the cache, which allows classes to be retransformed.

If you turn off bytecode instrumentation support by specifying -Xshareclasses:disableBCI and do not use a modification context to share modified classes safely, all bytecode is loaded from the file system for the agent to modify. When passed to the cache for storing, the VM compares the bytes with known classes of the same name. If a match is found, the class is reused. However, if a match is not found, the potentially modified class is stored in the cache in a way that prevents other VMs from loading it. In this situation, performance can be affected because the bytecode is always loaded from the file system and compared with existing classes in the cache. When bytecode instrumentation is turned off, classes loaded from the shared cache cannot be retransformed. For more information about using a modification context, see Sharing modified bytecode.

"},{"location":"shrc/#redefined-and-retransformed-classes","title":"Redefined and retransformed classes","text":"

The following rules exist for classes that are redefined or retransformed by JVMTI or java.lang.instrument agents:

"},{"location":"shrc/#sharing-modified-bytecode","title":"Sharing modified bytecode","text":"

Sharing modified bytecode can be advantageous for applications that use the same modifications because the transformation process needs to happen only once. OpenJ9 allows multiple VMs that are using the same or different types of class modifications to safely share the cache. However, when a class is modified and cached, it cannot be modified (retransformed) further.

Modified bytecode can be shared safely by using a modification context. Use the -Xshareclasses:disableBCI and -Xshareclasses:modified=<modified_context> suboptions when you start your application, where <modified_context> is a user-defined description. The cache is structured so that any VM that is started with the same modification context can share the classes in a private area. The following outcomes apply to VMs that do not want to share the modified classes:

"},{"location":"shrc/#sharedclasshelper-cache-partitions","title":"SharedClassHelper cache partitions","text":"

Another method of structuring and protecting classes in the shared classes cache can be implemented by using the SharedClassHelper API with a custom class loader. This mechanism creates partitions by using a string key to identify a set of classes, which can be stored and retrieved by the class loader. A use case for this mechanism is Aspect Oriented Programming (AOP) where aspects are woven in to bytecode when a class is loaded into the VM. Being able to partition the cache provides a suitable level of granularity when you want to use different aspect paths.

Although it is possible to combine partitions and modification contexts, this practice is not recommended because the cache will contain partitions within partitions.

Note: Partitions are not supported by the bootstrap class loader or the default application class loader.

"},{"location":"shrc/#see-also","title":"See also","text":""},{"location":"shrc_diag_util/","title":"Diagnosing problems","text":""},{"location":"shrc_diag_util/#diagnosing-problems-with-class-data-sharing","title":"Diagnosing problems with class data sharing","text":"

If you encounter problems with class data sharing, VM messages are typically generated that point to an underlying cause. In some situations, a cache might fail to initialize correctly. In other situations classes might not be found or stored in the shared classes cache. To provide more information about a problem, you can generate verbose output, use diagnostic cache utilities, or use the Eclipse OpenJ9\u2122 trace facility.

"},{"location":"shrc_diag_util/#initialization-problems","title":"Initialization problems","text":"

If you do not specify a directory for the shared classes cache by using the cacheDir suboption, the cache is created in the javasharedresources directory in the following default location:

Initialization problems can occur on systems other than Windows because caches are created with read/write access for the user only and subsequent users do not have permission to write to the home directory. If you specify the -Xshareclasses:groupAccess suboption, the cache is created in the /tmp directory instead where all users have permission to write to the cache.

For a persistent cache, initialization problems can also occur if there is insufficient disk space available or if you are attempting to locate the cache on a remote networked file system, which is not supported.

For a non-persistent cache, a shared memory area is required. Check that your system is configured with sufficient resources as described in Setting shared memory values. If initialization problems persist, try deleting the cache by using the -Xshareclasses:destroyAll cache utility, which removes all known shared memory areas and semaphores for caches in the cacheDir specified or the default directory. These actions force the VM to re-create the cache.

"},{"location":"shrc_diag_util/#problems-finding-or-storing-classes","title":"Problems finding or storing classes","text":"

The most common cause for classes not being stored in the cache is due to space constraints. Make sure that you set an appropriate size for the cache, as described in Creating a shared classes cache. Setting a soft maximum size is recommended, because you can adjust the soft maximum size that is set for the cache after it is created. See Setting a soft maximum size.

Storing classes can also be a problem if the cache is opened read-only or if the class does not exist on the file system because it is sourced from a URL location.

If you are attempting to share modified bytecode, you must use a modification context, as described in Sharing modified bytecode. Otherwise, classes are stored in a private area that is not accessible to other VMs.

If you are using a custom class loader, class path entries in the SharedClassURLClasspathHelper must be confirmed before classes can be found for these entries. More information about confirmed entries is available in the SharedClassURLClasspathHelper interface in the com.ibm.oti.shared API documentation.

If you are instrumenting bytecode by using a JVMTI agent or java.lang.instrument agent, the following rules apply:

If a running application uses its own class loader and you are using a SecurityManager, you must grant the class loader permission to SharedCachePermission before they can share classes. For more information, see Support for custom class loaders.

In very rare cases, problems with finding or storing classes might be due to cache corruption. If the VM detects that a cache is corrupt, it attempts to destroy the cache and re-create it. If the VM cannot re-create the cache, it starts only if the -Xshareclasses:nonfatal suboption is specified on the command line, but without using the shared cache. Try using the -Xshareclasses:destroy cache utility to remove the specific cache and re-create it. You might need to specify the cacheDir=<directory> and name=<cache_name> suboptions if the cache is not using the default settings.

"},{"location":"shrc_diag_util/#generating-verbose-output","title":"Generating verbose output","text":"

A number of -Xshareclasses suboptions are available for generating verbose output during class data sharing operations, which can help you identify the root cause of a problem.

"},{"location":"shrc_diag_util/#verbose","title":"verbose","text":"

The -Xshareclasses:verbose suboption provides basic output on cache usage. In the following example, a persistent cache is opened and attached to the VM for class sharing. Information is provided about the size of the cache, the unstored bytes due to the setting of a soft maximum size, and maximum AOT and JIT data size.

java -Xshareclasses:name=myCache,verbose HelloWorld\n[-Xshareclasses persistent cache enabled]\n[-Xshareclasses verbose output enabled]\nJVMSHRC237I Opened shared classes persistent cache myCache\nJVMSHRC246I Attached shared classes persistent cache myCache\nJVMSHRC765I Memory page protection on runtime data, string read-write data and partially filled pages is successfully enabled\nHello World\nJVMSHRC168I Total shared class bytes read=2532416. Total bytes stored=268156\nJVMSHRC818I Total unstored bytes due to the setting of shared cache soft max is 0. Unstored AOT bytes due to the setting of -Xscmaxaot is 0. Unstored JIT bytes due to the setting of -Xscmaxjitdata is 0.\n\n
"},{"location":"shrc_diag_util/#verboseio","title":"verboseIO","text":"

The -Xshareclasses:verboseIO suboption provides more detailed information about class sharing operations. In the following example, some classes are found when the cache is accessed. However, class openj9/internal/tools/attach/target/CommonDirectory is not found and is therefore stored for sharing.

java -Xshareclasses:name=myCache,verboseIO HelloWorld\n[-Xshareclasses verbose I/O output enabled]\nFound class java/lang/Object in shared cache for class-loader id 0.\nFound class java/lang/J9VMInternals in shared cache for class-loader id 0.\nFound class com/ibm/oti/vm/VM in shared cache for class-loader id 0.\nFound class java/lang/J9VMInternals$ClassInitializationLock in shared cache for class-loader id 0.\n...\nFailed to find class openj9/internal/tools/attach/target/CommonDirectory in shared cache for class-loader id 0.\nStored class openj9/internal/tools/attach/target/CommonDirectory in shared cache for class-loader id 0 with URL /root/sdk/jre/lib/amd64/compressedrefs/jclSC180/vm.jar (index 0).\n...\n

The bootstrap class loader has an ID of 0; other class loaders are given a unique ID. Class loaders follow the class loader hierarchy by asking the parent class loader for a class. If a parent fails to find the class in the cache, the child class loader stores the class in the cache.

In some situations, verbose output might not show classes being found. For example, classes are typically not found if the class is stale, as described in Class data sharing operations. Stale classes are redeemed if the same class is subsequently fetched by the class loader from another VM and checked against the stale class in the cache.

"},{"location":"shrc_diag_util/#verboseaot","title":"verboseAOT","text":"

To troubleshoot AOT problems, use the -Xshareclasses:verboseAOT suboption on the command line, which generates output about AOT code that is found or stored in the cache.

In the following example output, a populated cache is being accessed to look for compiled AOT code. Some AOT code is found, which can be shared, and some AOT code is stored for reuse.

java -Xshareclasses:name=myCache,verboseAOT HelloWorld\n[-Xshareclasses AOT verbose output enabled]\nFound AOT code for ROMMethod 0x00007F658005C180 in shared cache.\nFound AOT code for ROMMethod 0x00007F65800723EC in shared cache.\nFound AOT code for ROMMethod 0x00007F6580071D14 in shared cache.\nStored AOT code for ROMMethod 0x00007F65801847B8 in shared cache.\nStored AOT code for ROMMethod 0x00007F65800D38A4 in shared cache.\nStored AOT code for ROMMethod 0x00007F65800723CC in shared cache.\nFound AOT code for ROMMethod 0x00007F65800D38A4 in shared cache.\nStored AOT code for ROMMethod 0x00007F65800724C4 in shared cache.\n...\n
"},{"location":"shrc_diag_util/#verbosehelper","title":"verboseHelper","text":"

To troubleshoot problems with custom class loaders that use the Java SharedClassHelper API, specify the -Xshareclasses:verboseHelper suboption. Information messages and error messages are generated in the output, which can help you diagnose problems with finding or storing classes in the shared cache.

The following example output shows only information messages:

java -Xshareclasses:name=myCache,verboseHelper HelloWorld\n[-Xshareclasses Helper API verbose output enabled]\nInfo for SharedClassURLClasspathHelper id 1: Verbose output enabled for SharedClassURLClasspathHelper id 1\nInfo for SharedClassURLClasspathHelper id 1: Created SharedClassURLClasspathHelper with id 1\nInfo for SharedClassURLClasspathHelper id 2: Verbose output enabled for SharedClassURLClasspathHelper id 2\nInfo for SharedClassURLClasspathHelper id 2: Created SharedClassURLClasspathHelper with id 2\nInfo for SharedClassURLClasspathHelper id 1: There are no confirmed elements in the classpath. Returning null.\nInfo for SharedClassURLClasspathHelper id 2: There are no confirmed elements in the classpath. Returning null.\nInfo for SharedClassURLClasspathHelper id 2: setClasspath() updated classpath. No invalid URLs found\nInfo for SharedClassURLClasspathHelper id 2: Number of confirmed entries is now 1\nHello World\n
"},{"location":"shrc_diag_util/#diagnostic-cache-utilities","title":"Diagnostic cache utilities","text":"

These utilities display information about the contents of a shared classes cache. Run the utilities by specifying them as suboptions of -Xshareclasses. The utilities run on the default cache unless you specify a cache by adding the name=<cache_name> and cacheDir=<directory> suboptions.

"},{"location":"shrc_diag_util/#printstats","title":"printStats","text":"
-Xshareclasses:printStats\n-Xshareclasses:printStats,name=<cache_name>\n-Xshareclasses:printStats=<data_type1>[+<data_type2>][...],name=<cache_name>\n

Displays summary information about the cache. For layered caches, -Xshareclasses:printStats shows some information for the top layer cache, and summary information (bytes and counts only) for all layers combined. To see information for the top layer cache only, use printTopLayerStats.

You can request more detail about items of a specific data type that are stored in the shared cache by using printStats=<data_type>. Use the plus symbol (+) to separate the data types. For example, use printStats=romclass+url,name=myCache to see information about ROMClass and URL items in all the layer caches of the cache called Cache1. The valid data types are as follows (case insensitive):

Example output for a traditional cache (no cache layers: cache layer = 0), with summary information only:

Current statistics for cache \"Cache1\":\n\nCache created with:\n        -Xnolinenumbers                      = false\n        BCI Enabled                          = true\n        Restrict Classpaths                  = false\n        Feature                              = cr\n\nCache contains only classes with line numbers\n\nbase address                         = 0x00007F60B807A000\nend address                          = 0x00007F60B905E000\nallocation pointer                   = 0x00007F60B81BE3A8\n\ncache layer                          = 0\ncache size                           = 16776608\nsoftmx bytes                         = 16776608\nfree bytes                           = 12740572\nReserved space for AOT bytes         = -1\nMaximum space for AOT bytes          = -1\nReserved space for JIT data bytes    = -1\nMaximum space for JIT data bytes     = -1\nMetadata bytes                       = 30440\nMetadata % used                      = 0%\nClass debug area size                = 1331200\nClass debug area used bytes          = 189358\nClass debug area % used              = 14%\n\nROMClass bytes                       = 1328040\nAOT bytes                            = 98404\nJIT data bytes                       = 168\nZip cache bytes                      = 1133704\nStartup hint bytes                   = 0\nData bytes                           = 114080\n\n# ROMClasses                         = 452\n# AOT Methods                        = 2\n# Classpaths                         = 1\n# URLs                               = 0\n# Tokens                             = 0\n# Zip caches                         = 21\n# Startup hints                      = 0\n# Stale classes                      = 0\n% Stale classes                      = 0%\n\n\nCache is 24% full\n\nCache is accessible to current user = true\n

Example output for a cache with 2 layers (cache layer = 1), with summary information only:

Current statistics for top layer of cache \"Cache1\":\n\nCache created with:\n        -Xnolinenumbers                      = false\n        BCI Enabled                          = true\n        Restrict Classpaths                  = false\n        Feature                              = cr\n\n\nbase address                         = 0x00007FCAB2766000\nend address                          = 0x00007FCAB374A000\nallocation pointer                   = 0x00007FCAB2766000\n\ncache layer                          = 1\ncache size                           = 16776608\nsoftmx bytes                         = 16776608\nfree bytes                           = 15299372\nReserved space for AOT bytes         = -1\nMaximum space for AOT bytes          = -1\nReserved space for JIT data bytes    = -1\nMaximum space for JIT data bytes     = -1\nClass debug area size                = 1331200\nClass debug area used bytes          = 0\nClass debug area % used              = 0%\n\nCache is 8% full\n\nCache is accessible to current user = true\n---------------------------------------------------------\n\nCurrent statistics for all layers of cache \"Cache1\":\n\nROMClass bytes                       = 1328040\nAOT bytes                            = 128924\nJIT data bytes                       = 812\nZip cache bytes                      = 1133704\nStartup hint bytes                   = 0\nData bytes                           = 114080\n\n# ROMClasses                         = 452\n# AOT Methods                        = 20\n# Classpaths                         = 1\n# URLs                               = 0\n# Tokens                             = 0\n# Zip caches                         = 21\n# Startup hints                      = 0\n# Stale classes                      = 0\n% Stale classes                      = 0%\n

The Cache created with section indicates the options that were used when the cache was created. BCI Enabled relates to the -Xshareclasses:enableBCI option (enabled by default) and Restrict Classpaths relates to the -Xshareclasses:restrictClasspaths option. Feature = cr indicates that the cache is a 64-bit compressed references cache.

Line number information for classes in the cache is then shown with one of the following messages:

The following summary data is displayed:

"},{"location":"shrc_diag_util/#printallstats","title":"printAllStats","text":"
-Xshareclasses:printAllStats\n-Xshareclasses:printAllStats,name=<cache_name>\n

Displays the contents of the cache in chronological order. You can use this output to see the history of updates that were made to the cache. For layered caches, some information is shown for the top layer cache only, and some is shown for all layers combined. To see information for the top layer cache only, use printTopLayerStats=all.

Each entry in the output starts with a VM ID, so you can see which VM wrote the associated data. Here are example entries for various types of cache data, with explanations:

"},{"location":"shrc_diag_util/#class-paths","title":"Class paths","text":"

The following example shows one class path with 4 entries:

    1: 0x2234FA6C CLASSPATH\n            /myVM/Apps/application1.jar\n            /myVM/Apps/application2.jar\n            /myVM/Apps/application3.jar\n            /myVM/Apps/application4.jar\n
"},{"location":"shrc_diag_util/#romclasses","title":"ROMClasses","text":"

This example shows an entry for a single ROMClass:

    1: 0x2234F7DC ROMCLASS: java/lang/Runnable at 0x213684A8\n            Index 1 in class path 0x2234FA6C\n

Stale classes are marked with !STALE!. Any partition or modification context that is used when the class is stored is also shown.

"},{"location":"shrc_diag_util/#aot-methods","title":"AOT methods","text":"

This example shows an entry for one AOT-compiled method:

    1: 0x00007F841A800554 AOT: hashCode Signature: ()I Address: 0x00007F83F6859280\n            for ROMClass java/lang/Object at 0x00007F83F6859000.\n

Stale methods are marked with !STALE!.

"},{"location":"shrc_diag_util/#urls-and-tokens","title":"URLs and tokens","text":"

The output for these data types has the same format as that for class paths, but with a single entry. A Token is a string that is passed to the Java SharedClassHelper API.

"},{"location":"shrc_diag_util/#zip-entry-caches","title":"Zip entry caches","text":"

The following example shows 4 separate entries for zip entry caches:

    1: 0x042FE07C ZIPCACHE: luni-kernel.jar_347075_1272300300_1 Address: 0x042FE094 Size: 7898\n    1: 0x042FA878 ZIPCACHE: luni.jar_598904_1272300546_1 Address: 0x042FA890 Size: 14195\n    1: 0x042F71F8 ZIPCACHE: nio.jar_405359_1272300546_1 Address: 0x042F7210 Size: 13808\n    1: 0x042F6D58 ZIPCACHE: annotation.jar_13417_1272300554_1 Address: 0x042F6D70 Size: 1023\n
"},{"location":"shrc_diag_util/#jit-data","title":"JIT data","text":"

Information about JIT data is shown in JITPROFILE and JITHINT entries. For example:

    1: 0xD6290368 JITPROFILE: getKeyHash Signature: ()I Address: 0xD55118C0\n    for ROMClass java/util/Hashtable$Entry at 0xD5511640.\n    2: 0xD6283848 JITHINT: loadClass Signature: (Ljava/lang/String;)Ljava/lang/Class; Address: 0xD5558F98\n    for ROMClass com/ibm/oti/vm/BootstrapClassLoader at 0xD5558AE0.\n
"},{"location":"shrc_diag_util/#startup-hints","title":"Startup hints","text":"

Information about startup hints is shown in STARTUP HINTS KEY and STARTUP HINTS DETAIL. For example:

    1: 0x000000002237C6E0 STARTUP HINTS KEY: -Xoptionsfile=jre\\bin\\compressedrefs\\options.default -Xlockword:mode=default -Xjcl:jclse29 -Dcom.ibm.oti.vm.bootstrap.library.path=jre\\bin\\compressedrefs;jre\\bin -Djava.home=jre -Djava.ext.dirs=jre\\lib\\ext -Duser.dir=bin -Djava.class.path=. -Dsun.java.launcher=SUN_STANDARD Address: 0x000000002237C700 Size: 96\n    STARTUP HINTS DETAIL Flags: 1 DATA1: 1677721 DATA2: 5033165\n
"},{"location":"shrc_diag_util/#printtoplayerstats","title":"printTopLayerStats","text":"

Use this utility with a layered cache. This utility works in the same way as printStats. By default, this utility shows information for the top layer cache. To view statistics for a specific layer, use the layer=<number> option. For example, to show statistics for the second layer in a 2-layer cache, run printTopLayerStats,layer=1.

Example output:

Current statistics for cache \"Cache1\":\n\nCache created with:\n        -Xnolinenumbers                      = false\n        BCI Enabled                          = true\n        Restrict Classpaths                  = false\n        Feature                              = cr\n\n\nbase address                         = 0x00007F234C054000\nend address                          = 0x00007F234D038000\nallocation pointer                   = 0x00007F234C054000\n\ncache layer                          = 1\ncache size                           = 16776608\nsoftmx bytes                         = 16776608\nfree bytes                           = 15299372\nReserved space for AOT bytes         = -1\nMaximum space for AOT bytes          = -1\nReserved space for JIT data bytes    = -1\nMaximum space for JIT data bytes     = -1\nMetadata bytes                       = 792\nMetadata % used                      = 0%\nClass debug area size                = 1331200\nClass debug area used bytes          = 0\nClass debug area % used              = 0%\n\nROMClass bytes                       = 0\nAOT bytes                            = 30520\nJIT data bytes                       = 644\nZip cache bytes                      = 0\nStartup hint bytes                   = 0\nData bytes                           = 114080\n\n# ROMClasses                         = 0\n# AOT Methods                        = 18\n# Classpaths                         = 0\n# URLs                               = 0\n# Tokens                             = 0\n# Zip caches                         = 0\n# Startup hints                      = 0\n# Stale classes                      = 0\n% Stale classes                      = 0%\n\n\nCache is 8% full\n\nCache is accessible to current user = true\n
"},{"location":"shrc_diag_util/#using-the-trace-facility","title":"Using the trace facility","text":"

Trace output contains very detailed information that might be used by a VM developer to diagnose complex problems with class data sharing. Trace is configured by using the -Xtrace option and the binary output of the trace facility must be processed by the Trace formatter into a human-readable format.

The trace component for class data sharing is j9shr. Five levels of trace are available, starting from basic initialization and runtime information in level 1 up to the most detailed trace output in level 5.

To trace memory-mapped files, shared memory, and shared semaphores, include the j9prt trace component.

To trace operations with Java Helper API methods, include the j9jcl trace component.

"},{"location":"tool_builder/","title":"Option builder","text":""},{"location":"tool_builder/#option-builder-tools","title":"Option builder tools","text":"

You can modify many of the command-line options by specifying a number of parameters.

Several of the options have many available parameters that you can combine in numerous ways to achieve the effect you want.

Tools are available for the following options to help you select these parameters correctly, achieve the correct combinations, and avoid conflicts:

"},{"location":"tool_jcmd/","title":"Java command (jcmd) tool","text":""},{"location":"tool_jcmd/#java-diagnostic-command-jcmd-tool","title":"Java diagnostic command (jcmd) tool","text":"

Use the jcmd tool to run diagnostic commands on a specified VM.

Note: Running diagnostic commands can significantly affect the performance of the target VM.

The command syntax is as follows:

jcmd [<options>] [<vmid | display name | 0> <arguments>]\n

Where:

Examples:

jcmd 31452 Thread.print\njcmd 31452 help Dump.heap\njcmd 31452 Dump.heap myHeapDump\n

Restrictions: This tool is not supported and is subject to change or removal in future releases. Although similar in usage and output to the HotSpot tool of the same name, this tool is a different implementation that is specific to Eclipse OpenJ9\u2122. For information about the differences between these two implementations, see Switching to OpenJ9.

The tool uses the Attach API, and has the following limitations:

For more information about the Attached API, including how to enable and secure it, see Java Attach API.

"},{"location":"tool_jcmd/#see-also","title":"See Also","text":""},{"location":"tool_jdmpview/","title":"Dump viewer","text":""},{"location":"tool_jdmpview/#dump-viewer-jdmpview","title":"Dump viewer (jdmpview)","text":"

The dump viewer is a command-line tool that allows you to examine the contents of system dumps produced from the Eclipse OpenJ9\u2122 VM. The dump viewer allows you to view both Java\u2122 and native information from the time the dump was produced. You can run the dump viewer on one platform to work with dumps from another platform.

For long running tasks, the dump viewer can also be run in batch mode.

The dump viewer is useful for diagnosing OutOfMemoryError exceptions in Java\u2122 applications. For problems like general protection faults (GPFs), system abends, and SIGSEGVs, a system debugger such as gdb (Linux) provides more information.

"},{"location":"tool_jdmpview/#syntax","title":"Syntax","text":""},{"location":"tool_jdmpview/#starting-the-dump-viewer","title":"Starting the dump viewer","text":"

jdmpview [-J<vm option>] (-core <core file> | -zip <zip file>) [-notemp]

Input option Explanation -core <core file> Specifies a dump file. -zip <zip file> Specifies a compressed file containing the core file (produced by the dump extractor (jpackcore) tool on AIX\u00ae, Linux\u00ae, and macOS\u00ae systems). -notemp By default, when you specify a file by using the -zip option, the contents are extracted to a temporary directory before processing. Use the -notemp option to prevent this extraction step, and run all subsequent commands in memory. -J-Dcom.ibm.j9ddr.path.mapping=<mappings> The variable <mappings> is a list of native library mappings of the form old-path=new-path, using the usual path separator (a semi-colon (';') on Windows, and a colon (':') on other platforms). -J-Dcom.ibm.j9ddr.library.path=<path> The variable <path> is a list of paths to search for native libraries, using the usual path separator (a semi-colon (';') on Windows, and a colon (':') on other platforms).

Note: The -core option can be used with the -zip option to specify the core file in the compressed file. With these options, jdmpview shows multiple contexts, one for each source file that it identified in the compressed file.

Note: On AIX and Linux, some jdmpview commands must locate the executable and the native libraries that are referenced by the core. For example, commands that relate to call-sites. A common scenario involves using jdmpview to examine core files that originate on different systems. However, if the executable and the libraries are in their original locations, jdmpview might not consider them. Therefore, first check the executable and the list of native libraries by running jdmpview on a core with the info mod command.

On z/OS\u00ae, you can copy the dump to an HFS file and supply that as input to jdmpview, or you can supply a fully qualified MVS\u2122 data set name. For example:

> jdmpview -core USER1.JVM.TDUMP.SSHD6.D070430.T092211\nDTFJView version 4.29.5, using DTFJ version 1.12.29003\nLoading image from DTFJ...\n

MVS data set names may contain the dollar sign ($). Names that contain a dollar sign must be enclosed by single quotation marks ('). For example:

> jdmpview -core 'USER1.JVM.$TDUMP.SSH$D7.D141211.T045506'\n

After jdmpview processes the dump files, a session starts, showing this message:

For a list of commands, type \"help\"; for how to use \"help\", type \"help help\"\n>\n

If you run the jdmpview tool on a compressed file that contains multiple dumps, the tool detects and shows all the dump files, whether these are system dumps, Java dumps, or heap dumps. Because of this behavior, more than one context might be displayed when you start jdmpview. To switch context, type context <n>, where <n> is the context value for the dump you want to investigate.

On z/OS, a system dump can contain multiple address spaces and an address space can contain multiple VM instances. In this case, the context allows you to select the address space and VM instance within the dump file. The following z/OS example shows address spaces (ASID), with two JVMs occupying address space 0x73 (context 5 and 6). The current context is 5 (CTX:5>), shown with an asterisk. To view the JVM in context 6, you can switch by specifying context 6.

CTX:5> context\nAvailable contexts (* = currently selected context) :\n\n0 : ASID: 0x1 : No JRE : No JRE\n1 : ASID: 0x3 : No JRE : No JRE\n2 : ASID: 0x4 : No JRE : No JRE\n3 : ASID: 0x6 : No JRE : No JRE\n4 : ASID: 0x7 : No JRE : No JRE\n*5 : ASID: 0x73 EDB: 0x83d2053a0 : JRE 1.8.0 z/OS s390x-64 build 20181117_128845 (pmz6480-20181120_01)\n6 : ASID: 0x73 EDB: 0x8004053a0 : JRE 1.8.0 z/OS s390x-64 build 20181117_128845 (pmz6480-20181120_01)\n7 : ASID: 0x73 EDB: 0x4a7bd9e8 : No JRE\n8 : ASID: 0xffff : No JRE : No JRE\n

If you are using jdmpview to view Java dumps and heap dumps, some options do not produce any output. For example, a heap dump doesn't contain the information requested by the info system command, but does contain information requested by the info class command.

If you are viewing a dump where there are a large number of objects on the heap, you can speed up the performance of jdmpview by ensuring that your system has enough memory available and does not need to page memory to disk. To achieve this, start jdmpview with a larger heap size by specifying the -Xmx option. Use the -J option to pass the -Xmx command line option to the JVM. For example:

jdmpview -J-Xmx<n> -core <core file>\n

The options available to the dump viewer session are shown under Session parameters

"},{"location":"tool_jdmpview/#starting-in-batch-mode","title":"Starting in batch mode","text":"

For long running or routine jobs, jdmpview can be used in batch mode.

You can run a single command without specifying a command file by appending the command to the end of the jdmpview command line. For example:

jdmpview -core mycore.dmp info class\n

When specifying jdmpview commands that accept a wildcard parameter, you must replace the wildcard symbol with ALL to prevent the shell interpreting the wildcard symbol. For example, in interactive mode, the command info thread * must be specified in the following way:

jdmpview -core mycore.dmp info thread ALL\n

Batch mode is controlled with the following command line options:

Option Explanation -cmdfile <path to command file> A file that contains a series of jdmpview commands, which are read and run sequentially. -charset <character set name> The character set for the commands specified in -cmdfile (name must be a supported charset as defined in java.nio.charset.Charset. For example, US-ASCII) -outfile <path to output file> The file to record any output generated by commands. -overwrite If the file specified in -outfile exists, this option overwrites the file. -append If the file specified in -outfile exists, new output messages are appended to the end of that file. The -append and -overwrite options cannot be used at the same time.

The command file can have empty lines that contain spaces, or comment lines that start with // or #. These lines are ignored by jdmpview. Example command file:

// commands.txt\ninfo system\ninfo proc\n

To run jdmpview in batch mode, using this command file, specify:

jdmpview -outfile out.txt [-overwrite|-append] -cmdfile commands.txt -core <path to core file>\n

When the output file exists, you need to specify either the -overwrite option or the -append option. If you do not, an error message is generated.

"},{"location":"tool_jdmpview/#processing-output","title":"Processing output","text":"

You can redirect command output to a file, or pipe the command output to another command.

To redirect jdmpview command output to a file, use one of the following formats:

command > <target_file>\n

If the target file exists, this redirection overwrites the content within it.

command >> <target_file>\n

If the target file exists, this redirection appends the output to it.

Where <target_file> is the file name, which can include the full path to the file.

To pipe jdmpview command output to another command, use the vertical bar (|) character. For example:

command | grep string\n

You can chain more than two commands together by using multiple vertical bar characters.

The following commands can be used to interrogate the output:

"},{"location":"tool_jdmpview/#using-charsfrom","title":"Using CharsFrom","text":"

Use the charsFrom command after the vertical bar character to exclude all characters that come before a specified pattern in a resulting line.

charsFrom <options> pattern\n

Where <options>:

For example, the following command displays resulting lines that contain the pattern jre, and trims each line to exclude all characters that come before this pattern:

> info mod | charsFrom jre\njre/lib/ppc64/libzip.so @ 0x0, sections:\njre/lib/ppc64/libdbgwrapper80.so @ 0x0, sections:\njre/lib/ppc64/libverify.so @ 0x0, sections:\njre/lib/ppc64/libjava.so @ 0x0, sections:\njre/lib/ppc64/compressedrefs/libjclse7b_28.so @ 0x0, sections:\n
"},{"location":"tool_jdmpview/#using-charsto","title":"Using CharsTo","text":"

Use the CharsTo command after the vertical bar character to include the characters in a resulting line until a specific pattern is found.

charsTo <options> pattern\n

Where <options>:

For example, the following command displays lines that contain the pattern @, and trims each line to exclude all characters from @ onwards:

> info mod | charsTo @\nbin/java\n/usr/lib64/gconv/UTF-16.so\n/test/sdk/lib/ppc64le/libnet.so\n/test/sdk/lib/ppc64le/libnio.so\n/test/sdk/lib/ppc64le/libzip.so\n/test/sdk/lib/ppc64le/libjsig.so\nlibjsig.so\n

You can also use charsFrom and charsTo together, separated by a vertical bar character. For example, the following command displays lines that contain the pattern lib, and trims each line to exclude all characters that come before this pattern, as well as all characters from the pattern @ :

> info mod | charsFrom lib | charsTo @\nlib/ppc64le/libzip.so\nlib/ppc64le/libjsig.so\nlib/ppc64le/libverify.so\nlib/ppc64le/libjava.so\nlib/ppc64le/compressedrefs/libj9jit29.so\n

Note: The line will not be displayed if the charsFrom and charsTo are used together, but only one of the patterns are matched in a line. Furthermore, the line will not be displayed if both patterns are matched in a line, but the charsTo pattern appears before, and not after, the charsFrom pattern.

"},{"location":"tool_jdmpview/#using-grep","title":"Using grep","text":"

Use the grep command after the vertical bar character to show which lines match a specified pattern.

grep <options> pattern\n

Where <options>:

Pattern rules:

In the following example, the command displays the number of instances and total heap size for the java/lang/String class:

> info class | grep java/lang/String\n94 7688 [Ljava/lang/String;\n1822 58304 java/lang/String               \n1 16 java/lang/String$CaseInsensitiveComparator              \n0 0 java/lang/String$UnsafeHelpers\n

In the following example, the command uses two pipes in combination to display the number of instances and total heap size for the java/lang/StringCoding.StringDecoder class:

> info class | grep java/lang/String | grep -i decoder\n1 48 java/lang/StringCoding$StringDecoder\n
"},{"location":"tool_jdmpview/#using-tokens","title":"Using tokens","text":"

Use the tokens command after the vertical bar character to isolate specified tokens in the resulting lines.

tokens [options] range[,range][..range]\n

You can define range in the following formats:

A set of rules applies to these formats:

In this format, if x is omitted, it is assumed to be 1. If y is omitted, it is assumed to be -1.

For example, the following command displays the first and second token for each resulting line:

> info mmap | grep -r ^0x | tokens 1,2\n0x0000000000012fff 0x000000000000d000\n0x0000000000017fff 0x0000000000004000\n0x00000000009dafff 0x0000000000018000\n0x00000000009fffff 0x000000000001f000\n0x0000000000cbefff 0x0000000000002000\n0x0000000000d76fff 0x0000000000001000\n0x0000000003145fff 0x0000000000071000\n0x0000000003b93fff 0x0000000000003000\n
"},{"location":"tool_jdmpview/#session-parameters","title":"Session parameters","text":"

When jdmpview is started, many parameters can be used during the session to interrogate the system dump data, which are divided into general and expert parameters. The general parameters are documented in this section. To see a list of expert parameters, use the !j9help option.

"},{"location":"tool_jdmpview/#j9help","title":"!j9help","text":"
    !j9help\n
Lists all expert parameters that can be used in a session, with a brief description.

Note: The expert parameters are subject to change and not intended as a supported interface.

"},{"location":"tool_jdmpview/#cd","title":"cd","text":"
    cd <directory_name>\n
Changes the working directory to <directory_name>. The working directory is used for log files. Logging is controlled by the set logging command. Use the pwd command to query the current working directory."},{"location":"tool_jdmpview/#cmdfile","title":"cmdfile","text":"
    cmdfile <directory_name>\n
Runs all of the commands in a file. The commands are read line by line and run sequentially. Empty lines, and lines that start with // or #, are ignored. Use the option charset to identify the character set that is used in the chosen file. The character set must be supported, as defined in java.nio.charset.Charset, such as US-ASCII."},{"location":"tool_jdmpview/#deadlock","title":"deadlock","text":"

This command detects deadlock situations in the Java application that was running when the system dump was produced. Example output:

deadlock loop:\nthread: Thread-2 (monitor object: 0x9e32c8) waiting for =>\nthread: Thread-3 (monitor object: 0x9e3300) waiting for =>\nthread: Thread-2 (monitor object: 0x9e32c8)\n

In this example, the deadlock analysis shows that Thread-2 is waiting for a lock held by Thread-3, which is in turn waiting for a lock held earlier by Thread-2.

Threads are identified by their Java thread name, whereas object monitors are identified by the address of the object in the Java heap. You can obtain further information about the threads using the info thread * command. You can obtain further information about the monitors using the x/J <0xaddr> command.

"},{"location":"tool_jdmpview/#find","title":"find","text":"
    find <pattern>,<start_address>,<end_address>,<memory_boundary>, <bytes_to_print>,<matches_to_display>\n

This command searches for <pattern> in the memory segment from <start_address> to <end_address> (both inclusive), and shows the number of matching addresses you specify with <matches_to_display>. You can also display the next <bytes_to_print> bytes for the last match.

By default, the find command searches for the pattern at every byte in the range. If you know the pattern is aligned to a particular byte boundary, you can specify <memory_boundary> to search every <memory_boundary> bytes. For example, if you specify a <memory_boundary> of \"4\", the command searches for the pattern every 4 bytes.

"},{"location":"tool_jdmpview/#findnext","title":"findnext","text":"Finds the next instance of the last string passed to find or findptr. It repeats the previous find or findptr command, depending on which one was issued last, starting from the last match."},{"location":"tool_jdmpview/#findptr","title":"findptr","text":"
    findptr <pattern>,<start_address>,<end_address>,<memory_boundary>,<bytes_to_print>,<matches_to_display>\n

Searches memory for the given pointer. findptr searches for <pattern> as a pointer in the memory segment from <start_address> to <end_address> (both inclusive), and shows the number of matching addresses you specify with <matches_to_display>. You can also display the next <bytes_to_print> bytes for the last match.

By default, the findptr command searches for the pattern at every byte in the range. If you know the pattern is aligned to a particular byte boundary, you can specify <memory_boundary> to search every <memory_boundary> bytes. For example, if you specify a <memory_boundary> of \"4\", the command searches for the pattern every 4 bytes.

"},{"location":"tool_jdmpview/#help","title":"help","text":"
    help [<command_name>]\n
Shows information for a specific command. If you supply no parameters, help shows the complete list of supported commands."},{"location":"tool_jdmpview/#history","title":"history","text":"
    history|his [-r][<N>]\n
Recalls and displays the history of commands that you have run. The default behavior is to display the 20 most recent commands. If you use the argument <N>, then N commands are displayed. For example, if you run history 35, then the 35 most recent commands are displayed. You can also use the -r option with <N> to run the Nth most recent command in your history. Using the -r option alone runs the most recent command in your history."},{"location":"tool_jdmpview/#info-thread","title":"info thread","text":"
    info thread [*|all|<native_thread_ID>|<zos_TCB_address>]\n

Displays information about Java and native threads. The following information is displayed for all threads (\"*\"), or the specified thread:

If you supply no parameters, the command shows information about the current thread.

"},{"location":"tool_jdmpview/#info-system","title":"info system","text":"

Displays the following information about the system that produced the core dump:

"},{"location":"tool_jdmpview/#info-class","title":"info class","text":"
    info class [<class_name>] [-sort:<name>|<count>|<size>]\n
Displays the inheritance chain and other data for a given class.

If a class name is passed to info class, the following information is shown about that class:

If no parameters are passed to info class, the following information is shown:

The sort option allows the list of classes to be sorted by name (default), by number of instances of each class, or by the total size of instances of each class.

"},{"location":"tool_jdmpview/#info-proc","title":"info proc","text":"

Displays threads, command-line arguments, environment variables, and shared modules of the current process.

To view the shared modules used by a process, use the info sym command.

"},{"location":"tool_jdmpview/#info-jitm","title":"info jitm","text":"

Displays JIT compiled methods and their addresses:

"},{"location":"tool_jdmpview/#info-lock","title":"info lock","text":"Displays a list of available monitors and locked objects."},{"location":"tool_jdmpview/#info-sym","title":"info sym","text":"Displays a list of available modules. For each process in the address spaces, this command shows a list of module sections for each module, their start and end addresses, names, and sizes."},{"location":"tool_jdmpview/#info-mmap","title":"info mmap","text":"
    info mmap [<address>] [-verbose] [-sort:<size>|<address>]\n
Displays a summary list of memory sections in the process address space, with start and end address, size, and properties. If an address parameter is specified, the results show details of only the memory section containing the address. If -verbose is specified, full details of the properties of each memory section are displayed. The -sort option allows the list of memory sections to be sorted by size or by start address (default)."},{"location":"tool_jdmpview/#info-mod","title":"info mod","text":"Displays a list of native library modules in the process address space, which includes file paths and other information about each module."},{"location":"tool_jdmpview/#info-heap","title":"info heap","text":"
    info heap [*|<heap_name>*]\n

If no parameters are passed to this command, the heap names and heap sections are shown.

Using either \"*\" or a heap name shows the following information about all heaps or the specified heap:

"},{"location":"tool_jdmpview/#heapdump","title":"heapdump","text":"
    heapdump [<heaps>]\n
Generates a Java heap dump to a file. You can select which Java heaps to dump by listing the heap names, separated by spaces. To see which heaps are available, use the info heap command. By default, all Java heaps are dumped."},{"location":"tool_jdmpview/#hexdump","title":"hexdump","text":"
    hexdump <hex_address> <bytes_to_print>\n
Displays a section of memory in a hexdump-like format. Displays <bytes_to_print> bytes of memory contents starting from <hex_address>."},{"location":"tool_jdmpview/#_1","title":"+","text":"Displays the next section of memory in hexdump-like format. This command is used with the hexdump command to enable easy scrolling forwards through memory. The previous hexdump command is repeated, starting from the end of the previous one."},{"location":"tool_jdmpview/#-","title":"-","text":"Displays the previous section of memory in hexdump-like format. This command is used with the hexdump command to enable easy scrolling backwards through memory. The previous hexdump command is repeated, starting from a position before the previous one."},{"location":"tool_jdmpview/#pwd","title":"pwd","text":"Displays the current working directory, which is the directory where log files are stored."},{"location":"tool_jdmpview/#quit","title":"quit","text":"Exits the core file viewing tool; any log files that are currently open are closed before exit."},{"location":"tool_jdmpview/#set-heapdump","title":"set heapdump","text":"Configures Heapdump generation settings.
set heapdump <options>\n

where <options> are:

"},{"location":"tool_jdmpview/#set-logging","title":"set logging","text":"
    set logging <options>\n

Configures logging settings, starts logging, or stops logging. This parameter enables the results of commands to be logged to a file, where <options> are:

Redirect must be turned off before logging can be turned off. (Default: off)

"},{"location":"tool_jdmpview/#show-heapdump","title":"show heapdump","text":"
    show heapdump <options>\n
Displays the current heap dump generation settings."},{"location":"tool_jdmpview/#show-logging","title":"show logging","text":"
    show logging <options>\n

Displays the current logging settings:

The file that is currently being logged to might be different from set_logging_file, if that value was changed after logging was started.

"},{"location":"tool_jdmpview/#whatis-hex_address","title":"whatis <hex_address>","text":"Displays information about whatis stored at the given memory address, <hex_address>. This command examines the memory location at <hex_address> and tries to find out more information about this address. For example:
> whatis 0x8e76a8\n\nheap #1 - name: Default@19fce8\n0x8e76a8 is within heap segment: 8b0000 -- cb0000\n0x8e76a8 is start of an object of type java/lang/Thread\n
"},{"location":"tool_jdmpview/#x-examine","title":"x/ (examine)","text":"

Passes the number of items to display and the unit size, as listed in the following table, to the sub-command. For example, x/12bd.

Abbreviation Unit Size b Byte 8-bit h Half word 16-bit w Word 32-bit g Giant word 64-bit

This command is similar to the use of the x/ command in gdb, including the use of defaults.

"},{"location":"tool_jdmpview/#xj-class_name0xaddr","title":"x/J [<class_name>|<0xaddr>]","text":"

Displays information about a particular object, or all objects of a class. If <class_name> is supplied, all static fields with their values are shown, followed by all objects of that class with their fields and values. If an object address (in hex) is supplied, static fields for that object's class are not shown; the other fields and values of that object are printed along with its address.

Note: This command ignores the number of items and unit size passed to it by the x/ command.

"},{"location":"tool_jdmpview/#xd-0xaddr","title":"x/D <0xaddr>","text":"

Displays the integer at the specified address, adjusted for the hardware architecture this dump file is from. For example, the file might be from a big-endian architecture.

This command uses the number of items and unit size passed to it by the x/ command.

"},{"location":"tool_jdmpview/#xx-0xaddr","title":"x/X <0xaddr>","text":"

Displays the hex value of the bytes at the specified address, adjusted for the hardware architecture this dump file is from. For example, the file might be from a big-endian architecture.

Note: This command uses the number of items and unit size passed to it by the x/ command.

"},{"location":"tool_jdmpview/#xk-0xaddr","title":"x/K <0xaddr>","text":"

Where the size is defined by the pointer size of the architecture, this parameter shows the value of each section of memory. The output is adjusted for the hardware architecture this dump file is from, starting at the specified address. It also displays a module with a module section and an offset from the start of that module section in memory if the pointer points to that module section. If no symbol is found, it displays a \"*\" and an offset from the current address if the pointer points to an address in 4KB (4096 bytes) of the current address. Although this command can work on an arbitrary section of memory, it is probably more useful on a section of memory that refers to a stack frame. To find the memory section of a thread stack frame, use the info thread command.

Note: This command uses the number of items and unit size passed to it by the x/ command.

"},{"location":"tool_jdmpview/#example","title":"Example","text":"

This example session illustrates a selection of the commands available and their use.

In the example session, which is generated on a Linux system, some lines have been removed for clarity (and terseness).

User input is prefaced by a greater than symbol (>).

    test@madras:~/test> sdk/bin/jdmpview -core core.20121116.154147.16838.0001.dmp\n    DTFJView version 4.29.5, using DTFJ version 1.12.29003\n    Loading image from DTFJ...\n\n    For a list of commands, type \"help\"; for how to use \"help\", type \"help help\"\n    Available contexts (* = currently selected context) :\n\n    Source : file:///home/test/core.20121116.154147.16838.0001.dmp\n            *0 : PID: 16867 : JRE 1.8.0 Linux ppc64-64 build 20121115_128521 (pxp6480-20121116_01 )\n\n    > help\n    +                                              displays the next section of memory in hexdump-like format\n    -                                              displays the previous section of memory in hexdump-like format\n    cd                                             changes the current working directory, used for log files\n    close                     [context id]         closes the connection to a core file\n    context                   [ID|asid ID]         switch to the selected context\n    deadlock                                       displays information about deadlocks if there are any\n    exit                                           Exit the application\n    find                                           searches memory for a given string\n    findnext                                       finds the next instance of the last string passed to \"find\"\n    findptr                                        searches memory for the given pointer\n    heapdump                                       generates a PHD or classic format heapdump\n    help                      [command name]       displays list of commands or help for a specific command\n    hexdump                                        outputs a section of memory in a hexdump-like format\n    info                      <component>          Information about the specified component\n    info class                <Java class name>    Provides information about the specified Java class\n    info heap                 [*|heap name]        Displays information about Java heaps\n    info jitm                                      Displays JIT'ed methods and their addresses\n    info lock                                      outputs a list of system monitors and locked objects\n    info mmap                                      Outputs a list of all memory segments in the address space\n    info mod                                       outputs module information\n    info proc                                      shortened form of info process\n    info process                                   displays threads, command line arguments, environment\n    info sym                                       an alias for 'mod'\n    info sys                                       shortened form of info system\n    info system                                    displays information about the system the core dump is from\n    info thread                                    displays information about Java and native threads\n    log                       [name level]         display and control instances of java.util.logging.Logger\n    open                      [path to core or zip] opens the specified core or zip file\n    plugins                                        Plugin management commands\n                         list                      Show the list of loaded plug-ins for the current context\n                       reload                      Reload plug-ins for the current context\n                     showpath                      Show the DTFJ View plug-in search path for the current context\n                      setpath                      Set the DTFJ View plug-in search path for the current context\n    pwd                                            displays the current working directory\n    quit                                           Exit the application\n    set                       [logging|heapdump]   Sets options for the specified command\n    set heapdump                                   configures heapdump format, filename and multiple heap support\n    set logging                                    configures several logging-related parameters, starts/stops logging\n                           on                      turn on logging\n                          off                      turn off logging\n                         file                      turn on logging\n                    overwrite                      controls the overwriting of log files\n    show                      [logging|heapdump]   Displays the current set options for a command\n    show heapdump                                  displays heapdump settings\n    show logging                                   shows the current logging options\n    whatis                    [hex address]        gives information about what is stored at the given memory address\n    x/d                       <hex address>        displays the integer at the specified address\n    x/j                       <object address> [class name] displays information about a particular object or all objects of a class\n    x/k                       <hex address>        displays the specified memory section as if it were a stack frame parameters\n    x/x                       <hex address>        displays the hex value of the bytes at the specified address\n\n    > set logging file log.txt\n    logging turned on; outputting to \"/home/test/log.txt\"\n\n    > info system\n    Machine OS:     Linux\n    Hypervisor:     PowerVM\n    Machine name:   madras\n    Machine IP address(es):\n                    9.20.88.155\n    System memory:  8269201408\n\n    Dump creation time: 2015/08/10 14:44:36:019\n    Dump creation time (nanoseconds): 21314421467539\n\n    Java version:\n    JRE 1.8.0 Linux ppc64-64 build 20121115_128521 (pxp6490-20121116_01)\n\n    JVM start time: 2015/08/10 14:44:05:690\n    JVM start time (nanoseconds): 21284086192267\n\n    > info thread *\n    native threads for address space\n     process id: 16838\n\n      thread id: 16839\n       registers:\n\n       native stack sections:\n       native stack frames:\n       properties:\n       associated Java thread:\n        name:          main\n        Thread object: java/lang/Thread @ 0x2ffd1e08\n        Priority:      5\n        Thread.State:  RUNNABLE\n        JVMTI state:   ALIVE RUNNABLE\n        Java stack frames:\n         bp: 0x0000000000085b28  method: void com/ibm/jvm/Dump.SystemDumpImpl()  (Native Method)\n          objects: <no objects in this frame>\n         bp: 0x0000000000085b40  method: void com/ibm/jvm/Dump.SystemDump()  source: Dump.java:41\n          objects: <no objects in this frame>\n         bp: 0x0000000000085b68  method: void mySystemDump.main(String[])  source: mySystemDump.java:29\n          objects: <no objects in this frame>\n    ===Lines Removed===\n\n        name:          GC Worker\n        id:            16860\n        Thread object: java/lang/Thread @ 0x3001b980\n        Priority:      5\n        Thread.State:  WAITING\n        JVMTI state:   ALIVE WAITING WAITING_INDEFINITELY IN_OBJECT_WAIT\n          waiting to be notified on: \"MM_ParallelDispatcher::workerThread\" with ID 0x1004cbc8 owner name: <unowned>\n        Java stack frames: <no frames to print>\n\n        name:          GC Worker\n        id:            16861\n        Thread object: java/lang/Thread @ 0x3001c180\n        Priority:      5\n        Thread.State:  WAITING\n        JVMTI state:   ALIVE WAITING WAITING_INDEFINITELY IN_OBJECT_WAIT\n          waiting to be notified on: \"MM_ParallelDispatcher::workerThread\" with ID 0x1004cbc8 owner name: <unowned>\n        Java stack frames: <no frames to print>\n\n        name:          Signal Dispatcher\n        id:            16847\n        Thread object: com/ibm/misc/SignalDispatcher @ 0x3000f268\n        Priority:      5\n        Thread.State:  RUNNABLE\n        JVMTI state:   ALIVE RUNNABLE\n        Java stack frames:\n         bp: 0x00000000000df748  method: int com/ibm/misc/SignalDispatcher.waitForSignal()  (Native Method)\n          objects: <no objects in this frame>\n         bp: 0x00000000000df788  method: void com/ibm/misc/SignalDispatcher.run()  source: SignalDispatcher.java:54\n          objects: 0x30015828 0x30015828\n    ===Lines Removed===\n\n\n    > info heap *\n\n             Heap #1:  Generational@fff78303d30\n              Section #1:  Heap extent at 0x100d0000 (0x300000 bytes)\n               Size:        3145728 bytes\n               Shared:      false\n               Executable:  false\n               Read Only:   false\n              Section #2:  Heap extent at 0x2ffd0000 (0x80000 bytes)\n               Size:        524288 bytes\n               Shared:      false\n               Executable:  false\n               Read Only:   false\n              Section #3:  Heap extent at 0x30050000 (0x80000 bytes)\n               Size:        524288 bytes\n               Shared:      false\n               Executable:  false\n               Read Only:   false\n\n    > info class java/lang/String\n    name = java/lang/String\n\n            ID = 0x37c00    superID = 0x30300\n            classLoader = 0x2ffe9b58    modifiers: public final\n\n            number of instances:     2146\n            total size of instances: 51504 bytes\n\n    Inheritance chain....\n            java/lang/Object\n               java/lang/String\n\n    Fields......\n              static fields for \"java/lang/String\"\n                private static final long serialVersionUID = -6849794470754667710 (0xa0f0a4387a3bb342)\n                public static final java.util.Comparator CASE_INSENSITIVE_ORDER = <object> @ 0x2ffd0278\n                private static final char[] ascii = <object> @ 0x2ffd02c8\n                private static String[] stringArray = <object> @ 0x2ffd0298\n                private static final int stringArraySize = 10 (0xa)\n                static boolean enableCopy = false\n                private static int seed = -126504465 (0xfffffffff875b1ef)\n                private static char[] startCombiningAbove = <object> @ 0x100d0c40\n                private static char[] endCombiningAbove = <object> @ 0x100d0cc0\n                private static final char[] upperValues = <object> @ 0x100d0d40\n                private static final java.io.ObjectStreamField[] serialPersistentFields = <object> @ 0x2ffd0920\n\n              non-static fields for \"java/lang/String\"\n                private final char[] value\n                private final int offset\n                private final int count\n                private int hashCode\n                private int hashCode32\n\n    Methods......\n\n    Bytecode range(s): :  private static native int getSeed()\n    Bytecode range(s): fff76d8ce48 -- fff76d8ce5e:  public void <init>()\n    Bytecode range(s): fff76d8ce88 -- fff76d8cecd:  private void <init>(String, char)\n    Bytecode range(s): fff76d8cf10 -- fff76d8cf19:  public void <init>(byte[])\n    Bytecode range(s): fff76d8cf40 -- fff76d8cf4a:  public void <init>(byte[], int)\n    Bytecode range(s): fff76d8cf7c -- fff76d8cfb5:  public void <init>(byte[], int, int)\n    Bytecode range(s): fff76d8cff8 -- fff76d8d065:  public void <init>(byte[], int, int, int)\n    Bytecode range(s): fff76d8d0c4 -- fff76d8d10c:  public void <init>(byte[], int, int, String)\n    ===Lines Removed===\n\n    > whatis  0x2ffd0298\n            heap #1 - name: Generational@fff78303d30\n                    0x2ffd0298 is within heap segment: 2ffd0000 -- 30050000\n                    0x2ffd0298 is the start of an object of type [Ljava/lang/String;\n
"},{"location":"tool_jextract/","title":"Dump extractor","text":""},{"location":"tool_jextract/#dump-extractor-jpackcore","title":"Dump extractor (jpackcore)","text":"

(AIX\u00ae, Linux\u00ae, macOS\u00ae)

On some operating systems, copies of executable files and libraries are required for a full analysis of a core dump (you can get some information from the dump without these files, but not as much). Run the jpackcore utility to collect these extra files and package them into an archive file along with the core dump. To analyze the output, use the dump viewer (jdmpview).

Note: This tool replaces OpenJ9 jextract, which is deprecated in Eclipse OpenJ9\u2122 version 0.26.0.

The OpenJ9 jextract tool is removed from Java 21 and later.

"},{"location":"tool_jextract/#syntax","title":"Syntax","text":"
jpackcore [-r] [-x] <core file name> [<zip_file>]\n

where:

Restriction: You should run jpackcore on the same system that produced the system dump in order to collect the correct executables and libraries referenced in the system dump. You should also run jpackcore using the same VM level, to avoid any problems. From Eclipse OpenJ9 V0.24.0, the utility always checks that the build ID of the SDK that created the dump file matches the jpackcore build ID. Where these IDs do not match, the following exception is thrown:

J9RAS.buildID is incorrect (found XXX, expecting YYY). This version of jpackcore is incompatible with this dump (use '-r' option to relax this check).\n

To continue, despite the mismatch, use the -r option.

"},{"location":"tool_jextract/#see-also","title":"See also","text":""},{"location":"tool_jmap/","title":"Java memory map (jmap) tool","text":""},{"location":"tool_jmap/#java-memory-map-jmap-tool","title":"Java memory map (jmap) tool","text":"

Use the jmap tool to get memory information for a particular Java\u2122 process, or list of processes. The tool shows statistics about classes on the heap, including the number of objects and their aggregate size. The command syntax is as follows:

jmap [<option>] [<vmid>]\n

<vmid> is the Attach API virtual machine identifier for the Java process. This ID is typically the same as the operating system process ID, unless you specified the -Dcom.ibm.tools.attach.id system property when you started the process.

VMID is shown in jps or other Attach API-based tools. Multiple VMIDs can be specified, separated by a space.

If you do not specify a VMID, the command reads input from stdin. You can therefore get information for all processes by piping the output of the jps command to jmap:

jps -q | jmap -histo

IDs of dead processes are silently ignored.

On its own, jmap prints help information. To obtain memory information, a -histo argument must be supplied, where the available <options> are as follows:

The output has the following format:

num   object count     total size    class name\n-------------------------------------------------\n  1           3354         107328    [C\n  2            717          57360    java.lang.Class\n  3           2427          38832    java.lang.String\n  4             50          13200    [J\n  5            717          11472    java.lang.J9VMInternals$ClassInitializationLock\n  6            342           8208    java.lang.StringBuilder\n  7            151           7248    jdk.internal.org.objectweb.asm.Item\n  8            396           6336    [Ljava.lang.Object;\n

Restrictions: This tool is not supported and is subject to change or removal in future releases. Although similar in usage and output to the HotSpot tool of the same name, this tool is a different implementation that is specific to Eclipse OpenJ9\u2122.

The following tool limitations apply:

The tool uses the Attach API, and has the following limitations:

For more information about the Attach API, including how to enable and secure it, see Java Attach API.

"},{"location":"tool_jps/","title":"Java process status (jps)","text":""},{"location":"tool_jps/#java-process-status-jps-tool","title":"Java process status (jps) tool","text":"

Use the jps tool to query running Java\u2122 processes. The tool shows information for every Java process that is owned by the current user ID on the current host. The command syntax is as follows:

jps [<options>]\n

where the available <options> are as follows:

The output has the following format:

<VMID> [[<class_name>|<jar_name>|\"Unknown\"] [<application_args>][<vm_args>]]\n

where VMID is the Attach API virtual machine identifier for the Java process. This ID is often, but not always, the same as the operating system process ID. One example where the ID might be different is if you specified the system property -Dcom.ibm.tools.attach.id when you started the process.

For example:

$ jps -l\n5462  org.foo.bar.MyApplication\n14332 openj9.tools.attach.diagnostics.Jps\n\n$ jps -q\n5462\n14332\n

Restrictions: This tool is not supported and is subject to change or removal in future releases. Although similar in usage and output to the HotSpot tool of the same name, this tool is a different implementation that is specific to Eclipse OpenJ9\u2122.

The tool uses the Attach API, and has the following limitations:

For more information about the Attach API, including how to enable and secure it, see Java Attach API.

"},{"location":"tool_jstack/","title":"Java stack (jstack) tool","text":""},{"location":"tool_jstack/#java-stack-jstack-tool","title":"Java stack (jstack) tool","text":"

Use the jstack tool to obtain Java stack traces and thread information for processes. The tool is similar to the HotSpot tool of the same name; the Eclipse OpenJ9\u2122 version of jstack is an independent implementation, added for compatibility.

The command syntax is as follows:

jstack <options>* <pid>*\n

Where <pid>* is a list of process IDs. If none are supplied, the process IDs are read from stdin, which allows a user running a Bourne or equivalent shell to query all processes via jps -q | jstack. IDs of inactive processes are silently ignored. The output contains Java stacks and thread information of the specified processes (equivalent to the information provided in java.lang.management.ThreadInfo).

The values for <options>* are as follows:

Restrictions:

The tool uses the Attach API, and has the following limitations:

For more information about the Attach API, including how to enable and secure it, see Java Attach API.

"},{"location":"tool_jstat/","title":"Java statistics monitoring (jstat) tool","text":""},{"location":"tool_jstat/#java-statistics-monitoring-jstat-tool","title":"Java statistics monitoring (jstat) tool","text":"

Use the jstat tool to obtain Java Virtual Machine (JVM) statistics. The tool is similar to the HotSpot tool of the same name; the Eclipse OpenJ9\u2122 version of jstat is an independent implementation, added for compatibility.

The command syntax is as follows:

jstat [<option>] [<vmid>]\n

where vmid is the Attach API virtual machine identifier for the Java process. This ID is typically the same as the operating system process ID, unless you specified the -Dcom.ibm.tools.attach.id system property when you started the process.

VMID is shown in Java process status (jps) tool or other Attach API-based tools.

On its own, jstat prints help information. The values for <option> are as follows:

The output has the following format:

Class Loaded    Class Unloaded\n         860                 0\n

Restrictions:

The tool uses the Attach API, and has the following limitations:

For more information about the Attach API, including how to enable and secure it, see Java Attach API.

"},{"location":"tool_migration/","title":"Switching to OpenJ9","text":""},{"location":"tool_migration/#switching-to-eclipse-openj9","title":"Switching to Eclipse OpenJ9","text":"

Eclipse OpenJ9\u2122 provides the following tools, which might differ in behavior from the HotSpot equivalent.

Note: For information about HotSpot equivalences and differences for items other than tools, see New to Eclipse OpenJ9?

"},{"location":"tool_migration/#java-diagnostic-command-tool-jcmd","title":"Java diagnostic command tool (jcmd)","text":"

Runs diagnostic commands on a specified VM. The main difference from the HotSpot jcmd tool is that the following options are not currently supported:

"},{"location":"tool_migration/#java-memory-map-tool-jmap","title":"Java memory map tool (jmap)","text":"

Displays information about classes on the heap, including the number of objects and their aggregate size. The main differences from the HotSpot jmap tool are as follows:

For more information, see jmap.

"},{"location":"tool_migration/#java-process-status-jps","title":"Java process status (jps)","text":"

Displays information about running Java processes. The main differences from the HotSpot jps tool are as follows:

For more information, see Java process status.

"},{"location":"tool_migration/#java-stack-jstack-tool","title":"Java stack (jstack) tool","text":"

Displays information about Java stack traces and thread information for processes. The main differences from the HotSpot jstack tool are as follows:

For more information, see jstack.

"},{"location":"tool_migration/#java-statistics-monitoring-jstat-tool","title":"Java statistics monitoring (jstat) tool","text":"

Displays information about Java statistics for processes. The main difference from the HotSpot jstat tool is that this tool only provides the number of classes loaded and the number of class unloaded.

For more information, see jstat.

"},{"location":"tool_traceformat/","title":"Trace formatter","text":""},{"location":"tool_traceformat/#trace-formatter-traceformat","title":"Trace formatter (traceformat)","text":"

The trace formatter is a Java\u2122 program that converts binary trace point data in a trace file to a readable form. The formatter requires the TraceFormat.dat and J9TraceFormat.dat files, which contain the formatting templates. The formatter produces a file that contains header information about the VM that produced the binary trace file, a list of threads for which trace points were produced, and the formatted trace points with their time stamp, thread ID, trace point ID, and trace point data.

"},{"location":"tool_traceformat/#syntax","title":"Syntax","text":"

To use the trace formatter on a binary trace file type:

    traceformat <input_file>  [<output_file>] <parameters>\n

Where <input_file> is the name of the binary trace file to be formatted, and <output_file> is the name of the output file. If you do not specify an output file, the output file is called input_file.fmt.

The size of the heap that is needed to format the trace is directly proportional to the number of threads present in the trace file. For large numbers of threads the formatter might run out of memory, generating the error OutOfMemoryError. In this case, increase the heap size by using the -Xmx option.

"},{"location":"tool_traceformat/#parameters","title":"Parameters","text":"

The following <parameters> are available with the trace formatter:

Option Explanation -datfile=<file1.dat>[,<file2.dat>] A comma-separated list of trace formatting data files. By default, the following files are used:$JAVA_HOME/lib/J9TraceFormat.dat and $JAVA_HOME/lib/TraceFormat.dat -format_time=yes|no Specifies whether to format the time stamps into human readable form. The default is yes. -help Displays usage information. -indent Indents trace messages at each Entry trace point and outdents trace messages at each Exit trace point. The default is not to indent the messages. -summary Prints summary information to the screen without generating an output file. -threads=<thread id>[,<thread id>]... Filters the output for the given thread IDs only. thread id is the ID of the thread, which can be specified in decimal or hex (0x) format. Any number of thread IDs can be specified, separated by commas. -timezone=+|-HH:MM Specifies the offset from UTC, as positive or negative hours and minutes, to apply when formatting time stamps. -verbose Output detailed warning and error messages, and performance statistics."},{"location":"tool_traceformat/#examples","title":"Examples","text":"

The following example shows output from running the trace formatter command:

    C:\\test>traceformat sample.trc\n    Writing formatted trace output to file sample.trc.fmt\n    Processing 0.4921875Mb of binary trace data\n    Completed processing of 6983 tracepoints with 0 warnings and 0 errors\n

The formatted trace output looks similar to the following extract, which is truncated to show the key areas of information:

    Trace Summary\n\n    Service level:\n    JRE 1.8.0 Windows 7 amd64-64 build  (pwa6480sr2-20150624_06(SR2))\n\n    JVM startup options:\n    -Xoptionsfile=c:\\build\\pwa6480sr2-20150624\\sdk\\lib\\compressedrefs\\options.default\n    ....\n\n    Processor information:\n    Arch family:         AMD64\n    Processor Sub-type:  Opteron\n    Num Processors:      8\n    Word size:           64\n\n    Trace activation information::\n    FORMAT=c:\\build\\pwa6480sr2-20150624\\sdk\\lib;.\n    MAXIMAL=all{level1}\n    EXCEPTION=j9mm{gclogger}\n    MAXIMAL=all{level2}\n    output=sample\n\n    Trace file header:\n    JVM start time: 08:58:35.527000000\n    Generations:    1\n    Pointer size:   8\n\n    Active threads\n    ....\n    0x000000000f155f00  Attach API wait loop\n    0x000000000f18b200  Thread-1\n    0x000000000f190200  Thread-3\n\n\n     Trace Formatted Data\n\n    Time (UTC)          Thread ID          Tracepoint ID Type   Tracepoint Data\n    08:58:35.527291919 *0x000000000f010500 j9trc.0       Event  Trace engine initialized for VM = 0x3ad4d0\n    08:58:35.527349836  0x000000000f010500 j9prt.0       Event  Trace engine initialized for module j9port\n    08:58:35.527354040  0x000000000f010500 j9thr.0       Event  Trace engine initialized for module j9thr\n    08:58:35.529409621 *0x000000000f01eb00 j9trc.5       Event  Thread started VMthread = 0xf01eb00, name = (unnamed thread), nativeID = 0x24a798\n    ....\n    08:58:35.536134516  0x000000000f010500 j9vm.1        Entry >Create RAM class from ROM class 0x3cab680 in class loader 0x3042338\n    08:58:35.536136384  0x000000000f010500 j9vm.80       Event  ROM class 0x3cab680 is named java/lang/Object\n    08:58:35.536200373  0x000000000f010500 j9vm.2        Exit  <Created RAM class 0xf03ef00 from ROM class 0x3cab680\n
"},{"location":"version0.10/","title":"Version 0.10.0","text":""},{"location":"version0.10/#whats-new-in-version-0100","title":"What's new in version 0.10.0","text":"

The following new features and notable changes since v.0.9.0 are included in this release:

"},{"location":"version0.10/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.10/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.10.0 supports OpenJDK 11, which is available from the AdoptOpenJDK community at the following link:

OpenJDK 11 with Eclipse OpenJ9 is a long term support (LTS) release and supersedes OpenJDK 10 with Eclipse OpenJ9.

Although it is possible to build an OpenJDK v8 with the OpenJ9 0.10.0 release level, testing at the project is not complete and therefore support is not available.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments

"},{"location":"version0.10/#change-to-the-default-shared-classes-cache-size","title":"Change to the default shared classes cache size","text":"

For OpenJDK 8 builds, the default shared classes cache size is increased from 16 MB to 300 MB, with a \"soft\" maximum limit for the initial size of the cache set to 64 MB. Certain exceptions apply. For more information, see -Xshareclasses. The new default also applies to OpenJDK 11 builds.

"},{"location":"version0.10/#new-information-for-the-shared-classes-section-of-a-java-dump-file","title":"New information for the SHARED CLASSES section of a Java dump file","text":"

The value of the soft maximum size (-Xscmx) of the shared classes cache is now recorded in the SHARED CLASSES section of a Java dump file against the string 2SCLTEXTSMB. For example output, see Java dump.

"},{"location":"version0.10/#support-for-openjdk-hotspot-options","title":"Support for OpenJDK HotSpot options","text":"

For compatibility, the following OpenJDK HotSpot options are now supported by OpenJ9:

"},{"location":"version0.10/#new-jdk-11-features","title":"New JDK 11 features","text":"

The following features are supported by OpenJ9:

You can find the full list of features for JDK 11 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

"},{"location":"version0.10/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.9.0 and version 0.10.0 releases, see the Release notes.

"},{"location":"version0.11/","title":"Version 0.11.0","text":""},{"location":"version0.11/#whats-new-in-version-0110","title":"What's new in version 0.11.0","text":"

The following new features and notable changes since version 0.10.0 are included in this release:

"},{"location":"version0.11/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.11/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9 release 0.11.0 provides limited support for the macOS\u00ae platform on OpenJDK 11. Early builds of OpenJDK 11 with OpenJ9 on macOS are available at the AdoptOpenJDK project at the following link:

Support for macOS on OpenJDK 8 is coming soon.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments

"},{"location":"version0.11/#openssl-is-now-supported-for-improved-native-cryptographic-performance","title":"OpenSSL is now supported for improved native cryptographic performance","text":"

OpenSSL is a native open source cryptographic toolkit for Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols, which provides improved cryptographic performance compared to the in-built OpenJDK Java cryptographic implementation. The OpenSSL V1.1.x implementation is enabled by default and supported for the Digest, CBC, and GCM algorithms. Binaries obtained from AdoptOpenJDK include OpenSSL v1.1.x (see Note). For more information about tuning the OpenSSL implementation, see Performance tuning.

Note: Currently, OpenSSL is not bundled as part of the AdoptOpenJDK AIX binary due to an unresolved problem.

"},{"location":"version0.11/#changes-to-the-location-of-the-default-shared-cache-and-cache-snapshot-directory","title":"Changes to the location of the default shared cache and cache snapshot directory","text":"

To increase security, the default shared classes cache directory is changed on non-Windows platforms from /tmp/javasharedresources/ to the user's home directory, unless you specify -Xshareclasses:groupAccess. If you use the groupAccess suboption, the default directory is unchanged because some members of the group might not have access to the user home directory.

Note: For persistent caches, the shared classes cache directory cannot be on an NFS mount. If your user home directory is on an NFS mount, either move it or use the -Xshareclasses:cacheDir=<directory> suboption to specify a different directory for the cache.

In general, caches cannot be shared across different Java releases, so you cannot re-use a cache that was created by a previous level of Java 11; if you use the name and cacheDir suboptions to specify an existing cache, the VM attempts to delete the cache and create a new one. However, on Windows, the cache cannot be deleted if it is in use, in which case the VM continues to use the existing cache.

You can find and remove old caches or snapshots by using the following command-line options:

For persistent caches: - -Xshareclasses:cacheDir=/tmp/javasharedresources/,listAllCaches to find the cache - -Xshareclasses:cacheDir=/tmp/javasharedresources/,name=<cacheName>,destroy to remove the cache

For nonpersistent caches or snapshots: - -Xshareclasses:cacheDir=/tmp,listAllCaches to find the item - -Xshareclasses:cacheDir=/tmp,name=<snapshotName>,destroySnapshot to remove the item

"},{"location":"version0.11/#new-class-data-sharing-suboptions","title":"New class data sharing suboptions","text":"

-Xshareclasses:bootClassesOnly: disables caching of classes that are loaded by non-bootstrap class loaders. This suboption also enables the nonfatal suboption, which allows the VM to start even if there was an error creating the shared classes cache.

-Xshareclasses:fatal: prevents the VM from starting if there was an error creating the shared classes cache. You might want to enable this suboption when using the -Xshareclasses:bootClassesOnly suboption, to troubleshoot problems when creating the cache.

"},{"location":"version0.11/#container-awareness-in-the-openj9-vm-is-now-enabled-by-default","title":"Container awareness in the OpenJ9 VM is now enabled by default","text":"

When using container technology, applications are typically run on their own and do not need to compete for memory. If the VM detects that it is running in a container environment, and a memory limit for the container is set, the VM automatically adjusts the maximum default Java heap size.

In earlier releases, this behavior was enabled by setting the -XX:+UseContainerSupport option. This setting is now the default. For more information about the Java heap size set for a container, see -XX:[+|-]UseContainerSupport.

"},{"location":"version0.11/#pause-less-garbage-collection-mode-is-now-available-on-linux-x86-platforms","title":"Pause-less garbage collection mode is now available on Linux x86 platforms","text":"

Pause-less garbage collection mode is aimed at large heap, response-time sensitive applications. When enabled, the VM attempts to reduce GC pause times. In earlier releases, pause-less garbage collection mode (-Xgc:concurrentScavenge) was available only on IBM z14 hardware. This mode is now available on 64-bit x86 Linux platforms.

Restrictions:

"},{"location":"version0.11/#you-can-now-restrict-identity-hash-codes-to-non-negative-values","title":"You can now restrict identity hash codes to non-negative values","text":"

OpenJ9 allows both positive and negative identity hashcodes, which can be problematic if your program (incorrectly) assumes hashcodes can only be positive. However, you can now use the -XX:[+|-]PositiveIdentityHash option to limit identity hash codes to non-negative values.

"},{"location":"version0.11/#support-for-openjdk-hotspot-options","title":"Support for OpenJDK HotSpot options","text":"

For compatibility, the following OpenJDK HotSpot options are now supported by OpenJ9:

"},{"location":"version0.11/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.10.0 and version 0.11.0 releases, see the Release notes.

"},{"location":"version0.12/","title":"Version 0.12.0","text":""},{"location":"version0.12/#whats-new-in-version-012x","title":"What's new in version 0.12.x","text":""},{"location":"version0.12/#version-0120","title":"Version 0.12.0","text":"

The following new features and notable changes since version 0.11.0 are included in this release:

Warning: Following the release of OpenJ9 0.12.0, an intermittent problem was identified with OpenSSL V1.1.x acceleration of the cryptographic Digest algorithm. For more information about the issue, see #4530. You can turn off the Digest algorithm by setting the -Djdk.nativeDigest system property to false. A new release of OpenJ9 (0.12.1) is available that disables the Digest algorithm by default.

"},{"location":"version0.12/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.12/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9 release 0.12.0 provides support for OpenJDK 8 with OpenJ9 and OpenJDK 11 with OpenJ9. In this release support is extended to the 64-bit macOS\u00ae platform on OpenJDK with OpenJ9.

Builds for all platforms are available from the AdoptOpenJDK project at the following links:

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.12/#improved-flexibility-for-managing-the-size-of-the-jit-code-cache","title":"Improved flexibility for managing the size of the JIT code cache","text":"

The JIT code cache stores the native code of compiled Java\u2122 methods. By default, the size of the code cache is 256 MB for a 64-bit VM and 64 MB for a 31/32-bit VM. In earlier releases the size of the code cache could be increased from the default value by using the -Xcodecachetotal command line option. In this release the size can also be decreased by using this option, with a minimum size of 2 MB. The size of the JIT code cache also affects the size of the JIT data cache, which holds metadata about compiled methods. If you use the -Xcodecachetotal option to manage the size of the code cache, the size of the data cache is adjusted by the same proportion. For more information, see -Xcodecachetotal.

"},{"location":"version0.12/#idle-tuning-is-enabled-by-default-when-openj9-runs-in-a-docker-container","title":"Idle-tuning is enabled by default when OpenJ9 runs in a docker container","text":"

In an earlier release, a set of idle-tuning options were introduced to manage the footprint of the Java heap when the OpenJ9 VM is in an idle state. These options could be set manually on the command line. In this release, the following two options are enabled by default when OpenJ9 is running in a container:

By default, the VM must be idle for 180 seconds before the status is set to idle. To control the wait time before an idle state is set, use the -XX:IdleTuningMinIdleWaitTime option. To turn off idle detection, set the value to 0.

"},{"location":"version0.12/#changes-to-default-shared-classes-cache-directory-permissions-not-windows","title":"Changes to default shared classes cache directory permissions (not Windows)","text":"

If you do not use the cachDirPerm suboption to specify permissions for a shared classes cache directory, and the cache directory is not the /tmp/javasharedresources default, the following changes apply:

For more information, see -Xshareclasses.

"},{"location":"version0.12/#openssl-is-now-supported-for-improved-native-cryptographic-performance","title":"OpenSSL is now supported for improved native cryptographic performance","text":"

OpenSSL is a native open source cryptographic toolkit for Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols, which provides improved cryptographic performance compared to the in-built OpenJDK Java cryptographic implementation. The OpenSSL V1.1.x implementation is enabled by default and supported for the Digest, CBC, and GCM algorithms. Binaries obtained from AdoptOpenJDK include OpenSSL v1.1.x (see Note). For more information about tuning the OpenSSL implementation, see Performance tuning.

Note: OpenJDK 8 with OpenJ9 includes OpenSSL support since version 0.11.0. Currently, OpenSSL is not bundled as part of the AdoptOpenJDK AIX binaries due to an unresolved problem.

"},{"location":"version0.12/#improved-support-for-pause-less-garbage-collection","title":"Improved support for pause-less garbage collection","text":"

Concurrent scavenge mode is now supported on 64-bit Windows operating systems.

In Eclipse OpenJ9 version 0.11.0, support was added for -Xgc:concurrentScavenge on Linux x86-64 virtual machines that use compressed references. In this release, support is now available for Linux x86-64 large-heap virtual machines (non-compressed references).

For more information, see the -Xgc:concurrentScavenge option.

"},{"location":"version0.12/#rsa-algorithm-support-for-openssl","title":"RSA algorithm support for OpenSSL","text":"

OpenSSL v1.1 support for the RSA algorithm is added in this release, providing improved cryptographic performance. OpenSSL support is enabled by default. If you want to turn off support for the RSA algorithm, set the -Djdk.nativeRSA system property to false.

"},{"location":"version0.12/#ibm_java_options-is-deprecated","title":"IBM_JAVA_OPTIONS is deprecated","text":"

The VM environment variable IBM_JAVA_OPTIONS is deprecated and is replaced by OPENJ9_JAVA_OPTIONS. IBM_JAVA_OPTIONS will be removed in a future release. For more information about the use of this variable, see the general options in Environment variables.

"},{"location":"version0.12/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.11.0 and version 0.12.0 releases, see the Release notes.

"},{"location":"version0.12/#version-0121","title":"Version 0.12.1","text":"

The following change is implemented since version 0.12.0:

By default, OpenJ9 provides native cryptographic acceleration using OpenSSL version 1.1.x for the Digest, CBC, GCM, and RSA algorithms. Under certain circumstances acceleration of the Digest algorithm was found to cause a segmentation error. Cryptographic acceleration of the Digest algorithm is now turned off by default. The system property -Djdk.nativeDigest cannot be used to turn on support. This property is ignored by the VM.

"},{"location":"version0.12/#full-release-information_1","title":"Full release information","text":"

Release notes to describe the changes between Eclipse OpenJ9 version 0.12.0 and version 0.12.1 releases, can be found in the OpenJ9 GitHub repository.

"},{"location":"version0.13/","title":"Version 0.13.0","text":""},{"location":"version0.13/#whats-new-in-version-0130","title":"What's new in version 0.13.0","text":"

The following new features and notable changes since version 0.12.1 are included in this release:

"},{"location":"version0.13/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.13/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.13.0 supports OpenJDK 12, which is available from the AdoptOpenJDK community at the following link:

OpenJDK 12 with Eclipse OpenJ9 is not a long term support (LTS) release.

The latest builds of OpenJDK with OpenJ9 for Java 8 and 11 at the AdoptOpenJDK community are for Eclipse OpenJ9 release 0.12.0. Features mentioned in these release notes are not available in these builds. Although it might be possible to build an OpenJDK 8 or OpenJDK 11 with OpenJ9 0.13.0, testing at the project is not complete and therefore support for any of these features is not available.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.13/#support-for-openssl-102","title":"Support for OpenSSL 1.0.2","text":"

OpenSSL cryptographic support is extended to include OpenSSL 1.0.2 for the Digest, CBC, GCM, and RSA algorithms. Support is enabled by default. On Linux and AIX platforms, the OpenSSL libraries are expected to be available on the system path. For more information about cryptographic acceleration with OpenSSL, see Cryptographic operations.

In addition, support for the OpenSSL Digest algorithm is re-enabled in this release following the resolution of issue #4530.

Warning: Earlier versions of OpenJDK with OpenJ9 from the AdoptOpenJDK project bundle OpenSSL as part of the binary package. On Linux and AIX systems, OpenSSL is no longer bundled and the libraries are expected to be available on the system path.

"},{"location":"version0.13/#new-java-process-status-tool","title":"New Java process status tool","text":"

A Java process status tool (jps) is available for querying running Java processes. For more information, see Java process status.

"},{"location":"version0.13/#writing-a-java-dump-to-stdout-or-stderr","title":"Writing a Java dump to STDOUT or STDERR","text":"

You can now write a Java dump file to STDOUT or STDERR by using the -Xdump command-line option. See Writing to STDOUT/STDERR for details.

"},{"location":"version0.13/#better-diagnostic-information-for-linux-systems-that-implement-control-groups","title":"Better diagnostic information for Linux systems that implement control groups","text":"

If you use control groups (cgroups) to manage resources on Linux systems, information about CPU and memory limits is now recorded in a Java dump file. This information is particularly important for applications that run in Docker containers, because when resource limits are set inside a container, the Docker Engine relies on cgroups to enforce the settings. If you are getting a Java OutOfMemoryError error because a container limit has been set on the amount of memory available to an application and this allocation is not sufficient, you can diagnose this problem from the Java dump file. You can find the cgroup information in the ENVINFO section. For sample output, see Java dump (ENVINFO).

"},{"location":"version0.13/#improved-support-for-pause-less-garbage-collection","title":"Improved support for pause-less garbage collection","text":"

Concurrent scavenge mode is now supported on the following platforms:

For more information, see the -Xgc:concurrentScavenge option.

"},{"location":"version0.13/#new-jdk-12-features","title":"New JDK 12 features","text":"

The following feature is supported by OpenJ9:

The following feature is implemented in OpenJDK and available in any builds of OpenJDK 12 with OpenJ9:

You can find the full list of features for JDK 12 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

"},{"location":"version0.13/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.12.1 and version 0.13.0 releases, see the Release notes.

"},{"location":"version0.14/","title":"Version 0.14.0","text":""},{"location":"version0.14/#whats-new-in-version-014x","title":"What's new in version 0.14.x","text":""},{"location":"version0.14/#version-0140","title":"Version 0.14.0","text":"

The following new features and notable changes since version 0.13.0 are included in this release:

"},{"location":"version0.14/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.14/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.14.0 supports OpenJDK 8, 11, and 12. Binaries are available from the AdoptOpenJDK community at the following links:

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.14/#support-for-openssl-102","title":"Support for OpenSSL 1.0.2","text":"

OpenJ9 release 0.13.0 introduced support for OpenSSL 1.0.2 for Java 12. In this release, support is extended to Java 8 and Java 11. OpenSSL is enabled by default for the CBC, Digest, GCM, and RSA cryptographic algorithms. On Linux\u00ae and AIX\u00ae platforms, the OpenSSL libraries are expected to be available on the system path. For more information about cryptographic acceleration with OpenSSL, see Cryptographic operations.

Note: Support for the OpenSSL Digest algorithm on Java 8 and 11 is re-enabled in this release following the resolution of issue #4530.

Warning: Earlier versions of OpenJDK with OpenJ9 from the AdoptOpenJDK project bundle OpenSSL as part of the binary package. On Linux and AIX systems, OpenSSL is no longer bundled and the libraries are expected to be available on the system path.

"},{"location":"version0.14/#new-option-for-ignoring-or-reporting-unrecognized-xx-options","title":"New option for ignoring or reporting unrecognized -XX: options","text":"

By default, unrecognized -XX: command-line options are ignored, which prevents an application failing to start. You can now use -XX:-IgnoreUnrecognizedXXColonOptions to turn off this behavior, so that unrecognized -XX: options are reported instead. For more information, see -XX:[+|-]IgnoreUnrecognizedXXColonOptions.

"},{"location":"version0.14/#improved-support-for-pause-less-garbage-collection","title":"Improved support for pause-less garbage collection","text":"

Support for Concurrent scavenge mode is now extended to Linux on POWER\u00ae BE architectures. For more information, see -Xgc:concurrentScavenge.

"},{"location":"version0.14/#new-jstack-tool-for-obtaining-stack-traces-and-thread-information","title":"New jstack tool for obtaining stack traces and thread information","text":"

For compatibility with the reference implementation, OpenJ9 now includes an independent implementation of the jstack tool. To learn how to use the tool and about any differences compared to the HotSpot tool of the same name, see Java stack tool.

"},{"location":"version0.14/#new-jps-tool","title":"New jps tool","text":"

OpenJ9 release 0.13.0 introduced support for the jps tool for Java 12. In this release, support is added for Java 8 and 11. The jps tool can be used to query running Java processes. For more information, see Java process status.

"},{"location":"version0.14/#new-experimental-option-to-improve-the-performance-of-jvmti-watched-fields","title":"New experimental option to improve the performance of JVMTI watched fields","text":"

The -XX:[+|-]JITInlineWatches option is introduced in this release. When enabled, the option turns on experimental JIT operations that are intended to improve the performance of JVMTI watched fields. This option is currently supported only on x86 platforms (Windows\u00ae, macOS\u00ae, and Linux).

"},{"location":"version0.14/#new-option-to-prevent-a-network-query-being-used-to-determine-host-name-and-ip-address","title":"New option to prevent a network query being used to determine host name and IP address","text":"

By default, a network query is used to determine the host name and IP address for troubleshooting purposes. To avoid your program waiting to time out if a nameserver cannot be contacted, you can now prevent the query from being performed. For more information, see -XX:[+|-]ReadIPInfoForRAS.

"},{"location":"version0.14/#changes-to-the-shared-classes-cache-generation-number","title":"Changes to the shared classes cache generation number","text":"

On all platforms, the format of classes that are stored in the shared classes cache is changed, which causes the JVM to create a new shared classes cache, rather than re-creating or reusing an existing cache. To save space, all existing shared caches can be removed unless they are in use by an earlier release. For more information about destroying a shared classes cache, see -Xshareclasses.

"},{"location":"version0.14/#change-to-the-default-native-stack-size-on-64-bit-zos","title":"Change to the default native stack size on 64-bit z/OS","text":"

The default stack size for operating system threads on 64-bit z/OS is changed from 384 KB to the operating system minimum of 1 MB. For more information about this setting, see -Xmso.

"},{"location":"version0.14/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.13.0 and version 0.14.0 releases, see the Release notes.

"},{"location":"version0.14/#version-0142","title":"Version 0.14.2","text":"

The following new features and notable changes since version 0.14.0 are included in this release:

"},{"location":"version0.14/#features-and-changes_1","title":"Features and changes","text":""},{"location":"version0.14/#binaries-and-supported-environments_1","title":"Binaries and supported environments","text":"

OpenJ9 release 0.14.2 supports OpenJDK 8 and 11. Binaries are available from the AdoptOpenJDK community at the following links:

The Windows (MSI) installer for OpenJDK v8 (64-bit) can now be used to optionally install the IcedTea-Web package, which provides equivalent functionality to Java Web Start. For more information about the installer, see the AdoptOpenJDK Installation page. For more information about migrating to IcedTea-Web, read the AdoptOpenJDK Migration Guide.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.14/#support-for-openssl-101","title":"Support for OpenSSL 1.0.1","text":"

OpenSSL version 1.0.1 support is now enabled; Earlier releases supported only OpenSSL 1.0.2 and 1.1.x. On Linux\u00ae and AIX\u00ae platforms, the OpenSSL libraries are expected to be available on the system path. For more information about cryptographic acceleration with OpenSSL, see Cryptographic operations.

"},{"location":"version0.14/#openssl-digest-algorithm-disabled","title":"OpenSSL Digest algorithm disabled","text":"

Due to issue #5611, the Digest algorithm is disabled.

"},{"location":"version0.15/","title":"Version 0.15.1","text":""},{"location":"version0.15/#whats-new-in-version-0151","title":"What's new in version 0.15.1","text":"

The following new features and notable changes since version 0.14.0 are included in this release:

"},{"location":"version0.15/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.15/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 0.15.0 and 0.15.1 supports OpenJDK 8, 11, and 12.

Binaries are available from the AdoptOpenJDK community at the following links:

Note: The binaries at AdoptOpenJDK are labeled 0.15.1 due to a missing change.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.15/#performance-improvements-for-jvmti-watched-fields","title":"Performance improvements for JVMTI watched fields","text":"

OpenJ9 version 0.14.0 introduced the -XX:[+|-]JITInlineWatches option, which, when enabled, turned on experimental JIT operations to improve the performance of JVMTI watched fields. Following successful results, this option is now enabled by default. This option is now also supported on z/OS\u00ae and Linux for IBM Z\u00ae, in addition to x86 platforms (Windows\u00ae, macOS\u00ae, and Linux).

"},{"location":"version0.15/#support-for-pause-less-garbage-collection-on-ibm-z-systems","title":"Support for pause-less garbage collection on IBM Z systems","text":"

Support for Concurrent scavenge mode is now extended to Linux on IBM Z\u00ae systems and z/OS\u00ae. For more information, see -Xgc:concurrentScavenge.

"},{"location":"version0.15/#chacha20-algorithm-support-for-openssl","title":"ChaCha20 algorithm support for OpenSSL","text":"

The ChaCha20 and ChaCha20-Poly1305 algorithms can now use OpenSSL on Java 11. For more information, see -Djdk.nativeChaCha20.

"},{"location":"version0.15/#openssl-digest-algorithm-disabled","title":"OpenSSL Digest algorithm disabled","text":"

Due to issue #5611, the Digest algorithm is disabled. This algorithm was disabled for Java 8 and 11 in release 0.14.2, which did not support Java 12.

"},{"location":"version0.15/#support-for-openjdk-hotspot-options","title":"Support for OpenJDK HotSpot options","text":"

For compatibility, the -XX:OnOutOfMemoryError OpenJDK HotSpot option is now supported by OpenJ9.

"},{"location":"version0.15/#support-for-transparent-huge-pages-thp","title":"Support for Transparent Huge Pages (THP)","text":"

The VM now supports the allocation of huge pages on Linux when you use the madvise (/sys/kernel/mm/transparent_hugepage/enabled) setting. To enable this feature, set -XX:+TransparentHugePage on the command line when you start your application. This option is currently not enabled by default.

"},{"location":"version0.15/#support-for-low-overhead-heap-profiling","title":"Support for low-overhead heap profiling","text":"

JEP 331 provides a mechanism for sampling Java heap allocations with a low overhead via the JVM Tool Interface (JVMTI).

Restrictions: JEP 331 is implemented for OpenJ9 with the following limitations:

"},{"location":"version0.15/#new-java-memory-map-tool","title":"New Java memory map tool","text":"

The Java memory map (jmap) tool is similar to the HotSpot tool of the same name, and can be used to print statistics about classes on the heap, including the number of objects and their aggregate size. For usage information, see Java memory map (jmap) tool.

"},{"location":"version0.15/#automatically-setting-an-initial-heap-size","title":"Automatically setting an initial heap size","text":"

OpenJ9 can now learn and set an appropriate initial heap size for an application as an alternative to a user manually sizing and setting an -Xms value. The VM records the size of the heap when startup processing ends, writing this data to the shared classes cache. An average value is set over a few restarts, helping to ensure that the value used for the initial heap size is as accurate as possible. The heap size recorded is specific to the application command line, therefore a different hint is stored for every unique command line.

To turn on this behavior, set the -XX:+UseGCStartupHints option on the command line when you start your application.

"},{"location":"version0.15/#removal-of-xdiagnosticscollector-option","title":"Removal of -Xdiagnosticscollector option","text":"

This option was redundant and has now been removed. If you try to use this option on the command line, the VM outputs this error message:

JVMJ9VM007E Command-line option unrecognised: -Xdiagnosticscollector

"},{"location":"version0.15/#change-in-behaviour-of-xxidletuningcompactonidle","title":"Change in behaviour of -XX:IdleTuningCompactOnIdle","text":"

-XX:[+|-]IdleTuningCompactOnIdle is now no longer effective when -XX:+IdleTuningGcOnIdle is not specified.

"},{"location":"version0.15/#heuristics-for-compaction-during-idle-gc","title":"Heuristics for compaction during idle GC","text":"

OpenJ9 now automatically compacts the heap when certain triggers are met during idle garbage collection (GC). As a result of this change, -XX:[+|-]IdleTuningCompactOnIdle is deprecated.

"},{"location":"version0.15/#change-in-shared-classes-behavior-for-checking-timestamps-of-jar-or-zip-files","title":"Change in shared classes behavior for checking timestamps of jar or zip files","text":"

In earlier releases, the shared classes cache checks timestamps of jar or zip files every time a class is loaded and reloads a class if the timestamp has changed. This behavior is now changed; timestamps are checked only when zip or jar files are added to class loaders and used for the first time to look for a class, which can improve class-loading performance. If jar or zip files are updated after a class loader starts loading classes from them, an older version of the class might be loaded from the shared classes cache. To revert to the behavior of earlier releases, set the -Xshareclasses:checkURLTimestamps option on the command line when you start your application.

Note: Multiple -Xshareclasses: options are not combined, only the last one is used.

"},{"location":"version0.15/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.14.0 and version 0.15.1 releases, see the Release notes.

"},{"location":"version0.16/","title":"Version 0.16.0","text":""},{"location":"version0.16/#whats-new-in-version-0160","title":"What's new in version 0.16.0","text":"

The following new features and notable changes since version 0.15.1 are included in this release:

"},{"location":"version0.16/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.16/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.16.0 supports OpenJDK 13, which is available from the AdoptOpenJDK community at the following link:

OpenJDK 13 with Eclipse OpenJ9 is not a long term support (LTS) release.

The latest builds of OpenJDK with OpenJ9 for Java 8 and 11 at the AdoptOpenJDK community are for Eclipse OpenJ9 release 0.15.2. Features mentioned in these release notes are not available in these builds. Although it might be possible to build an OpenJDK 8 or OpenJDK 11 with OpenJ9 0.16.0, testing at the project is not complete and therefore support for any of these features is not available.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.16/#some-class-data-sharing-is-enabled-by-default","title":"Some class data sharing is enabled by default","text":"

Class data sharing is enabled by default for bootstrap classes, unless your application is running in a container. You can use the -Xshareclasses option to change the default behavior, including using -Xshareclasses:none to disable all class data sharing. For more information, see Introduction to class data sharing.

"},{"location":"version0.16/#automatic-setting-of-initial-heap-size-is-enabled-by-default","title":"Automatic setting of initial heap size is enabled by default","text":"

OpenJ9 version 0.15.1 introduced the -XX:[+|-]UseGCStartupHints option, which, when enabled, turned on the automatic learning and setting of an appropriate heap size for an application. This option is now enabled by default.

"},{"location":"version0.16/#option-to-share-vm-anonymous-classes","title":"Option to share VM anonymous classes","text":"

Prior to version 0.16.0, anonymous classes, those created by Unsafe.defineAnonymousClass, were not stored in the shared classes cache. They are now stored there by default, which means they are available for ahead-of-time (AOT) compilation, potentially improving startup performance. A new command, -XX:[+|-]ShareAnonymousClasses, is introduced that enables you to stop anonymous classes being stored in the shared classes cache.

"},{"location":"version0.16/#performance-improvements-for-jvmti-watched-fields-on-power-systems","title":"Performance improvements for JVMTI watched fields on Power Systems","text":"

OpenJ9 version 0.14.0 introduced the -XX:[+|-]JITInlineWatches option, which turns on JIT operations to improve the performance of JVMTI watched fields. This option, which was enabled by default in version 0.15.1, is now also supported on AIX\u00ae and Linux on Power Systems\u2122.

"},{"location":"version0.16/#linux-on-x86-support-for-transparent-huge-pages-thp","title":"Linux\u00ae on x86: Support for Transparent Huge Pages (THP)","text":"

When you use the madvise (/sys/kernel/mm/transparent_hugepage/enabled) setting on Linux on x86 systems, THP is now enabled by default. To disable this feature, set -XX:-TransparentHugePage on the command line when you start your application. The THP setting on other systems remains disabled by default when you use madvise, but can be enabled by setting -XX:+TransparentHugePage.

"},{"location":"version0.16/#new-jcmd-tool","title":"New jcmd tool","text":"

For compatibility with the reference implementation, OpenJ9 now includes an independent implementation of the jcmd tool for running diagnostic commands on a VM. For more information, see Java diagnostic command tool.

"},{"location":"version0.16/#changes-to-the-shared-classes-cache-generation-number","title":"Changes to the shared classes cache generation number","text":"

The format of classes that are stored in the shared classes cache is changed, which causes the JVM to create a new shared classes cache rather than re-creating or reusing an existing cache. To save space, you can remove all existing shared caches unless they are in use by an earlier release. As a result of the format change, a layer column now appears in the output of the -Xshareclasses:listAllCaches option. This change is to support a future enhancement.

For more information about the -Xshareclasses option, including the destroy options that you can use to remove caches, see -Xshareclasses.

"},{"location":"version0.16/#the-xverifynone-and-noverify-options-are-deprecated","title":"The -Xverify:none and -noverify options are deprecated","text":"

The option -Xverify:none (and its equivalent -noverify) is deprecated in Java 13. Both options might be removed in a future release. OpenJ9 issues a warning if these options are used in Java 13 and later versions.

"},{"location":"version0.16/#new-jdk-13-features","title":"New JDK 13 features","text":"

The following features are implemented in OpenJDK and available in any builds of OpenJDK 13 with OpenJ9:

You can find the full list of features for JDK 13 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

"},{"location":"version0.16/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.15.1 and version 0.16.0 releases, see the Release notes.

"},{"location":"version0.17/","title":"Version 0.17.0","text":""},{"location":"version0.17/#whats-new-in-version-0170","title":"What's new in version 0.17.0","text":"

The following new features and notable changes since version 0.16.0 are included in this release:

"},{"location":"version0.17/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.17/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.17.0 supports OpenJDK 8, 11, and 13. Binaries are available from the AdoptOpenJDK community at the following links:

Note: The Windows\u00ae and macOS\u00ae binaries from the AdoptOpenJDK community for OpenJDK 8, 11, and 13 have been updated to OpenSSL v1.1.1d. Look for the following release names to identify these packages:

Note: The last release of OpenJDK 8 and 11 from AdoptOpenJDK is Eclipse OpenJ9 0.15.1. To read about other features and changes in the VM since 0.15.1, check the Version 0.16.0 release notes too.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.17/#new-shared-classes-cache-suboptions-for-layered-caches","title":"New shared classes cache suboptions for layered caches","text":"

(Experimental, 64-bit only)

New suboptions are available for creating layered caches, where a cache builds on another cache with the same name. You can use these suboptions to save space when building a Docker container, for example.

Note: Because these suboptions are experimental, do not use them in a production environment.

The new options are:

"},{"location":"version0.17/#new-shared-classes-cache-suboption-to-skip-disk-space-check","title":"New shared classes cache suboption to skip disk space check","text":"

When creating a persistent shared classes cache, the OpenJ9 VM checks that there is sufficient disk space available on the file system. For file systems that do not support the checking of free space, you can set the -Xshareclasses:noPersistentDiskSpaceCheck option, which causes the VM to skip the space checking operation. If there isn't enough disk space available when the cache is written, a SIGBUS or SIGSEGV signal occurs and the VM ends. For more information, see the -Xshareclasses:noPersistentDiskSpaceCheck option.

"},{"location":"version0.17/#option-to-share-unsafe-classes","title":"Option to share 'Unsafe' classes","text":"

Classes created through Unsafe.defineClass are now stored by default in the shared classes cache. You can use the -XX:-ShareUnsafeClasses option to change the default behavior. For more information, see -XX:[+|-]ShareUnsafeClasses.

"},{"location":"version0.17/#option-to-record-class-relationships-in-the-verifier","title":"Option to record class relationships in the verifier","text":"

A new command line option -XX:+ClassRelationshipVerifier allows you to record class relationships in the verifier, which avoids unnecessary class loading and reduces VM startup time. This is a new approach to bytecode verification that delays validating the relationships between classes until the classes are required to be loaded for a program's execution thus loading only those classes that are needed. For more information, see -XX:[+|-]ClassRelationshipVerifier.

"},{"location":"version0.17/#support-for-the-ibm-z15-processor","title":"Support for the IBM z15 processor","text":"

This release adds JIT compiler support for exploiting z15 instructions.

"},{"location":"version0.17/#digest-algorithm-is-re-enabled","title":"Digest algorithm is re-enabled","text":"

Issue #5611 is fixed, so support for the Digest algorithm is re-enabled. For more information about this support, see Cryptographic operations.

"},{"location":"version0.17/#direct-dump-reader-ddr-vm-restriction-removed","title":"Direct Dump Reader (DDR) VM restriction removed","text":"

Prior to this version, you had to use a 32-bit VM to look at a 32-bit core, and a 64-bit VM to look at a 64-bit core when using DDR. This restriction has now been removed.

"},{"location":"version0.17/#the-format-of-the-hooks-section-of-a-java-dump-has-changed","title":"The format of the HOOKS section of a Java dump has changed","text":"

The format of the HOOKS section of a Java dump, which shows internal VM event callbacks, has changed:

For more information and an example of the new format, see Java dump: HOOKS

"},{"location":"version0.17/#ludcl-caching-disabled-by-default","title":"LUDCL caching disabled by default","text":"

By caching the Latest User Defined Class Loader (LUDCL), Java applications that use deserialization extensively can see a performance improvement. This capability is controlled by the -Dcom.ibm.enableClassCaching system property and is now disabled by default due to issue #7332.

Note: Versions of the documentation before 0.17.0 incorrectly identified this property as disabled by default when it was actually enabled by default in the VM.

"},{"location":"version0.17/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.16 and version 0.17.0 releases, see the Release notes.

"},{"location":"version0.18/","title":"Version 0.18.1","text":""},{"location":"version0.18/#whats-new-in-version-0181","title":"What's new in version 0.18.1","text":"

The following new features and notable changes since version 0.17.0 are included in this release:

"},{"location":"version0.18/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.18/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 releases 0.18.0 and 0.18.1 support OpenJDK 8, 11, and 13. Binaries are available from the AdoptOpenJDK community at the following links:

Note: Binaries at AdoptOpenJDK that are labeled 0.18.1 include additional bug fixes. For more information, see the release notes.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.18/#technical-preview-of-jitserver-technology","title":"Technical preview of JITServer technology","text":"

A technical preview of JITServer technology is included in this release. It's currently available for OpenJDK 8 and OpenJDK 11 running on Linux on x86-64.

JITServer technology decouples the JIT compiler from the VM and lets the JIT compiler run remotely in its own process. This mechanism prevents your Java application suffering possible negative effects due to CPU and memory consumption caused by JIT compilation. This technology can improve quality of service, robustness, and even performance of Java applications. For more information, see JITServer technology.

"},{"location":"version0.18/#jextract-now-available-on-macos-for-openjdk-version-8","title":"jextract now available on macOS for OpenJDK version 8","text":"

The jextract tool is now available on macOS platforms (as well as AIX\u00ae and Linux) for all current versions of OpenJDK: 8, 11, and 13.

"},{"location":"version0.18/#new-shared-classes-cache-suboption-to-turn-off-timestamp-checking","title":"New shared-classes cache suboption to turn off timestamp checking","text":"

You can set the -Xshareclasses:noTimestampChecks option to turn off timestamp checking in shared classes. For more information, see the -Xshareclasses:noTimestampChecks option.

"},{"location":"version0.18/#removal-of-restriction-on-layered-shared-cache","title":"Removal of restriction on layered shared cache","text":"

In the previous release, there is a restriction that the jvmtiSharedCacheInfo.isCorrupt field and the SharedClassCacheInfo.isCacheCorrupt() method cannot detect a corrupted cache that has a layer number other than 0. This restriction is now removed. See the Shared classes API documentation.

"},{"location":"version0.18/#-xmso-1-mb-minimum-value-on-zos-64-bit","title":"-Xmso 1 MB minimum value on z/OS 64-bit","text":"

On z/OS 64-bit, -Xmso has a 1 MB minimum value, to match the minimum stack space provided by the operating system. If you set a value smaller than 1 MB, the value is ignored.

"},{"location":"version0.18/#jstat-new-java-statistics-monitoring-tool","title":"jstat: new Java statistics monitoring tool","text":"

For compatibility with the HotSpot implementation, OpenJ9 now includes an independent implementation of the jstat tool for retrieving statistics on a VM. For more information, see Java statistics monitoring tool.

"},{"location":"version0.18/#-xxtransparenthugepage-is-enabled-by-default-on-more-linux-systems","title":"-XX:+TransparentHugePage is enabled by default on more Linux systems","text":"

-XX:+TransparentHugePage is enabled by default on Linux systems for POWER\u00ae and IBM Z\u00ae as well as x86 systems. This option takes affect only when Transparent Huge Pages (THP) is set to madvise on your system. When Transparent Huge Pages are used, your application footprint might increase.

"},{"location":"version0.18/#new-exit-dump-agent-and-exitonoutofmemoryerror-option","title":"New exit dump agent and ExitOnOutOfMemoryError option","text":"

The new exit dump agent shuts down the VM when the specified event occurs. The exit agent is at priority level 0 and the tool agent has been moved to priority level 1 to aid in mimicking the behavior of HotSpot options. For more information about dump agents, see -Xdump.

OpenJ9 now supports the HotSpot option -XX:[+|-]ExitOnOutOfMemoryError. You can set this option to have the VM shut down when a java.lang.OutOfMemory error is thrown by the VM or in Java code. The exit dump agent is used in the implementation of -XX:[+|-]ExitOnOutOfMemoryError.

"},{"location":"version0.18/#ludcl-caching-enabled-by-default","title":"LUDCL caching enabled by default","text":"

By caching the Latest User Defined Class Loader (LUDCL), Java applications that use deserialization extensively can see a performance improvement. This capability is controlled by the -Dcom.ibm.enableClassCaching system property and is now enabled by default. This feature was disabled for the 0.17.0 release due to issue #7332 which has now been resolved.

"},{"location":"version0.18/#terabytes-suffix-support-for-x-and-xx-options-that-take-a-size","title":"Terabytes suffix support for -X and -XX options that take a size","text":"

OpenJ9 now supports 't' and 'T' suffixes (indicating terabytes) for -X and -XX options that take a <size> parameter.

"},{"location":"version0.18/#improved-support-for-pause-less-garbage-collection","title":"Improved support for pause-less garbage collection","text":"

Support for Concurrent scavenge mode is now extended to macOS. For more information, see -Xgc:concurrentScavenge.

"},{"location":"version0.18/#-xgcnoconcurrentscavenge-option","title":"-Xgc:noConcurrentScavenge option","text":"

The previously undocumented option -Xgc:noConcurrentScavenge disables pause-less garbage collection.

"},{"location":"version0.18/#support-for-openjdk-hotspot-options","title":"Support for OpenJDK HotSpot options","text":"

For compatibility, the following OpenJDK HotSpot options are now supported by OpenJ9:

"},{"location":"version0.18/#shared-classes-cache-suboptions-for-layered-caches-no-longer-experimental","title":"Shared classes cache suboptions for layered caches no longer experimental","text":"

The suboptions for creating layered caches are no longer marked experimental.

The new options are:

"},{"location":"version0.18/#-djavalangstringsubstringnocopy-option","title":"-Djava.lang.string.substring.nocopy option","text":"

The previously undocumented Java 8 option -Djava.lang.string.substring.nocopy=true avoids String sharing by String.substring(), which is the same behavior as the Oracle HotSpot VM.

"},{"location":"version0.18/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.17.0 and version 0.18.0 releases, see the Release notes.

"},{"location":"version0.19/","title":"Version 0.19.0","text":""},{"location":"version0.19/#whats-new-in-version-0190","title":"What's new in version 0.19.0","text":"

The following new features and notable changes since version 0.18.0 are included in this release:

"},{"location":"version0.19/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.19/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.19.0 supports OpenJDK 14, which is available from the AdoptOpenJDK community at the following link:

OpenJDK 14 with Eclipse OpenJ9 is not a long term support (LTS) release.

The latest builds of OpenJDK with OpenJ9 for Java 8 and 11 at the AdoptOpenJDK community are for Eclipse OpenJ9 release 0.18.0. Features mentioned in these release notes are not available in these builds. Although it might be possible to build an OpenJDK 8 or OpenJDK 11 with OpenJ9 0.19.0, testing at the project is not complete and therefore support for any of these features is not available.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.19/#option-to-print-code-cache-usage-to-stderr-at-vm-shutdown","title":"Option to print code cache usage to stderr at VM shutdown","text":"

A new command line option -XX:+PrintCodeCache allows you to print the code cache memory usage to stderr when the VM shuts down.

"},{"location":"version0.19/#stringbuffer-and-stringbuilder-above-1-g-grow-to-the-maximum-size","title":"StringBuffer and StringBuilder above 1 G grow to the maximum size","text":"

A 1 G char[] or larger StringBuffer and StringBuilder now immediately grows to the maximum possible size for all current versions of Java, including Java 8. For Java 8 only, you can revert to the previous behavior of growing only as much as necessary to accommodate the String being added, by using the option, -Djava.lang.stringBuffer.growAggressively=false.

"},{"location":"version0.19/#jpackage-packaging-tool-platform-support","title":"jpackage packaging tool platform support","text":"

The jpackage utility is described in JEP 343 as a tool that \"packages a Java application into a platform-specific package that includes all of the necessary dependencies.\" Full details of the tool are available at JEP 343: Packaging Tool. Be aware that jpackage is supported on only the following OpenJ9 platforms: Linux\u00ae, macOS\u00ae, and Windows\u2122. It is not supported on AIX\u00ae or z/OS\u00ae platforms.

"},{"location":"version0.19/#extended-messages-for-nullpointerexception-not-yet-implemented","title":"Extended messages for NullPointerException not yet implemented","text":"

JEP 358: Helpful NullPointerExceptions provides extended messages when a NullPointerException is generated by the Java 14 VM and you have enabled the feature. However, be aware that this is not implemented in OpenJ9 at this time.

"},{"location":"version0.19/#compiler-changes-for-linux","title":"Compiler changes for Linux","text":"

Linux x86 64-bit, Linux on POWER\u00ae LE 64-bit, and Linux on IBM Z\u00ae 64-bit have all moved to the gcc 7.5 compiler. See Supported environments.

"},{"location":"version0.19/#new-jdk-14-features","title":"New JDK 14 features","text":"

The following features are supported by OpenJ9:

The following features are implemented in OpenJDK and available in any builds of OpenJDK 14 with OpenJ9:

You can find the full list of features for JDK 14 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

"},{"location":"version0.19/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.18.0 and version 0.19.0 releases, see the Release notes.

"},{"location":"version0.20/","title":"Version 0.20.0","text":""},{"location":"version0.20/#whats-new-in-version-0200","title":"What's new in version 0.20.0","text":"

The following new features and notable changes since version 0.19.0 are included in this release:

"},{"location":"version0.20/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.20/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.20.0 supports OpenJDK 8, 11, and 14. Binaries are available from the AdoptOpenJDK community at the following links:

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.20/#limited-support-for-64-bit-linux-on-arm","title":"Limited support for 64-bit Linux on ARM","text":"

Limited support is available in this release for the 64-bit ARM (AArch64) architecture. An early access build on OpenJDK 11 is available from the AdoptOpenJDK community. See the OpenJ9 release notes for any known issues that are still being worked on before this platform is fully supported.

"},{"location":"version0.20/#-xx-exitonoutofmemoryerror-option-behavior-update","title":"-XX:[+|-]ExitOnOutOfMemoryError option behavior update","text":"

The -XX:[+|-]ExitOnOutOfMemoryError option is updated to exit only on VM OutOfMemoryErrors instead of both VM and Java\u2122 thrown errors to match the HotSpot option. See -XX:[+|-]ExitOnOutOfMemoryError for more details about this option.

"},{"location":"version0.20/#new-xx-globallockreservation-option-added","title":"New -XX:[+|-]GlobalLockReservation option added","text":"

(AIX\u00ae and Linux on Power Systems\u2122 only)

Option -XX:[+|-]GlobalLockReservation enables a new optimization targeted towards more efficient handling of locking and unlocking Java objects. See -XX:[+|-]GlobalLockReservation for more details about this option.

"},{"location":"version0.20/#change-to-default-maximum-heap-size-for-java-8","title":"Change to default maximum heap size for Java 8","text":"

For consistency with Java 11, the default maximum heap size (-Xmx) is changed to be 25% of the available memory with a maximum of 25 GB. Where there is 2 GB or less of physical memory, the value set is 50% of available memory with a minimum value of 16 MB and a maximum value of 512 MB. If you want to revert to the default setting in earlier releases of OpenJ9, use the -XX:+OriginalJDK8HeapSizeCompatibilityMode option.

"},{"location":"version0.20/#change-to-jcmd-default-options","title":"Change to jcmd default options","text":"

The Java diagnostic command (jcmd) tool no longer requires a filename when used with the Dump.java, Dump.snap, or Dump.system options. See jcmd for more information about the tool.

"},{"location":"version0.20/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.19.0 and version 0.20.0 releases, see the Release notes.

"},{"location":"version0.21/","title":"Version 0.21.0","text":""},{"location":"version0.21/#whats-new-in-version-0210","title":"What's new in version 0.21.0","text":"

The following new features and notable changes since version 0.20.0 are included in this release:

"},{"location":"version0.21/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.21/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.21.0 supports OpenJDK 8, 11, and 14. Binaries are available from the AdoptOpenJDK community at the following links:

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.21/#application-programming-interface-api-documentation","title":"Application Programming Interface (API) documentation","text":"

API documentation that applies to OpenJ9 can now be found in this user documentation for both JDK 8 and JDK 11. The documentation includes links to Oracle API documentation for information that is not specific to OpenJ9. See API overview.

"},{"location":"version0.21/#performance-improvements","title":"Performance improvements","text":""},{"location":"version0.21/#new-xx-handlesigabrt-option-added","title":"New -XX:[+|-]HandleSIGABRT option added","text":"

This option affects the handling of the operating system signal SIGABRT. For compatibility with the reference implementation, set -XX:-HandleSIGABRT. For more information, see -XX:[+|-]HandleSIGABRT.

"},{"location":"version0.21/#new-xx-printflagsfinal-option-added","title":"New -XX:[+|-]PrintFlagsFinal option added","text":"

This release provides an initial implementation of the -XX:[+|-]PrintFlagsFinal option. It is currently incomplete and outputs only a subset of parameters. Over time, we expect more options to be added to the output. See -XX:[+|-]PrintFlagsFinal for more details about this option.

"},{"location":"version0.21/#update-to-noclassdeffounderror-exception-message","title":"Update to NoClassDefFoundError exception message","text":"

The order in which class names are printed in a NoClassDefFoundError exception message now matches the output reported by HotSpot.

For example, in the following exception message:

java.lang.NoClassDefFoundError: mypackage/Main (wrong name: Main)\n

mypackage/Main is the class name encountered by the VM in the .class file, but \"wrong name\" Main was the provided class name. Prior to this update to the exception message, the encountered class name and the provided class name were swapped in the NoClassDefFoundError exception message.

"},{"location":"version0.21/#macos-shared-libraries-version-updated","title":"macOS shared libraries version updated","text":"

The version information for shared libraries on macOS has been updated from 0.0.0 to 1.0.0. If an application has linked against a shared library from a previous OpenJ9 release, it needs to be re-linked against the new release. Failure to re-link causes an error Incompatible library version, requires version 0.0.0.

"},{"location":"version0.21/#support-for-openjdk-hotspot-options","title":"Support for OpenJDK HotSpot options","text":"

For compatibility, the following OpenJDK HotSpot option is now supported by OpenJ9:

"},{"location":"version0.21/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.20.0 and version 0.21.0 releases, see the Release notes.

"},{"location":"version0.22/","title":"Version 0.22.0","text":""},{"location":"version0.22/#whats-new-in-version-0220","title":"What's new in version 0.22.0","text":"

The following new features and notable changes since version 0.21.0 are included in this release:

"},{"location":"version0.22/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.22/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.22.0 supports OpenJDK 15. Binaries are available from the AdoptOpenJDK community at the following link:

OpenJDK 15 with Eclipse OpenJ9 is not a long term support (LTS) release.

The latest builds of OpenJDK with OpenJ9 for Java 8 and 11 at the AdoptOpenJDK community are for Eclipse OpenJ9 release 0.21.0. Features mentioned in these release notes are not available in these Java 8 and 11 builds. Although it might be possible to build an OpenJDK 8 or OpenJDK 11 with OpenJ9 0.22.0, testing at the project is not complete and therefore support for any of these features is not available.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.22/#performance-improvements","title":"Performance improvements","text":"

The performance of zero initializing Java heap memory improved on the IBM Z\u00ae platform because of a change to use memset instead of an outdated handcrafted assembly sequence in the JVM.

"},{"location":"version0.22/#new-xx-portablesharedcache-option-added","title":"New -XX:[+|-]PortableSharedCache option added","text":"

On x86 only, the -XX:[+|-]PortableSharedCache option enables you to choose whether AOT code should be generated using an older processor (Intel\u00ae Sandybridge) feature set, which therefore allows the AOT code to be portable. This feature is particularly relevant for packaging a shared classes cache into a container image (for example, applications deployed on the cloud in the form of Docker containers) because the processor on which the container image is built is likely to be different from the processor on which the container is deployed. For more information, see -XX:[+|-]PortableSharedCache.

"},{"location":"version0.22/#methods-in-comibmlangmanagementmemorymxbean-deprecated-and-replaced","title":"Methods in com.ibm.lang.management.MemoryMXBean deprecated and replaced","text":"

The methods com.ibm.lang.management.MemoryMXBean.getGCMasterThreadCpuUsed() and com.ibm.lang.management.MemoryMXBean.getGCSlaveThreadsCpuUsed() are deprecated for removal in Java 16. The recommended methods to be used are com.ibm.lang.management.MemoryMXBean.getGCMainThreadCpuUsed() and com.ibm.lang.management.MemoryMXBean.getGCWorkerThreadsCpuUsed() respectively.

For more information see Java 8: com.ibm.lang.management.MemoryMXBean and for Java 11: com.ibm.lang.management.MemoryMXBean

"},{"location":"version0.22/#javalangsystemmaplibraryname-string-suffix","title":"java.lang.System.mapLibraryName() string suffix","text":"

On AIX\u00ae systems, java.lang.System.mapLibraryName(libname) returns a representation of a native library in a platform-specific string with a .so suffix.

"},{"location":"version0.22/#new-jdk-15-features","title":"New JDK 15 features","text":"

The following features are supported by OpenJ9:

The following features are implemented in OpenJDK and available in any builds of OpenJDK 14 with OpenJ9:

You can find the full list of features for JDK 15 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

"},{"location":"version0.22/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.21.0 and version 0.22.0 releases, see the Release notes.

"},{"location":"version0.23/","title":"Version 0.23.0","text":""},{"location":"version0.23/#whats-new-in-version-0230","title":"What's new in version 0.23.0","text":"

The following new features and notable changes since version 0.22.0 are included in this release:

"},{"location":"version0.23/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.23/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.23.0 supports OpenJDK 8, 11, and 15. Binaries are available from the AdoptOpenJDK community at the following links:

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.23/#-xx-portablesharedcache-option-behavior-update","title":"-XX:[+|-]PortableSharedCache option behavior update","text":"

The -XX:[+|-]PortableSharedCache option is updated to improve the portability of AOT-compiled code further. This update allows AOT-compiled code to be portable across OpenJ9 VMs that use compressed references and have a heap size of 1 MB to 28 GB when this option is enabled. This option might introduce a small (1-2%) steady-state throughput penalty when compressed references are used and the heap size is between 1 MB and 3 GB. See -XX:[+|-]PortableSharedCache for more details about this option.

"},{"location":"version0.23/#-xx-idletuningcompactonidle-option-now-inactive","title":"-XX:[+|-]IdleTuningCompactOnIdle option now inactive","text":"

Setting the -XX:[+|-]IdleTuningCompactOnIdle option now has no effect. A compaction is triggered by internal heuristics that look into the number of fragmented pages. Typically there is no need to force a compaction. This option was deprecated in release 0.15.0, and will be removed in the future. See -XX:[+|-]IdleTuningCompactOnIdle for details about this option.

"},{"location":"version0.23/#support-for-openjdk-hotspot-options","title":"Support for OpenJDK HotSpot options","text":"

For compatibility, the following OpenJDK HotSpot options are now supported by OpenJ9:

"},{"location":"version0.23/#extended-platform-support-for-the-jitserver-technology-preview","title":"Extended platform support for the JITServer technology preview","text":"

Platform support for the JITServer technology preview is now extended to 64-bit Linux\u00ae on IBM Power\u00ae systems, and 64-bit Linux on IBM Z\u00ae systems. JITServer decouples the JIT compiler from the OpenJ9 VM, freeing up CPU and memory for an application. JITServer runs in its own process, either locally or on a remote machine, where resources can be separately managed. This preview was initially introduced in Eclipse OpenJ9 V0.18.1 for Linux on 64-bit x86 systems. For more information, see JITServer technology (technical preview).

"},{"location":"version0.23/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.22.0 and version 0.23.0 releases, see the Release notes.

"},{"location":"version0.24/","title":"Version 0.24.0","text":""},{"location":"version0.24/#whats-new-in-version-0240","title":"What's new in version 0.24.0","text":"

The following new features and notable changes since version 0.23.0 are included in this release:

"},{"location":"version0.24/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.24/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.24.0 supports OpenJDK 8, 11, and 15.

Windows\u00ae builds for Java\u2122 8 are now compiled with Microsoft\u00ae Visual Studio 2013. The Visual Studio redistributable files included with the build are updated to match.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.24/#changes-to-message-logging","title":"Changes to message logging","text":"

JEP 158 introduces the -Xlog option as a common logging system for all components of a Java virtual machine. To avoid confusion with the reference implementation, the -Xsyslog option replaces the existing OpenJ9 -Xlog option for message logging. For compatibility with the reference implementation, a limited set of -Xlog suboptions are supported.

A new option, -XX:[+|-]LegacyXlogOption, controls how -Xlog is processed when set on the command line.

"},{"location":"version0.24/#support-for-the-java_options-environment-variable","title":"Support for the JAVA_OPTIONS environment variable","text":"

For compatibility with the reference implementation, OpenJ9 now supports the JAVA_OPTIONS environment variable. This environment variable can be used to set command line options, as described in OpenJ9 command-line options and Environment variables. Options specified by JAVA_OPTIONS can be overridden by options specified by OPENJ9_JAVA_OPTIONS.

"},{"location":"version0.24/#-xx-portablesharedcache-option-support-update","title":"-XX:[+|-]PortableSharedCache option support update","text":"

The -XX:[+|-]PortableSharedCache option is now supported on IBM Z\u00ae and POWER\u00ae platforms. AOT-compiled code that is generated with this option is guaranteed to be portable across IBM z10 or newer microarchitectures on IBM Z platforms and IBM POWER8\u00ae or newer microarchitectures on POWER platforms. See -XX:[+|-]PortableSharedCache for more details about this option.

"},{"location":"version0.24/#-xx-shareanonymousclasses-option-behavior-update","title":"-XX:[+|-]ShareAnonymousClasses option behavior update","text":"

In earlier releases of OpenJ9, the -XX:[+|-]ShareAnonymousClasses option enables or disables the storage of VM anonymous classes in the shared classes cache. From OpenJ9 0.24.0 for OpenJDK 15 binaries, this option also controls the storage of hidden classes. See -XX:[+|-]ShareAnonymousClasses for more details about this option.

"},{"location":"version0.24/#additional-parameters-for-jcmd-dump-commands","title":"Additional parameters for jcmd Dump commands","text":"

You can now include additional parameters for jcmd Dump commands as indicated in the following list:

These parameters, including the <file path> parameter, can be in any order. The default for both system and heap dumps is now: request=exclusive+prepwalk. For further details, refer to the following -Xdump suboptions: request=<requests> and opts=<options>. For more information about jcmd, see Java diagnostic command (jcmd) tool.

"},{"location":"version0.24/#change-in-behavior-for-the-jextract-utility","title":"Change in behavior for the jextract utility","text":"

The jextract utility gathers relevant files following a system dump to assist with problem determination. It is important that the jextract utility is run from the same SDK that generated the dump. From this release, if the build ID of the jextract utility does not match the build ID of the SDK that is recorded in the system dump, an exception message is generated. To force jextract to continue, a new option, -r, is introduced. For more information, see Dump extractor.

"},{"location":"version0.24/#new-diagnostic-suboption-for-xcheckjni-for-fatal-jni-errors","title":"New diagnostic suboption for -Xcheck:jni for fatal JNI errors","text":"

A new abortonerror suboption for -Xcheck:jni provides diagnostic data when fatal JNI errors occur. For more information, run -Xcheck:jni:help.

"},{"location":"version0.24/#improved-diagnostic-information-in-a-java-dump-file-on-processor-features","title":"Improved diagnostic information in a Java dump file on processor features","text":"

The ENVINFO section of a Java dump file now includes further information about processor features. This information helps to diagnose problems associated with JIT and AOT compilations that depend on underlying hardware. For an example that shows the information provided when JIT is enabled, see the CPU Information (2CIJITFEATURE,2CIAOTFEATURE) section in the Java dump topic.

"},{"location":"version0.24/#helm-chart-available-for-deploying-jitserver","title":"Helm chart available for deploying JITServer","text":"

A Helm Chart is now available for easier deployment of JITServer technology in a Kubernetes or OpenShift cluster. You can find the chart (openj9-jitserver-chart) in the JITServer Helm repository, which contains a complete set of usage instructions. For an introduction to JITServer technology, see JITServer (tech. preview).

"},{"location":"version0.24/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.23.0 and version 0.24.0 releases, see the Release notes.

"},{"location":"version0.25/","title":"Version 0.25.0","text":""},{"location":"version0.25/#whats-new-in-version-0250","title":"What's new in version 0.25.0","text":"

The following new features and notable changes since version 0.24.0 are included in this release:

"},{"location":"version0.25/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.25/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.25.0 supports OpenJDK 16. OpenJDK 16 with Eclipse OpenJ9 is not a long term support (LTS) release.

Although it might be possible to build an OpenJDK 8 or OpenJDK 11 with OpenJ9 release 0.25.0, testing at the project is not complete and therefore support for new features that apply to these Java versions is not available.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.25/#new-jdk-16-features","title":"New JDK 16 features","text":"

The following features are supported by OpenJ9:

The following features will be supported by OpenJ9 in a future release:

The following features are implemented in OpenJDK and available in any builds of OpenJDK 16 with OpenJ9:

You can find the full list of features for JDK 16 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

Note: Applications might be adversely affected by JEP 396 if they make use of internal APIs. You should update your application to use standard APIs. To temporarily work around this problem, set --illegal-access=permit on the command line, which prints a warning that is similar to the following example when an illegal access call is made:

WARNING: An illegal reflective access operation has occurred\nWARNING: Illegal reflective access by org.openj9.test.com.ibm.jit.Test_JITHelpers (file:/home/jenkins/workspace/Test_openjdk11_j9.functional_ppc64_aix_Nightly_testList_1/jvmtest/functional/Java8andUp/GeneralTest.jar) to field java.lang.String.value\nWARNING: Please consider reporting this to the maintainers of org.openj9.test.com.ibm.jit.Test_JITHelpers\nWARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations\nWARNING: All illegal access operations will be denied in a future release\n
"},{"location":"version0.25/#support-for-the-verbosemodule-option","title":"Support for the -verbose:module option","text":"

The -verbose:module option is now supported for Java 11 and later releases. This option writes information to stderr for each module that is loaded and unloaded.

"},{"location":"version0.25/#enabling-zlibnx-hardware-accelerated-data-compression-and-decompression-on-aix","title":"Enabling zlibNX hardware-accelerated data compression and decompression on AIX","text":"

By default, AIX\u00ae uses the system zlib library for data compression and decompression.

On systems that contain the Nest accelerator (NX) co-processor, OpenJ9 now uses the zlibNX library instead, if it is installed. To learn more about hardware acceleration and the zlibNX library, see Hardware acceleration.

"},{"location":"version0.25/#zos-support-for-the-sysname-dump-token","title":"z/OS support for the %sysname dump token","text":"

The %sysname dump token is added on z/OS, which equates to the SYSNAME sysparm. See Dump agent tokens.

"},{"location":"version0.25/#single-build-for-compressed-references-and-non-compressed-references","title":"Single build for compressed references and non-compressed references","text":"

A single build now supports both compressed references and non-compressed references. The object reference mode is selected at run time based on the specified heap size (-Xmx) or by using command-line options that control the selection of compressed references.

If you used a large heap build for an earlier release of OpenJ9 because you did not require compressed references, you might need to turn it off if compressed references mode is being selected automatically at run time. Use the -Xnocompressedrefs option when you start your application.

The compressedrefs directory is no longer present in the single build.

To learn about the benefits of using compressed references, see Compressed references.

"},{"location":"version0.25/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.24.0 and version 0.25.0 releases, see the Release notes.

"},{"location":"version0.26/","title":"Version 0.26.0","text":""},{"location":"version0.26/#whats-new-in-version-0260","title":"What's new in version 0.26.0","text":"

The following new features and notable changes since version 0.25.0 are included in this release:

"},{"location":"version0.26/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.26/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.26.0 supports OpenJDK 8, 11, and 16.

For OpenJDK 8 and 11 builds that contain OpenJ9, see Version 0.25.0 for additional changes that have now been fully tested for these versions.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.26/#dump-extractor-tool-deprecated","title":"Dump extractor tool deprecated","text":"

The dump extractor tool, jextract, is deprecated in this release and replaced with the jpackcore tool. This tool uses the same syntax and parameters as jextract to collect diagnostic files for analysis. The change is necessary because the reference implementation will be introducing a tool in a future release that is also called jextract.

For more information, see Dump extractor.

"},{"location":"version0.26/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 v0.25.0 and v0.26.0 releases, see the Release notes.

"},{"location":"version0.27/","title":"Version 0.27.1","text":""},{"location":"version0.27/#whats-new-in-version-0271","title":"What's new in version 0.27.1","text":"

The following new features and notable changes since version 0.26.0 are included in this release:

"},{"location":"version0.27/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.27/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.27.1 supports OpenJDK 8, 11, and 16.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.27/#new-xx-adaptivegcthreading-option-added","title":"New -XX:[+|-]AdaptiveGCThreading option added","text":"

Adaptive threading is enabled by default, which automatically tunes the number of active parallel garbage collection (GC) threads. When this feature is enabled, the GC thread count is dynamically adjusted from collection cycle to cycle to account for changes in the the amount of time that parallel threads spend doing useful GC work (such as object graph traversal) compared to time spent synchronizing among themselves. When GC work decreases, fewer threads are used, which reduces the overhead, effectively reducing GC pause times. Resources are freed up for other processing activities.

Use the -xgcmaxthreads option with the -XX:+AdaptiveGCThreading option to specify a thread count limit.

"},{"location":"version0.27/#improved-time-zone-information-added-to-java-dump-files","title":"Improved time zone information added to Java dump files","text":"

To help with troubleshooting, additional time zone information is added to Java\u2122 dump files. Two new fields are included, the date and time in UTC (1TIDATETIMEUTC) and the time zone according to the local system (1TITIMEZONE). For more information, see the Java dump TITLE section.

"},{"location":"version0.27/#change-in-default-behavior-for-the-balanced-garbage-collection-gc-policy","title":"Change in default behavior for the balanced garbage collection (GC) policy","text":"

In this release, a new scan mode, -Xgc:dynamicBreadthFirstScanOrdering, is used during balanced GC copy forward operations that is expected to improve performance.

For more information about this type of operation, see GC copy forward operation.

You can revert to the behavior in earlier releases by setting -Xgc:breadthFirstScanOrdering when you start your application.

"},{"location":"version0.27/#stop-parsing-the-java_options-environment-variable","title":"Stop parsing the JAVA_OPTIONS environment variable","text":"

The 0.24 release started parsing the JAVA_OPTIONS environment variable. This variable was added in error and has been removed. The _JAVA_OPTIONS environment variable (with different behavior) is added for compatibility.

"},{"location":"version0.27/#global-lock-reservation-enabled-by-default","title":"Global lock reservation enabled by default","text":"

(AIX\u00ae and Linux on Power Systems\u2122 only)

Global lock reservation is now enabled by default. This is an optimization targeted towards more efficient handling of locking and unlocking Java objects. The older locking behavior can be restored via the -XX:-GlobalLockReservation option. See -XX:[+|-]GlobalLockReservation for more details.

"},{"location":"version0.27/#increase-in-default-operating-system-stack-size-on-ppc64-platforms","title":"Increase in default operating system stack size on PPC64 platforms","text":"

The default operating system stack size on AIX and Linux PPC64 is increased from 256KB to 512KB. You can change the operating system stack size by using the -Xmso option.

"},{"location":"version0.27/#new-x-option-recognized-by-jpackcore-jextract","title":"New -x option recognized by jpackcore / jextract","text":"

The new option, -x, causes the system dump to be omitted from the archive created. In its place, the file excluded-files.txt is added, which names the excluded file. For more information, see Dump extractor.

"},{"location":"version0.27/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 v0.26.0 and v0.27.1 releases, see the Release notes.

"},{"location":"version0.29.1/","title":"Version 0.29.1","text":""},{"location":"version0.29.1/#whats-new-in-version-0291","title":"What's new in version 0.29.1","text":"

The following new features and notable changes since version 0.29.0 are included in this release:

"},{"location":"version0.29.1/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.29.1/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.29.1 supports OpenJDK 17.

AArch64 Linux is now a fully supported, production-ready target for OpenJDK 17.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.29.1/#new-jdk-17-features","title":"New JDK 17 features","text":"

The following features are supported by OpenJ9:

The following features will be supported by OpenJ9 in a future release:

The following features are implemented in OpenJDK and available in any build of OpenJDK 17 with OpenJ9:

You can find the full list of features for JDK 17 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

Note: Applications might be adversely affected by JEP 403 if they make use of internal APIs. You should update your application to use standard APIs. To temporarily work around this problem, use --add-opens, --add-exports on the command line for each package required.

"},{"location":"version0.29.1/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 v0.29.0 and v0.29.1 releases, see the Release notes.

"},{"location":"version0.29/","title":"Version 0.29.0","text":""},{"location":"version0.29/#whats-new-in-version-0290","title":"What's new in version 0.29.0","text":"

The following new features and notable changes since version 0.27.0 are included in this release:

"},{"location":"version0.29/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.29/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.29.0 supports OpenJDK 8 and 11.

AArch64 Linux is now a fully supported, production-ready target for OpenJDK 8 and 11.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.29/#jitserver-technology-is-fully-supported-on-some-systems","title":"JITServer technology is fully supported on some systems","text":"

JITServer technology is now a fully supported feature on Linux\u00ae on x86 and Linux on IBM Power\u00ae systems (64-bit only). This feature remains a technical preview for Linux on IBM Z\u00ae systems (64-bit only). For more information, see JITServer technology.

"},{"location":"version0.29/#new-xx-utfcache-option-added","title":"New -XX:[+|-]UTFCache option added","text":"

A UTF to String cache is added to enhance reflection performance. The cache is enabled by default but can be disabled using the -XX:[+|-]UTFCache option.

"},{"location":"version0.29/#-xsoftmx-updates-for-gencon","title":"-Xsoftmx updates for gencon","text":"

When using gencon, the -Xsoftmx limit is proportional to the maximum amount of nursery space specified relative to the -Xmx value.

"},{"location":"version0.29/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 v0.27.0 and v0.29.0 releases, see the Release notes.

"},{"location":"version0.30.1/","title":"Version 0.30.1","text":""},{"location":"version0.30.1/#whats-new-in-version-0301","title":"What's new in version 0.30.1","text":"

The following new features and notable changes since version 0.30.0 are included in this release:

"},{"location":"version0.30.1/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.30.1/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.30.1 supports OpenJDK 8, 11 and 17.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.30.1/#creation-of-system-dumps-on-macos-12","title":"Creation of system dumps on macOS 12","text":"

Creation of system (core) dumps on macOS 12 or later is now possible.

"},{"location":"version0.30.1/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.30.0 and v0.30.1 releases, see the Release notes.

"},{"location":"version0.30/","title":"Version 0.30.0","text":""},{"location":"version0.30/#whats-new-in-version-0300","title":"What's new in version 0.30.0","text":"

The following new features and notable changes since version 0.29.0 are included in this release:

"},{"location":"version0.30/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.30/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.30.0 supports OpenJDK 8, 11 and 17.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.30/#changes-to-the-shared-classes-cache-generation-number","title":"Changes to the shared classes cache generation number","text":"

The format of classes that are stored in the shared classes cache is changed, which causes the JVM to create a new shared classes cache rather than re-creating or reusing an existing cache. To save space, you can remove all existing shared caches unless they are in use by an earlier release. For more information about the -Xshareclasses option, including the destroy options that you can use to remove caches, see -Xshareclasses.

"},{"location":"version0.30/#ignored-options-captured-in-java-dumps","title":"Ignored options captured in java dumps","text":"

For improved compatibility with other Java implementations, OpenJ9 ignores many command-line options. If any were ignored, they are now listed in the java dump files. For example, the command

\njava -Xdump:java:events=vmstop -XX:+UseCompressedOop -XX:CompressedClassSpaceSize=528482304 -version\n

would yield the following in the ENVINFO section after the complete list of all command-line arguments

\n1CIIGNOREDARGS Ignored Args:\n2CIIGNOREDARG            -XX:+UseCompressedOop\n2CIIGNOREDARG            -XX:CompressedClassSpaceSize=528482304\n
"},{"location":"version0.30/#new-xx-ensurehashed-option-added","title":"New -XX:[+|-]EnsureHashed option added","text":"

This option specifies the classes whose objects should be assigned hash values or those classes that should be ignored. This option might improve performance for applications that frequently hash objects of a certain type. See -XX:[+|-]EnsureHashed for more details.

"},{"location":"version0.30/#redesigned-heap-resizing-for-the-balanced-gc-policy","title":"Redesigned heap resizing for the balanced GC policy","text":"

Heap resizing heuristics have been redesigned for the balanced GC policy. This includes both total heap resizing including eden and non-eden components independently, and also balancing between these two components when the heap is fully expanded. The heuristics now combine both the CPU overhead (for Partial GCs as well as Global Mark Phase) and the heap occupancy criteria. The balancing between eden and non-eden for fully expanded heaps is far more dynamic (instead of being mostly fixed in the ratio 1:4).

As a consequence, there should typically be less need for heap sizing tuning options, most notably for eden sizing options -Xmn, -Xmns, and -Xmnx.

Also, a new soft limit pause target is added for Partial GCs, which defaults to 200ms. This criterion is combined with the PGC CPU overhead criterion for a balanced compromise between minimizing footprint, maximizing throughput, and meeting the paused time target.

More details about the new heuristics can be found at:

https://blog.openj9.org/2021/09/24/balanced-gc-performance-improvements-eden-heap-sizing-improvements/

The heuristics now obey the following existing options that were previously used for the optthruput, optavgpause, and gencon GC policies:

The heuristics also use the -Xgc:targetPausetime option that was previously used only for the metronome GC policy.

For more information about GC policies, see Garbage collection policies.

"},{"location":"version0.30/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.29.0 and v0.30.0 releases, see the Release notes.

"},{"location":"version0.32/","title":"Version 0.32.0","text":""},{"location":"version0.32/#whats-new-in-version-0320","title":"What's new in version 0.32.0","text":"

The following new features and notable changes since version 0.30.0 are included in this release:

"},{"location":"version0.32/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.32/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.32.0 supports OpenJDK 8, 11, 17, and 18.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.32/#creation-of-system-dumps-on-macos-12","title":"Creation of system dumps on macOS\u00ae 12","text":"

You can now create system (core) dumps on macOS 12 or later.

"},{"location":"version0.32/#support-for-openjdk-hotspot-options","title":"Support for OpenJDK HotSpot options","text":"

For compatibility, the following OpenJDK HotSpot options are now supported by OpenJ9:

"},{"location":"version0.32/#sharedclassstatistics-api-updated","title":"SharedClassStatistics API updated","text":"

You can now use the SharedClassStatistics API to get the name, path, and directory of a shared classes cache. Depending on the operating system, you can also get the number of attached VMs for a non-persistent cache. This information is available through the following new methods: cacheDir(), cacheName(), cachePath(), and numberAttached(). For more information, see the API documentation.

"},{"location":"version0.32/#support-for-openssl-30x","title":"Support for OpenSSL 3.0.x","text":"

OpenSSL 3.0.x is supported but on Linux only. The JITServer technology feature currently does not support OpenSSL 3.0.x. For more information about OpenSSL support, see Cryptographic operations.

"},{"location":"version0.32/#new-xx-openj9commandlineenv-option-added","title":"New -XX:[+|-]OpenJ9CommandLineEnv option added","text":"

This option specifies whether the VM captures the command line in the environment variable OPENJ9_JAVA_COMMAND_LINE. For more information, see -XX:[+|-]OpenJ9CommandLineEnv.

"},{"location":"version0.32/#jitserver-support-for-linux-on-ibm-z-systems","title":"JITServer support for Linux on IBM Z\u00ae systems","text":"

JITServer technology is now a fully supported feature on Linux on IBM Z\u00ae systems (64-bit only). For more information, see JITServer technology.

"},{"location":"version0.32/#modified-default-value-for-xxmaxdirectmemorysize","title":"Modified default value for -XX:MaxDirectMemorySize","text":"

The default value of the -XX:MaxDirectMemorySize option, which limits the amount of heap memory that is used for direct byte buffers, is now the same as the maximum heap size.

"},{"location":"version0.32/#new-jdk-18-features","title":"New JDK 18 features","text":"

The following features are supported by OpenJ9:

The following features will be supported by OpenJ9 in a future release:

The following features are implemented in OpenJDK and available in any build of OpenJDK 18 with OpenJ9:

You can find the full list of features for JDK 18 at the OpenJDK project.

"},{"location":"version0.32/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.30.0 and v0.32.0 releases, see the Release notes.

"},{"location":"version0.33/","title":"Version 0.33.x","text":""},{"location":"version0.33/#whats-new-in-version-033x","title":"What's new in version 0.33.x","text":"

The following new features and notable changes since version 0.32.0 are included in this release:

"},{"location":"version0.33/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.33/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.33.x supports OpenJDK 8, 11, 17, and 18.

OpenJ9 Windows\u00ae builds for OpenJDK 8 are now compiled with Microsoft\u00ae Visual Studio 2017. The Visual Studio redistributable files included with the build are updated to match.

Note: Binaries that are labeled 0.33.1 include additional bug fixes. For more information, see the release notes.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.33/#jitserver-technology-feature-updated","title":"JITServer technology feature updated","text":"

The JITServer technology feature is updated to provide the following new capabilities, which are disabled by default:

"},{"location":"version0.33/#xl-c-runtime-required-on-aix","title":"XL C++ Runtime required on AIX","text":"

AIX OpenJ9 builds now require version 16.1 of the IBM XL C++ Runtime. This was already required for OpenJDK 17 and is now also required from 11.0.16 to accommodate a security update to the HarfBuzz text shaping library.

"},{"location":"version0.33/#linux-reference-compiler-updated-to-gcc-103","title":"Linux reference compiler updated to gcc 10.3","text":"

Linux\u00ae builds for all platforms now use gcc 10.3 instead of gcc 7.5. See the list of build environments.

"},{"location":"version0.33/#the-maximum-number-of-jit-compilation-threads-is-increased","title":"The maximum number of JIT compilation threads is increased","text":"

The maximum number of JIT compilation threads is increased from 7 to 15. If the JITServer feature is enabled, the maximum number of JIT compilation threads is increased further on the server, to 999. You can set the number of compilation threads to be used by specifying the -XcompilationThreads command line option.

"},{"location":"version0.33/#default-operating-system-stack-size-increased-on-x64-platforms","title":"Default operating system stack size increased on x64 platforms","text":"

The default operating system stack size on Windows x64, macOS\u00ae x64, and Linux x64 platforms is increased from 256 KB to 512 KB to accommodate vector support. You can change the operating system stack size by using the -Xmso option.

"},{"location":"version0.33/#control-groups-v2-support","title":"Control groups v2 support","text":"

The Linux kernel has two variants of control groups (cgroups): v1 and v2. Many Linux operating systems are gradually transitioning from cgroups v1 to v2 as their default choice. Now, OpenJ9 has added cgroups v2 support, which is identical to the support for cgroups v1.

"},{"location":"version0.33/#support-for-openssl-30x","title":"Support for OpenSSL 3.0.x","text":"

The JITServer technology feature now supports OpenSSL 3.0.x. For more information about OpenSSL support, see Cryptographic operations.

"},{"location":"version0.33/#ec-key-agreement-algorithm-support-for-openssl","title":"EC key agreement algorithm support for OpenSSL","text":"

The EC key agreement algorithm can now use the native OpenSSL library. For more information, see -Djdk.nativeEC.

"},{"location":"version0.33/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.32.0 and v0.33.x, see the Release notes.

"},{"location":"version0.35/","title":"Version 0.35.0","text":""},{"location":"version0.35/#whats-new-in-version-0350","title":"What's new in version 0.35.0","text":"

The following new features and notable changes since version 0.33.1 are included in this release:

"},{"location":"version0.35/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.35/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.35.0 supports OpenJDK 8, 11, and 17.

OpenJ9 Windows\u00ae builds for OpenJDK 11 are now compiled with Microsoft\u00ae Visual Studio 2019. The Visual Studio redistributable files included with the build are updated to match.

Apple silicon macOS\u00ae is now a fully supported, production-ready target for OpenJDK 11 and later.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.35/#java-dump-files-contain-more-information-about-waiting-threads","title":"Java dump files contain more information about waiting threads","text":"

For threads that are waiting for a class initialization lock, the Java dump output now shows the thread that is currently working to progress the initialization of the class. This thread is indicated by the new Initializing thread: <thread_name> string in the existing 3XMTHREADBLOCK line in the Java dump output. For example:

3XMTHREADBLOCK Waiting on: java/lang/J9VMInternals$ClassInitializationLock@0x00000000FFF5DC90 Owned by: <unowned> Initializing thread: \"Class Initialization Thread 1\"

For more information, see Threads.

"},{"location":"version0.35/#new-xx-shownativestacksymbols-option-added","title":"New -XX:[+|-]ShowNativeStackSymbols option added","text":"

This option controls whether Java dumps show the names of functions in native call stacks.

For more information, see -XX:[+|-]ShowNativeStackSymbols.

"},{"location":"version0.35/#new-user2-event-added-for-the-xdump-option","title":"New user2 event added for the -Xdump option","text":"

On operating systems other than Windows\u2122, you can now use the user2 event for the -Xdump option. This event is triggered when the VM receives the SIGUSR2 signal.

There is a change in the SIGUSR2 signal behavior as well whereby, the process does not exit in response to this signal.

For more information, see -Xdump and Signal handling.

"},{"location":"version0.35/#new-xx-perftool-option-added","title":"New -XX:[+|-]PerfTool option added","text":"

This option enables or disables the JIT support for the perf tool without affecting the existing Xjit options.

Since this option creates a file that is used by the Linux\u00ae system profiler, perf, it applies only to Linux.

For more information, see -XX:[+|-]PerfTool.

"},{"location":"version0.35/#new-default-options-added-in-the-optionsdefault-file","title":"New default options added in the options.default file","text":"

-XX:+EnsureHashed:java/lang/Class,java/lang/Thread is added to the list of default options in the options.default file to improve performance.

For more information, see XX:[+|-]EnsureHashed.

"},{"location":"version0.35/#new-options-added-to-encrypt-the-jitserver-exported-metrics","title":"New options added to encrypt the JITServer exported metrics","text":"

You can use the -XX:JITServerMetricsSSLKey and -XX:JITServerMetricsSSLCert options to encrypt the custom metrics with TLS or SSL.

"},{"location":"version0.35/#xl-c-runtime-16107-or-later-required-on-aix","title":"XL C++ Runtime 16.1.0.7 or later required on AIX","text":"

AIX OpenJ9 builds now require version 16.1.0.7 or later of the IBM XL C++ Runtime.

"},{"location":"version0.35/#-xx-jitserverlocalsynccompiles-enabled-by-default","title":"-XX:[+|-]JITServerLocalSyncCompiles enabled by default","text":"

The -XX:[+|-]JITServerLocalSyncCompiles option is now enabled in most cases. For more information, see -XX:[+|-]JITServerLocalSyncCompiles.

"},{"location":"version0.35/#support-for-changes-to-the-maintenance-specifications-of-jsr-337-in-java-8","title":"Support for changes to the maintenance specifications of JSR 337 in Java 8","text":"

OpenJ9 now supports changes to the maintenance specifications in Java 8 as listed in the JSR 337 Maintenance Release 4 document.

These changes include the change in the garbage collector behavior for handling the phantom references in Java 8. The garbage collector handles both the phantom as well as the weak references similarly, which is the current behavior in Java 11 and later. For more information, see Weak reference processing.

"},{"location":"version0.35/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.33.1 and v0.35.0 releases, see the Release notes.

"},{"location":"version0.36/","title":"Version 0.36.x","text":""},{"location":"version0.36/#whats-new-in-version-036x","title":"What's new in version 0.36.x","text":"

The following new features and notable changes since version 0.35.0 are included in this release:

"},{"location":"version0.36/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.36/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.36.0 supports OpenJDK 8 and 17.

Release 0.36.1 supports OpenJDK 11.

Support for running OpenJ9 with OpenJDK 8 or OpenJDK 11 on CentOS 6.10 is deprecated and might be removed in a future release. OpenJ9 will not be tested with OpenJDK 11 on CentOS 6.10 after the 0.36.1 release.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.36/#changes-to-the-location-of-the-default-directory-for-the-shared-cache-and-snapshot","title":"Changes to the location of the default directory for the shared cache and snapshot","text":"

On operating systems other than Windows\u2122 and z/OS\u00ae, the default shared classes cache directory in the user's home directory is changed from javasharedresources to .cache/javasharedresources. This change is to avoid cluttering of the home directory. If you specify -Xshareclasses:groupAccess, the default directory remains /tmp/javasharedresources/.

If the javasharedresources directory in the user's home directory is empty, the javasharedresources directory can be deleted.

You can find and remove caches or snapshots in the old default directory by using the following command-line options:

For persistent caches:

For nonpersistent caches or snapshots:

"},{"location":"version0.36/#new-xx-mergecompileroptions-option-added","title":"New -XX:[+|-]MergeCompilerOptions option added","text":"

This option enables or disables the merging of multiple -Xjit or -Xaot options into a single -Xjit or -Xaot option.

For more information, see -XX:[+|-]MergeCompilerOptions.

"},{"location":"version0.36/#default-jitserver-aot-cache-name-changed","title":"Default JITServer AOT cache name changed","text":"

A JITServer instance can have several AOT caches, each with its own name and containing different versions of compiled methods. Client JVMs with different profiles of execution can connect to the same JITServer instance, but access the cache with compiled methods optimized for their own profile with the -XX:JITServerAOTCacheName option. Earlier, if the cache name was not specified in this option, the default was to use a nameless cache. The default AOT cache name is now changed to default.

This change is to allow AOT cache persistence, whereby JITServer can periodically save its AOT caches to files with names that include the name of the cache. JITServer can then load caches from such files when a client requests a particular cache.

For more information, see -XX:JITServerAOTCacheName and -XX:[+|-]JITServerAOTCachePersistence.

"},{"location":"version0.36/#new-xxjitserveraotmx-option-added","title":"New -XX:JITServerAOTmx option added","text":"

This option specifies the maximum amount of memory that can be used by the JITServer AOT cache. Instead of unlimited memory consumption, the maximum amount of memory that all AOT cache instances combined can use at the server is now limited to 300 MB, by default.

For more information, see -XX:JITServerAOTmx.

"},{"location":"version0.36/#new-xx-jitserveraotcachepersistence-option-added","title":"New -XX:[+|-]JITServerAOTCachePersistence option added","text":"

The JITServer AOT cache was a non-persistent in-memory cache. If the JITServer instance terminated, the cache content was lost. Now, with the -XX:+JITServerAOTCachePersistence option, the JITServer server periodically saves its AOT caches to files. Other JITServer instances can then load these caches from files the first time a client requests a particular cache.

For more information, see -XX:[+|-]JITServerAOTCachePersistence.

"},{"location":"version0.36/#new-xxjitserveraotcachedir-option-added","title":"New -XX:JITServerAOTCacheDir option added","text":"

You can specify the directory for saving or loading the JITServer AOT cache files with the -XX:JITServerAOTCacheDir=<directory> option. If the option is not used, AOT cache files are saved to (or loaded from) the current working directory of the JITServer server.

For more information, see -XX:JITServerAOTCacheDir.

"},{"location":"version0.36/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.35.0 and v0.36.x releases, see the Release notes.

"},{"location":"version0.37/","title":"Version 0.37.0","text":""},{"location":"version0.37/#whats-new-in-version-0370","title":"What's new in version 0.37.0","text":"

The following new features and notable changes since version 0.36.x are included in this release:

"},{"location":"version0.37/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.37/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.37.0 works with OpenJDK 19. OpenJDK 19 is out of support at the time of the 0.37.0 release. Builds of 0.37.0 should not be used in production and might contain known security vulnerabilities as of 18 April 2023.

RHEL 8.2 is out of support. RHEL 8.4 is the new minimum operating system level.

OpenJ9 Windows\u00ae builds for OpenJDK 19 and later are now compiled with Microsoft\u00ae Visual Studio 2022. The Visual Studio redistributable files included with the build are updated to match.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.37/#aix-is-now-built-on-aix-72-tl5","title":"AIX is now built on AIX 7.2 TL5","text":"

All AIX compiles are now moved from AIX 7.1 TL5 to AIX 7.2 TL5.

For more information, see Supported environments.

"},{"location":"version0.37/#linux-reference-compiler-updated-to-gcc-112","title":"Linux reference compiler updated to gcc 11.2","text":"

Linux builds for platforms Linux x86 64-bit, Linux on POWER LE 64-bit, and Linux on IBM Z 64-bit now use gcc 11.2 instead of gcc 10.3. Linux AArch64 64-bit continues to use the gcc 10.3 compiler. See the list of build environments.

"},{"location":"version0.37/#support-added-for-the-comsunmanagementthreadmxbean-interface","title":"Support added for the com.sun.management.ThreadMXBean interface","text":"

The OpenJ9 ThreadMXbean interface (com.ibm.lang.management.ThreadMXBean) was extending the java.lang.management.ThreadMXBean interface. With this release, the OpenJ9 ThreadMXBean interface extends the com.sun.management.ThreadMXBean interface, whereby it now contains all the methods of the java.lang.management.ThreadMXBean interface with additional methods from the com.sun.management.ThreadMXBean interface.

The OpenJ9 VM implementation does not support thread memory allocation measurement (isThreadAllocatedMemorySupported method returns false).

"},{"location":"version0.37/#support-for-pkcs11-token-labels-added-on-linux-on-ibm-z","title":"Support for PKCS#11 token labels added on Linux on IBM Z","text":"

On restarting an application, or creating or removing of tokens, the token might move to a different slot. An application that uses the slot or slotListIndex attributes might fail if it doesn\u2019t first check which slot the token is in.

OpenJ9 now supports the use of an extra attribute, tokenlabel, in the SunPKCS11 configuration file on Linux on IBM Z, which helps to avoid this issue.

For more information, see Support for PKCS#11 token labels.

"},{"location":"version0.37/#new-message-added-to-help-find-system-dumps-on-linux","title":"New message added to help find system dumps on Linux","text":"

A new message, JVMPORT049I, is added to help find the system dump files for kernel.core_pattern piped programs on Linux.

For more information about system dumps and piped system dumps, see System dumps on Linux.

"},{"location":"version0.37/#new-jdk-19-features","title":"New JDK 19 features","text":"

The following features are supported by OpenJ9:

The following features are implemented in OpenJDK and available in any build of OpenJDK 19 with OpenJ9:

You can find the full list of features for JDK 19 at the OpenJDK project. Any remaining features that are listed are not implemented and hence not applicable to OpenJ9 in this release.

"},{"location":"version0.37/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.36.x and v0.37.0 releases, see the Release notes.

"},{"location":"version0.38/","title":"Version 0.38.0","text":""},{"location":"version0.38/#whats-new-in-version-0380","title":"What's new in version 0.38.0","text":"

The following new features and notable changes since version 0.37.0 are included in this release:

"},{"location":"version0.38/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.38/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.38.0 supports OpenJDK 8, 11 and 17.

Support for running OpenJ9 with OpenJDK 8 or OpenJDK 11 on CentOS 6.10 is deprecated and might be removed in a future release. Since release 0.37, OpenJ9 is no longer tested with OpenJDK 11 on CentOS 6.10. Testing of OpenJ9 with OpenJDK 8 on CentOS 6.10 is likely to end in a future release.

OpenJ9 Windows\u00ae builds for OpenJDK 8 are now compiled with Microsoft\u00ae Visual Studio 2019. The Visual Studio redistributable files included with the build are updated to match.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.38/#new-xx-handlesigusr2-option-added","title":"New -XX:[+|-]HandleSIGUSR2 option added","text":"

This option controls the handling of the SIGUSR2 signal by the VM signal handler. The VM signal handler is installed only if this option is enabled.

For more information, see -XX:[+|-]HandleSIGUSR2.

"},{"location":"version0.38/#technical-preview-of-criu-support","title":"Technical preview of CRIU support","text":"

This release supports, as a technical preview, the Checkpoint/Restore In Userspace (CRIU) tool that is included with many Linux distributions. This tool is available for OpenJDK 11 and later running on Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), and Linux on IBM Z\u00ae only.

You can use the CRIU feature to stop the VM at a checkpoint, save its state, then run the VM from the point where it was stopped. You can restore the checkpoint image in multiple other environments with improved start-up time. This capability means that the CRIU support is particularly useful in container environments. For more information, see CRIU support.

"},{"location":"version0.38/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.37.0 and v0.38.0 releases, see the Release notes.

"},{"location":"version0.39/","title":"Version 0.39.0","text":""},{"location":"version0.39/#whats-new-in-version-0390","title":"What's new in version 0.39.0","text":"

The following new features and notable changes since version 0.38.0 are included in this release:

"},{"location":"version0.39/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.39/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.39.0 supports OpenJDK 20.

OpenJDK 20 with Eclipse OpenJ9 is not a long term support (LTS) release.

RHEL 8.4 is out of support. RHEL 8.6 is the new minimum operating system level.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.39/#ec-key-generation-algorithm-support-for-openssl","title":"EC key generation algorithm support for OpenSSL","text":"

The EC key generation algorithm can now use the native OpenSSL library for OpenJDK 20. For more information, see -Djdk.nativeECKeyGen.

"},{"location":"version0.39/#new-jdk-20-features","title":"New JDK 20 features","text":"

The following features are supported by OpenJ9:

The following features are implemented in OpenJDK and available in any build of OpenJDK 20 with OpenJ9:

You can find the full list of features for JDK 20 at the OpenJDK project. Any remaining features that are listed either do not apply to OpenJ9 or are not implemented and hence not applicable to OpenJ9 in this release.

"},{"location":"version0.39/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.38.0 and v0.39.0 releases, see the Release notes.

"},{"location":"version0.40/","title":"Version 0.40.0","text":""},{"location":"version0.40/#whats-new-in-version-0400","title":"What's new in version 0.40.0","text":"

The following new features and notable changes since version 0.39.0 are included in this release:

"},{"location":"version0.40/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.40/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.40.0 supports OpenJDK 8, 11, 17 and 20.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.40/#new-xxcodecachetotalmaxrampercentage-option-added","title":"New -XX:codecachetotalMaxRAMPercentage option added","text":"

In environments with low physical memory availability, the VM might use too much memory for JIT code caches, leaving little memory for critical operations. With the -XX:codecachetotalMaxRAMPercentage option, you can set an upper limit for the total code cache size, where the upper limit is specified as a percentage of the physical memory the VM process is allowed to use.

For more information, see -XX:codecachetotalMaxRAMPercentage.

"},{"location":"version0.40/#vm-starts-with-a-warning-message-after-the-container-detection-fails","title":"VM starts with a warning message after the container detection fails","text":"

If you mount the /proc file system with the hidepid=2 option on Linux\u00ae systems and the VM does not have root privileges, it cannot access the /proc file system. In previous releases, the VM exits when it encounters this scenario. From this release, the VM starts with a warning message after the container detection fails.

For more information, see the Cloud optimizations topic.

"},{"location":"version0.40/#support-for-persistent-shared-classes-cache-added-on-zos","title":"Support for persistent shared classes cache added on z/OS","text":"

Persistent shared caches are now supported on z/OS systems. The default cache type on z/OS is still non-persistent. You can use the -Xshareclasses:persistent option to switch to persistent shared cache.

"},{"location":"version0.40/#ec-key-generation-algorithm-and-xdh-key-agreement-and-generation-algorithms-support-for-openssl","title":"EC key generation algorithm and XDH key agreement and generation algorithms support for OpenSSL","text":"

The EC key generation algorithm can now use the native OpenSSL library for all OpenJDK versions. The XDH key agreement and generation algorithms can also use the native OpenSSL library. For more information, see -Djdk.nativeECKeyGen, -Djdk.nativeXDHKeyAgreement, and -Djdk.nativeXDHKeyGen.

"},{"location":"version0.40/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.39.0 and v0.40.0 releases, see the Release notes.

"},{"location":"version0.41/","title":"Version 0.41.0","text":""},{"location":"version0.41/#whats-new-in-version-0410","title":"What's new in version 0.41.0","text":"

The following new features and notable changes since version 0.40.0 are included in this release:

"},{"location":"version0.41/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.41/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.41.0 supports OpenJDK 8, 11, and 17.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.41/#new-xx-showcarrierframes-option-added","title":"New -XX:[+|-]ShowCarrierFrames option added","text":"

A VM maintains multiple platform threads that are used as carrier threads to run the virtual threads. Although the virtual thread runs on a carrier thread, the stack trace of the virtual thread and its carrier thread are separate. You can use the -XX:+ShowCarrierFrames option to add the stack trace of the carrier thread in addition to the virtual thread stack trace to the Throwable.getStackTrace() method, if an exception occurs.

For more information, see -XX:[+|-]ShowCarrierFrames.

"},{"location":"version0.41/#new-xxcontinuationcache-option-added","title":"New -XX:ContinuationCache option added","text":"

When a virtual thread is created, it is associated with a continuation, which holds the target task of the virtual thread. The VM saves the current thread state in an internal data structure that is linked with the continuation and allocates the memory for that structure. The VM stores the internal data structure in a continuation cache. New continuations can reuse the cached structure instead of allocating new memory for it.

You can optimize the virtual thread performance by tuning the continuation tier 1 and 2 cache size with the -XX:ContinuationCache option.

"},{"location":"version0.41/#-xxcompactstrings-option-enabled-by-default","title":"-XX:+CompactStrings option enabled by default","text":"

Like HotSpot, the-XX:+CompactStrings option is now enabled by default on Java\u2122 11 and later. In the earlier versions, this option is disabled by default.

For more information, see -XX:[+|-]CompactStrings.

"},{"location":"version0.41/#change-in-behavior-of-xshareclassesreadonly","title":"Change in behavior of -Xshareclasses:readonly","text":"

In the earlier releases, if the -Xshareclasses:readonly option and the JITServer AOT cache feature were both enabled at the same time at a JITServer client, the client could not use the JITServer AOT cache because the cache for storing data that the JITServer AOT cache needed was read-only.

Now, with the change in behavior of the -Xshareclasses:readonly option, the shared classes cache startup creates a temporary new (writable) top layer that the JITServer AOT cache can use to store data that it needs to function.

"},{"location":"version0.41/#new-xx-enabledynamicagentloading-option-added","title":"New -XX:[+|-]EnableDynamicAgentLoading option added","text":"

This option enables or disables the dynamic loading of agents into a running VM. The -XX:+EnableDynamicAgentLoading option is the default setting.

For Java 21 and later, warnings are issued when the agents are loaded dynamically into a running VM after startup without specifying the -XX:+EnableDynamicAgentLoading option and the same agents were not loaded before.

For more information, see -XX:[+|-]EnableDynamicAgentLoading.

"},{"location":"version0.41/#new-xx-usezlibnx-option-added","title":"New -XX:[+|-]UseZlibNX option added","text":"

AIX\u00ae system adds the zlibnx library directory path in the LIBPATH environment variable by default, if it is available in the system. You can control the loading of the zlibnx library by using the -XX:[+|-]UseZlibNX option.

"},{"location":"version0.41/#support-for-openssl-3x","title":"Support for OpenSSL 3.x","text":"

OpenSSL 3.x is now supported on all operating systems. For more information about OpenSSL support, see Cryptographic operations.

"},{"location":"version0.41/#performance-improvement","title":"Performance improvement","text":"

Performance of algorithms with the use of OpenSSL version 3 and later is now enhanced. Improved algorithms include SHA256, AES, HmacSHA256, and ChaCha20. To obtain these improved algorithms and further enhance the performance of these algorithms on Linux\u00ae and AIX, use OpenSSL 3.0.12 or a later 3.0.x version, or 3.1.4 or a later 3.1.x version.

"},{"location":"version0.41/#support-added-for-the-comsunmanagementthreadmxbeangetthreadallocatedbytes-api","title":"Support added for the com.sun.management.ThreadMXBean.getThreadAllocatedBytes() API","text":"

With this release, the OpenJ9 VM implementation supports thread memory allocation measurement (com.sun.management.ThreadMXBean.getThreadAllocatedBytes() API). The isThreadAllocatedMemorySupported() method now returns true instead of false. The setThreadAllocatedMemoryEnabled() and isThreadAllocatedMemoryEnabled() methods do not throw the \"UnsupportedOperationException\" error now and are enabled by default.

Support for the com.sun.management.ThreadMXBean.getThreadAllocatedBytes() API is not added on z/OS\u00ae platforms in this release. In the coming future z/OS release, the support for this API will be added on z/OS platforms as well.

"},{"location":"version0.41/#change-in-behavior-of-the-djavasecuritymanager-system-property-for-openjdk-version-11","title":"Change in behavior of the -Djava.security.manager system property for OpenJDK version 11","text":"

From OpenJDK version 18 onwards, if you enable the SecurityManager at runtime by calling the System.setSecurityManager() API, you must set the -Djava.security.manager=allow option. To disable the SecurityManager, you must specify the -Djava.security.manager=disallow option. If an application is designed to run on multiple OpenJDK versions, the same command line might be used across multiple versions. Because of this use of the same command line across multiple versions, in OpenJDK versions before version 18, the runtime attempts to load a SecurityManager with the class name allow or disallow resulted in an error and the application was not starting.

To resolve this issue, OpenJDK version 17 ignores these options. With this release, OpenJDK version 11 also ignores the allow and disallow keywords, if specified.

"},{"location":"version0.41/#jitserver-support-for-linux-on-aarch64","title":"JITServer support for Linux on AArch64","text":"

JITServer technology is now a fully supported feature on Linux on AArch64 systems. For more information, see JITServer technology.

"},{"location":"version0.41/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.40.0 and v0.41.0 releases, see the Release notes.

"},{"location":"version0.42/","title":"Version 0.42.0","text":""},{"location":"version0.42/#whats-new-in-version-0420","title":"What's new in version 0.42.0","text":"

The following new features and notable changes since version 0.41.0 are included in this release:

"},{"location":"version0.42/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.42/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.42.0 supports OpenJDK 21.

OpenJDK 21 with Eclipse OpenJ9 is a long term support (LTS) release and supersedes OpenJDK 20 with Eclipse OpenJ9.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.42/#openj9-jextract-removed","title":"OpenJ9 jextract removed","text":"

The dump extractor tool, OpenJ9 jextract, that was deprecated since the 0.26.0 release is now removed from Java 21 and later. The jpackcore tool replaced the OpenJ9 jextract tool after its deprecation.

"},{"location":"version0.42/#change-in-the-systemgc-call-behavior","title":"Change in the System.gc() call behavior","text":"

The System.gc call triggers a global garbage collection (GC) cycle, which is a stop-the-world GC. If the System.gc() call was made during an active GC cycle where the concurrent operation was in progress, the status of objects might not be updated. An object that was reachable when the concurrent operation started might be considered as reachable even if the object is no longer in use later. The System.gc() call had to be called twice explicitly to ensure that all unreachable objects are identified and cleared.

Now, the System.gc() call triggers the GC cycle twice internally to clear the unreachable objects that were not identified during the first GC cycle. The call also triggers finalization of the objects in the Finalization queues.

For more information, see Garbage collection.

"},{"location":"version0.42/#new-xx-iprofileduringstartupphase-option-added","title":"New -XX:[+|-]IProfileDuringStartupPhase option added","text":"

The VM uses heuristics to decide whether to collect interpreter profiling information during the VM startup. You can overrule the heuristics and control the collection of the profiling information during the startup phase by using the -XX:[+|-]IProfileDuringStartupPhase option.

"},{"location":"version0.42/#new-xx-criusecprovider-option-added","title":"New -XX:[+|-]CRIUSecProvider option added","text":"

When you enable CRIU support, all the existing security providers are removed from the security provider list during the checkpoint phase and CRIUSECProvider is added by default.

You can now control the use of CRIUSECProvider during the checkpoint phase with the -XX:[+|-]CRIUSecProvider option. You can use all the existing security providers instead of the CRIUSECProvider by specifying the -XX:-CRIUSecProvider option.

For more information, see -XX:[+|-]CRIUSecProvider.

"},{"location":"version0.42/#new-jdk-21-features","title":"New JDK 21 features","text":"

The following features are supported by OpenJ9:

The following features are implemented in OpenJDK and available in any build of OpenJDK 21 with OpenJ9:

You can find the full list of features for JDK 21 at the OpenJDK project. Any remaining features that are listed either do not apply to OpenJ9 or are not implemented and hence not applicable to OpenJ9 in this release.

"},{"location":"version0.42/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.41.0 and v0.42.0 releases, see the Release notes.

"},{"location":"version0.43/","title":"Version 0.43.0","text":""},{"location":"version0.43/#whats-new-in-version-0430","title":"What's new in version 0.43.0","text":"

The following new features and notable changes since version 0.42.0 are included in this release:

"},{"location":"version0.43/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.43/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.43.0 supports OpenJDK 8, 11, 17, and 21.

OpenJ9 Windows\u00ae builds for OpenJDK 8, 11, and 17 are now compiled with Microsoft\u00ae Visual Studio 2022. The Visual Studio redistributable files included with the build are updated to match.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.43/#compiler-changes-for-linux","title":"Compiler changes for Linux","text":"

Linux x86 64-bit, Linux on POWER\u00ae LE 64-bit, and Linux on IBM Z\u00ae 64-bit builds on OpenJDK 8, 11, and 17 now use gcc 11.2 compiler. Linux AArch64 64-bit moved to gcc 10.3 compiler from gcc 7.5 compiler on OpenJDK 8 and 11.

On OpenJDK 19 and later, the Linux reference compiler was already updated to gcc 11.2 in release 0.37.0.

For more information, see Supported environments.

"},{"location":"version0.43/#change-in-the-large-page-memory-allocation-behavior","title":"Change in the large page memory allocation behavior","text":"

Earlier, the JIT code cache was allocated memory as a multiple of the available page size even if the configured large page size was greater than the total JIT code cache size.

Now, if the configured large page size is greater than the size of the total code cache for JIT, then the page size that is used for code cache allocation is recalculated. The next available lower page size on the platform is used for the code cache allocation.

For more information, see -Xlp:codecache.

"},{"location":"version0.43/#new-xx-criusecprovider-option-added","title":"New -XX:[+|-]CRIUSecProvider option added","text":"

When you enable CRIU support, all the existing security providers are removed from the security provider list during the checkpoint phase and CRIUSECProvider is added by default.

You can now control the use of CRIUSECProvider during the checkpoint phase with the -XX:[+|-]CRIUSecProvider option. You can use all the existing security providers instead of the CRIUSECProvider by specifying the -XX:-CRIUSecProvider option.

For more information, see -XX:[+|-]CRIUSecProvider.

"},{"location":"version0.43/#new-xxcompatibility-option-added","title":"New -XX:Compatibility option added","text":"

The Elasticsearch application was facing incompatibility issues when it was running on OpenJ9 and required many workarounds. With the -XX:Compatibility option, you can enable a compatibility mode that OpenJ9 can run in to support applications that require specific capabilities.

In release 0.43.0, the compatibility mode is provided for the Elasticsearch application only.

For more information, see -XX:Compatibility.

"},{"location":"version0.43/#new-xx-cpuloadcompatibility-option-added","title":"New -XX:[+|-]CpuLoadCompatibility option added","text":"

The getProcessCpuLoad() and getSystemCpuLoad() methods were returning -1 to indicate that the recent CPU usage is not available when these methods were called in OpenJ9 for the first time. It was difficult to identify whether the reason for the -1 value was an error or because the call was the first call and therefore, no recent CPU usage was available.

In OpenJDK, these methods return 0 value in the case of the first call, which makes it easier to differentiate between the first call behavior and an error that needs further investigation.

The -XX:+CpuLoadCompatibility option is used to enable the OpenJDK behavior of the getProcessCpuLoad() and getSystemCpuLoad() methods in OpenJ9 so that these methods return 0 when called in OpenJ9 for the first time.

For more information, see -XX:[+|-]CpuLoadCompatibility.

"},{"location":"version0.43/#support-added-for-the-comsunmanagementthreadmxbeangetthreadallocatedbytes-api-on-zos-platforms","title":"Support added for the com.sun.management.ThreadMXBean.getThreadAllocatedBytes() API on z/OS platforms","text":"

With this release, support for the com.sun.management.ThreadMXBean.getThreadAllocatedBytes() API is added on z/OS\u00ae platforms as well.

"},{"location":"version0.43/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.42.0 and v0.43.0 releases, see the Release notes.

"},{"location":"version0.44/","title":"Version 0.44.0","text":""},{"location":"version0.44/#whats-new-in-version-0440","title":"What's new in version 0.44.0","text":"

The following new features and notable changes since version 0.43.0 are included in this release:

"},{"location":"version0.44/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.44/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.44.0 supports OpenJDK 8, 11, 17, and 21.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.44/#change-in-behavior-of-the-djavasecuritymanager-system-property-for-openjdk-version-8","title":"Change in behavior of the -Djava.security.manager system property for OpenJDK version 8","text":"

From OpenJDK version 18 onwards, if you enable the SecurityManager at runtime by calling the System.setSecurityManager() API, you must set the -Djava.security.manager=allow option. To disable the SecurityManager, you must specify the -Djava.security.manager=disallow option. If an application is designed to run on multiple OpenJDK versions, the same command line might be used across multiple versions. Because of this use of the same command line across multiple versions, in OpenJDK versions before version 18, the runtime attempts to load a SecurityManager with the class name allow or disallow resulted in an error and the application was not starting.

To resolve this issue, OpenJDK version 17 ignores these options and from 0.41.0 release onwards, OpenJDK version 11 also ignores these options. With this release, OpenJDK version 8 too ignores the allow and disallow keywords, if specified.

"},{"location":"version0.44/#display-of-multiple-warnings-on-loading-the-same-agent-restricted-on-aix-systems","title":"Display of multiple warnings on loading the same agent restricted on AIX systems","text":"

Earlier, on AIX systems, warnings were issued each time the agents were loaded dynamically into a running VM after startup without specifying the -XX:+EnableDynamicAgentLoading option, even if the same agents were loaded before.

Now, from 0.44.0 release onwards, AIX systems, like other OpenJ9 supported operating systems, can detect whether an agent was previously loaded or not. Therefore, like other platforms, on AIX systems also, the warnings are issued only once for the same agent when the -XX:+EnableDynamicAgentLoading option is not specified.

For more information, see -XX:[+|-]EnableDynamicAgentLoading.

"},{"location":"version0.44/#xl-c-runtime-16107-or-later-required-for-aix-openj9-builds-on-openjdk-8","title":"XL C++ Runtime 16.1.0.7 or later required for AIX OpenJ9 builds on OpenJDK 8","text":"

AIX OpenJ9 builds now require version 16.1.0.7 or later of the IBM XL C++ Runtime on OpenJDK 8 as well.

"},{"location":"version0.44/#new-xx-showunmountedthreadstacks-option-added","title":"New -XX:[+|-]ShowUnmountedThreadStacks option added","text":"

Java\u2122 core file lists stacks of only those threads that are mapped to platform threads. An unmounted virtual thread is not mapped to any platform thread. Therefore, the stack of any unmounted virtual thread is not included in the Java core file and thus, the virtual thread information remains incomplete.

You can use the -XX:+ShowUnmountedThreadStacks option to include all the thread data that a VM is aware of, both regular Java threads and the unmounted virtual threads, in a Java core file.

For more information, see -XX:[+|-]ShowUnmountedThreadStacks.

"},{"location":"version0.44/#vmid-query-in-the-jcmd-tool-enhanced","title":"VMID query in the jcmd tool enhanced","text":"

Earlier in OpenJ9, when sending a jcmd command to a VM, you had to run jcmd -l to retrieve all the pids for all the VMs found on the machine. Then, you had to use jcmd [vmid] [command] to send the command to the specific VM.

For OpenJDK compatibility, OpenJ9 now supports direct use of the Java process name, full or partial, as the ID to send the jcmd command.

The jcmd tool also now supports specifying 0 as a VMID to target all VMs.

For more information, see Java diagnostic command (jcmd) tool.

"},{"location":"version0.44/#ddr-field-names-in-j9buildflags-changed","title":"DDR field names in J9BuildFlags changed","text":"

The Direct Dump Reader (DDR) code enables reading system dump data by using the OpenJ9 Diagnostic Tool Framework for Java (DTFJ) API or the jdmpview tool. DDR code uses fields of J9BuildFlags to access build flags in the system dump data. The names of J9BuildFlags fields changed over time and therefore, supporting system dumps with different build flags became a challenge.

Earlier, field names in J9BuildFlags were based on names defined in j9.flags. Now, when the J9BuildFlags is generated for each build, the flag names are those names that are specified in j9cfg.h (derived from j9cfg.h.ftl or j9cfg.h.in) instead of the names that are defined in j9.flags. For example, env_data64 is now referred to as J9VM_ENV_DATA64.

You can extend the DDR code, adding your own commands, by writing plug-ins. If the user plug-in code contains references to fields of J9BuildFlags to read the build flags in the system dump data, you must change references to use the names as specified in j9cfg.h.

"},{"location":"version0.44/#new-system-property-added-to-prevent-the-deletion-of-the-attach-api-control-files-within-the-tmp-folder","title":"New system property added to prevent the deletion of the Attach API control files within the /tmp/ folder","text":"

You can use the -Dcom.ibm.tools.attach.fileAccessUpdateTime system property to prevent Linux\u00ae systemd-tmpfiles from deleting the Attach API control files within the /tmp/ folder. By updating the Attach API control file access times to avoid deletion by systemd-tmpfiles, the long-running Attach API can continue to use the control files to operate. This system property enables Attach API to update the control file access times at specific intervals.

For more information, see -Dcom.ibm.tools.attach.fileAccessUpdateTime.

"},{"location":"version0.44/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.43.0 and v0.44.0 releases, see the Release notes.

"},{"location":"version0.45/","title":"Version 0.45.0","text":""},{"location":"version0.45/#whats-new-in-version-0450","title":"What's new in version 0.45.0","text":"

The following new features and notable changes since version 0.44.0 are included in this release:

"},{"location":"version0.45/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.45/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.45.0 supports OpenJDK 22.

OpenJDK 22 with Eclipse OpenJ9 is not a long term support (LTS) release.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.45/#new-jdk-22-features","title":"New JDK 22 features","text":"

The following features are supported by OpenJ9:

The following features are implemented in OpenJDK and available in any build of OpenJDK 22 with OpenJ9:

You can find the full list of features for JDK 22 at the OpenJDK project. Any remaining features that are listed either do not apply to OpenJ9 or are not implemented and hence not applicable to OpenJ9 in this release.

"},{"location":"version0.45/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.44.0 and v0.45.0 releases, see the Release notes.

"},{"location":"version0.46/","title":"Version 0.46.0","text":""},{"location":"version0.46/#whats-new-in-version-0460","title":"What's new in version 0.46.0","text":"

The following new features and notable changes since version 0.45.0 are included in this release:

"},{"location":"version0.46/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.46/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.46.0 supports OpenJDK 8, 11, 17, 21, and 22.

Support for running OpenJ9 with all versions of OpenJDK on CentOS 6, CentOS 7, Red Hat Enterprise Linux (RHEL) 6, and RHEL 7 is removed.

RHEL 8.6 and 9.0 are out of support. RHEL 8.8 is the new minimum operating system level.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.46/#md5-message-digest-algorithm-support-for-openssl","title":"MD5 message digest algorithm support for OpenSSL","text":"

OpenSSL native cryptographic support is added for the MD5 message digest algorithm, providing improved cryptographic performance. OpenSSL support is enabled by default. If you want to turn off support for the MD5 message digest algorithm, set the -Djdk.nativedigest system property to false.

"},{"location":"version0.46/#support-added-for-the-comsunmanagementthreadmxbeangettotalthreadallocatedbytes-api","title":"Support added for the com.sun.management.ThreadMXBean.getTotalThreadAllocatedBytes() API","text":"

With this release, the OpenJ9 VM implementation supports measurement of the total memory allocation for all threads (com.sun.management.ThreadMXBean.getTotalThreadAllocatedBytes() API).

The getTotalThreadAllocatedBytes() method now returns the total thread allocated bytes instead of -1.

"},{"location":"version0.46/#the-jitserver-aot-caching-feature-enabled-by-default-at-the-jitserver-server","title":"The JITServer AOT caching feature enabled by default at the JITServer server","text":"

-XX:+JITServerUseAOTCache is the default setting at the JITServer server now. That means that you don't have to specify the -XX:+JITServerUseAOTCache option at the server to enable the JITServer AOT caching feature.

Although this option is by default enabled at the server, it is still disabled for the JITServer clients. The clients that want to use the JITServer AOT caching, must still specify the -XX:+JITServerUseAOTCache option on the command line. Also, now the clients don't have to enable the shared classes cache feature to use the -XX:+JITServerUseAOTCache option.

For more information, see -XX:[+|-]JITServerUseAOTCache.

"},{"location":"version0.46/#the-extended-hot-code-replace-hcr-capability-disabled-and-xx-enableextendedhcr-option-added","title":"The extended Hot Code Replace (HCR) capability disabled and -XX:[+|-]EnableExtendedHCR option added","text":"

By default, the extended HCR capability in the VM is disabled for all OpenJDK versions, which is a change from the previous releases. You can enable the HCR capability by using the new option, -XX:+EnableExtendedHCR option.

The extended HCR feature is deprecated in this release and will be removed in a future release. From OpenJDK 25 onwards, extended HCR will not be supported. Following that, the extended HCR support will be removed from other earlier OpenJDK versions also.

"},{"location":"version0.46/#new-system-property-added-to-improve-jcmd-attaching-in-case-of-the-socketexception-error-on-windows-platform","title":"New system property added to improve jcmd attaching in case of the SocketException error on Windows platform","text":"

When the jcmd tool sends a command to a running VM, the command might throw the Socket Exception error on Windows platform. Instead of failing the attaching request, you can specify the number of times the tool retries attaching to the target VM with the new system property, -Dcom.ibm.tools.attach.retry.

"},{"location":"version0.46/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.45.0 and v0.46.0 releases, see the Release notes.

"},{"location":"version0.8/","title":"Version 0.8.0","text":""},{"location":"version0.8/#release-notes-version-080","title":"Release notes - version 0.8.0","text":"

Version 0.8.0 is the first release of Eclipse OpenJ9\u2122, as defined in the release plan.

This release supports OpenJDK Version 8 binaries at AdoptOpenJDK.net that contain the Eclipse OpenJ9 virtual machine.

For more information about supported platforms, and any issues and limitations, read the OpenJ9 GitHub release notes.

"},{"location":"version0.9/","title":"Version 0.9.0","text":""},{"location":"version0.9/#whats-new-in-version-090","title":"What's new in version 0.9.0","text":"

The following new features and notable changes from v.0.8.0 are included in this release:

"},{"location":"version0.9/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.9/#binaries-and-supported-platforms","title":"Binaries and supported platforms","text":"

The following additional OpenJDK binaries that contain the Eclipse OpenJ9\u2122 VM are now available from the AdoptOpenJDK community:

Complete platform support information for OpenJ9 can be found in Supported environments

"},{"location":"version0.9/#idle-tuning-feature","title":"Idle tuning feature","text":"

The idle tuning feature in OpenJ9 keeps your memory footprint small by releasing unused memory back to the operating system. Prior to Eclipse version 0.9.0 this feature was available only on Linux x86 architectures with the gencon garbage collection policy. From version 0.9.0, this feature is now available on Linux for IBM POWER\u00ae and IBM Z\u00ae architectures. For more information about this feature, see the following command line options, which control this behavior:

The following blog post describes the benefits of using this feature: Are you still paying for unused memory when your Java app is idle?

"},{"location":"version0.9/#new-gc-policy","title":"New GC policy","text":"

A new GC policy is introduced for JEP 318: Epsilon: A No-Op Garbage Collector.

When this policy is enabled, the Java object heap is expanded in the normal way until the limit is reached, but memory is not reclaimed through garbage collection. When the limit is reached the VM shuts down.

This JEP has a number of use cases including short-lived applications and certain test scenarios.

To enable this policy you can use one of the following options:

"},{"location":"version0.9/#modifying-the-default-java-heap-size-for-applications-that-run-in-containers","title":"Modifying the default Java heap size for applications that run in containers","text":"

When using container technology, applications are typically run on their own and do not need to compete for memory. In this release, changes are introduced to detect when OpenJ9 is running inside a container. If your application is running in a container and you want the VM to allocate a larger fraction of memory to the Java heap, set the -XX:+UseContainerSupport option on the command line.

The following table shows the maximum Java heap size that gets set, depending on the memory available:

Physical memory <size> Maximum Java heap size Less than 1 GB 50% <size> 1 GB - 2 GB <size> - 512M Greater than 2 GB 75% <size>

The default heap size for containers only takes affect when running in a container environment and when -XX:+UseContainerSupport is specified, which is expected to be the default in a future release.

"},{"location":"version0.9/#specifying-the-maximum-java-heap-size-as-a-percentage-value","title":"Specifying the maximum Java heap size as a percentage value","text":"

OpenJ9 now supports setting the heap size as a percentage of the physical memory. The following OpenJDK options are recognized and can be set for the VM:

To understand how to set these options, see -XX:InitialRAMPercentage / -XX:MaxRAMPercentage.

If your application is running in a container and you have specified -XX:+UseContainerSupport, as described in Modifying the default Java heap size for applications that run in containers, both the default heap size for containers and the -XX:MaxRAMPercentage and -XX:InitialRAMPercentage options are based on the available container memory.

"},{"location":"version0.9/#shared-classes-support-for-nested-jar-files","title":"Shared classes support for nested jar files","text":"

Changes are made to the com.ibm.oti.shared API to support nested jar files.

"},{"location":"version0.9/#direct-dump-reader-enabled-on-linux-and-windows","title":"Direct Dump Reader enabled on Linux and Windows","text":"

Direct Dump Reader (DDR) support is now enabled for the OpenJ9 VM on all Linux architectures and on Windows. The DDR code enables the VM to read system dump data by using the OpenJ9 Diagnostic Tool Framework for Java (DTFJ) API or the jdmpview tool. If you use the Eclipse Memory Analyzer\u2122 tool (MAT), you can also analyze OpenJ9 or IBM VMs by installing the DTFJ plug-in. (Install from the Eclipse Help menu; Install New Software > Work with \"IBM Diagnostic Tool Framework for Java\" > IBM Monitoring and Diagnostic Tools > Diagnostic Tool Framework for Java)

You must use a 32-bit VM to look at a 32-bit core, and a 64-bit VM to look at a 64-bit core. This restriction will be fixed in a later version of OpenJ9.

"},{"location":"version0.9/#changes-to-the-javalangstring-class","title":"Changes to the java.lang.String class","text":"

To match the behavior of OpenJDK, java.lang.String no longer has a count field, which changes the way that String.subString() works compared to Java 8. String.subString() now copies the value array. Similarly, StringBuffer and StringBuilder do not share the value array with any String created by toString().

For performance and compatibility with the new String object layout, the OpenJ9 implementations of StringBuffer and StringBuilder have been deprecated in favor of the OpenJDK implementations.

"},{"location":"version0.9/#changes-to-the-sharedclasscacheinfo-class","title":"Changes to the SharedClassCacheInfo class","text":"

SharedClassCacheInfo.getCacheJVMLevel() used to return the JVMLEVEL constant that maps to a Java version number, for example JVMLEVEL_JAVA8. This call now returns only the Java version number, for example 10 for Java 10.

"},{"location":"version0.9/#new-jdk-9-features","title":"New JDK 9 features","text":"

The following features are supported by OpenJ9:

You can find the full list of features for JDK 9 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

"},{"location":"version0.9/#new-jdk-10-features","title":"New JDK 10 features","text":"

The following features are supported by OpenJ9:

You can find the full list of features for JDK 10 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

"},{"location":"version0.9/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.8.0 and version 0.9.0 releases, see the Release notes.

"},{"location":"vgclog/","title":"Verbose GC logs","text":""},{"location":"vgclog/#verbose-garbage-collection-logs","title":"Verbose garbage collection logs","text":"

Garbage collection (GC) reclaims used memory in the Java\u2122 object heap for reuse. During cleanup of the heap, the verbose GC logs, when enabled, capture information about the different GC operations that are involved in the GC cycles. GC operations aim to reorganize or reclaim memory.

Verbose GC logs contain information about GC operations to assist with the following actions:

Verbose GC logs, when enabled, begin capturing information as soon as GC is initialized.

To help you visualize and analyze the GC, you can feed verbose GC log files into various diagnostic tools and interfaces. Examples include tools such as Garbage Collection and Memory Visualizer (GCMV) and online services such as GCEasy.

For examples of log output, including guidance on how to analyze the logs, see Log examples.

A further diagnostic step is to run one or more traces on GC activity by using the -Xtgc option. Trace output provides more granular information to help diagnose GC problems or perform finer tuning.

"},{"location":"vgclog/#how-to-generate-a-verbose-gc-log","title":"How to generate a verbose GC log","text":"

You can enable verbose GC logs by specifying the -verbose:gc standard option when you start your application. For more information, see standard command-line options.

The output of -verbose:gc is printed to STDERR by default. To print the log output to a file, append the -Xverbosegclog option. You can also use this option to print to a succession of files, where each file logs a specified number of GC cycles.

"},{"location":"vgclog/#verbose-gc-log-contents-and-structure","title":"Verbose GC log contents and structure","text":"

The verbose GC logs are printed in XML format and consist of the following sections:

For definitions of GC cycles and operations, see Garbage collection. For definitions of GC increments, see GC increments and interleaving.

The logs record when GC cycles and their increments start and end, and list the GC operations that run within these increments to manage or reclaim memory. You can also determine which type of event triggered the cycle or increment, and the amount of memory available to your application before and after processing.

"},{"location":"vgclog/#initialization","title":"Initialization","text":"

The log begins by recording the configuration of the Eclipse OpenJ9\u2122 runtime virtual environment (VM) and details of the GC configuration(GC). The configuration is recorded by using child elements of the <initialized> element, for example:

\n<initialized id=\"1\" timestamp=\"2020-10-18T13:27:07.691\">\n  <attribute name=\"gcPolicy\" value=\"-Xgcpolicy:gencon\" />\n  <attribute name=\"maxHeapSize\" value=\"0x40000000\" />\n  <attribute name=\"initialHeapSize\" value=\"0x40000000\" />\n  <attribute name=\"compressedRefs\" value=\"true\" />\n  <attribute name=\"compressedRefsDisplacement\" value=\"0x0\" />\n  <attribute name=\"compressedRefsShift\" value=\"0x0\" />\n  <attribute name=\"pageSize\" value=\"0x1000\" />\n  <attribute name=\"pageType\" value=\"not used\" />\n  <attribute name=\"requestedPageSize\" value=\"0x1000\" />\n  <attribute name=\"requestedPageType\" value=\"not used\" />\n  <attribute name=\"gcthreads\" value=\"4\" />\n  <attribute name=\"gcthreads Concurrent Mark\" value=\"1\" />\n  <attribute name=\"packetListSplit\" value=\"1\" />\n  <attribute name=\"cacheListSplit\" value=\"1\" />\n  <attribute name=\"splitFreeListSplitAmount\" value=\"1\" />\n  <attribute name=\"numaNodes\" value=\"0\" />\n  <system>\n    <attribute name=\"physicalMemory\" value=\"100335456256\" />\n    <attribute name=\"numCPUs\" value=\"28\" />\n    <attribute name=\"architecture\" value=\"amd64\" />\n    <attribute name=\"os\" value=\"Linux\" />\n    <attribute name=\"osVersion\" value=\"3.10.0-1160.el7.x86_64\" />\n  </system>\n  <vmargs>\n    <vmarg name=\"-Dfile.encoding=bestfit936\" />\n    ...\n    <vmarg name=\"-Xms1024m\" />\n    <vmarg name=\"-Xmx1024m\" />\n    ...\n    <vmarg name=\"-Xverbosegclog:verbosegc.xml\" />\n    ...\n  </vmargs>\n</initialized>\n

The first set of <attribute> elements records the configuration of the garbage collector, such as the GC policy type, configuration of the Java object heap, and the number of threads that are used for garbage collection. For example, the GCThreads attribute records that the garbage collector is configured to use four threads.

The <system> section records information about the operating system and available hardware, such as the physical memory, number of CPUs, and operating system type and version. In the example, the VM is running on Linux\u00ae amd64 V3.10 and has access to 28 CPUs and over 100 GB.

The <vmargs> section records any VM configuration command-line options (VM arguments) that are specified. The following types of options are recorded:

These command-line options can be set by using the command line, or by passing a manifest file, options file, or environment variable to the VM.

After the configurations are recorded in the Initialization section, the verbose GC log begins recording GC activities and details.

"},{"location":"vgclog/#gc-cycles","title":"GC cycles","text":"

The start of a GC cycle is recorded by the <cycle-start> XML element. The trigger for the start of a GC cycle is captured in a preceding element to the <cycle-start> element. A GC cycle or GC increment is triggered for one of the following reasons:

The following XML structure is an example of the verbose GC logs that are generated from the Generational Concurrent GC policy (-Xgcpolicy:gencon). In this example, the lines are indented to help illustrate the flow and attributes and some child elements are omitted for clarity:

    <exclusive-start/>\n\n      <af-start/>\n\n        <cycle-start/>\n\n          <gc-start>\n\n            <mem-info>\n\n              <mem/>\n\n            </mem-info>\n\n          </gc-start>\n\n          <allocation-stats/>\n\n              <gc-op/>\n\n          <gc-end>\n\n            <mem-info>\n\n              <mem/>\n\n            </mem-info>\n\n          </gc-end>\n\n        <cycle-end/>\n\n        <allocation-satisfied/>\n\n      <af-end/>\n\n    <exclusive-end/>\n

Some elements serve as markers for starting and ending parts of the GC cycle and do not contain child elements, while other elements do contain child elements. In this example, the <af-start/>, <cycle-start/>, <cycle-end/>, <allocation-satisfied/>, and <af-end/> XML elements are empty and contain only attributes. All other XML elements contain child XML elements, which are omitted from this simplified example. For detailed examples of log output for a specific cycle, see Log examples).

"},{"location":"vgclog/#gc-increments-and-interleaving","title":"GC increments and interleaving","text":"

Some GC cycle types are run in piecemeal blocks of operations called GC increments. Using GC increments reduces pause times by enabling blocks of operations or operation steps to interleave with operations or operation steps from other types of cycle.

For example, consider the garbage collector for the gencon policy, which uses partial cycles and global cycles. The partial cycle consists of just 1 GC operation, scavenge, that runs on the nursery area during a stop-the-world (STW) pause. However, the gencon global cycle, which runs when the tenure area is close to full, is split into three increments. The initial and final global cycle increments run during a relatively short STW pause. The intermediate global cycle increment, which consists of the majority of the GC cycle's work, runs its GC operations concurrently.

Splitting the global cycle operations into these increments reduces pause times by running most of the GC operations concurrently with application threads. The gencon global cycle's concurrent increment is paused when a gencon partial GC cycle is triggered and resumes when the partial cycle, or multiple partial cycles, complete. In this way, a global cycle can progress while other types of cycle are run by pausing and resuming the concurrent work. In some policies, concurrent operations are split further into multiple concurrent increments for better control of progress of the concurrent operation.

You can see this interleaving of the increments in the verbose GC log. The following table illustrates how the interleaving of the gencon policy's partial scavenge and global cycles appears in the logs. Line numbers of an example gencon policy's verbose GC log are displayed, alongside columns that show the status of each cycle that is recorded in the logs. (for clarity, not all GC activities are listed):

Table showing how the `gencon` policy's global and partial scavenge cycles, which interleave with each other, are recorded in an example log. Example log line number `gencon` global GC cycle status recorded in log `gencon` partial GC cycle status recorded in log 1-87 Initialization section of the logs 87-51676 - series of partial scavenge cycles start and finish 51677 global cycle's trigger and target logged - 51680 STW pause starts - 51683 global cycle starts - 51684 STW pause ends - 518685 blank line in logs. (Concurrent increment runs) - 51686 (concurrent increment paused) STW pause starts 51690 (concurrent increment paused) partial scavenge cycle starts 51691 (concurrent increment paused) partial scavenge increment runs 51730 (concurrent increment paused) partial cycle ends 51733 (concurrent increment resumes) STW pause ends 51734 blank line in logs. (Concurrent increment resumes) - 51735 STW pause starts - 51741 final global increment logged - 51793 global cycle ends - 51795 STW pause ends -

Note: Zero, one, or multiple GC cycles might run between the start and end of a gencon global GC cycle.

The XML elements and attribute values that define operations and increments of a particular cycle are specific to the policy and type of cycle. To follow how the different cycle's increments interleave in a log, you can locate the elements and attributes that record the increments and operations that belong to a particular type of cycle. For example, for the gencon policy, you can locate the start of the intermediate, concurrent increment of the global cycle by searching for the <concurrent-kickoff> element.

For more information about the XML elements and attribute values that are used for a particular type of cycle for a particular policy, and examples of log output, see Log examples.

You can determine the GC increments and operations that are associated with a particular instance of a cycle by using the contextid and id attributes:

  1. Determine the ID of the GC cycle: find the value of the id attribute of the <cycle-start> element that denotes the start of the GC cycle. Note: the id attribute increases incrementally with each GC event.
  2. Search for the contextid attribute values that match the GC cycle's ID. All GC increments, operations, and concurrent events that are associated with a particular cycle have a contextid attribute whose value matches the GC cycle's ID.
"},{"location":"vgclog_examples/","title":"Log examples","text":""},{"location":"vgclog_examples/#log-examples","title":"Log examples","text":"

To help you understand how garbage collection (GC) processes memory for your application and how these processes are recorded, a number of annotated log examples are provided from different GC policies. Each example covers a particular type of cycle from a particular policy. By following the examples, you can learn how to interpret the XML elements in a log.

"},{"location":"vgclog_examples/#gencon-examples","title":"gencon examples","text":"

The gencon policy uses two types of cycle; a partial GC cycle and a global GC cycle. By default, the partial GC cycle runs a stop-the-world (STW) scavenge operation. On specific platforms, gencon can run a concurrent scavenge operation (-Xgc:concurrentScavenge) instead, if enabled at run time.

The start of a gencon cycle is recorded in the log by the following elements and attributes:

Table showing types of gencon cycle along with the corresponding trigger reason and XML elements for each type. GC cycle Value of type attribute of the <cycle-start> and <cycle-end>elements Element that logs the cycle trigger Trigger reason Global global <concurrent-kickoff> Low free memory tenure area threshold reached. Cycle trigger element is located before the <cycle-start> element. Partial scavenge <af-start> Allocation failure. Cycle trigger element is located before the <cycle-start> element.

You can use the type attribute of the <gc-start> and <gc-end> elements to locate a particular cycle. You can also locate a particular type of cycle by searching for the element that records the cycle trigger, which is located before the <cycle-start> element.

You can analyze the increments and operations that are associated with a particular type of cycle by locating and interpreting the elements in the following table:

Table showing increments and operations that are associated with the gencon partial scavenge and global cycles. GC process Elements that log the start and end of the event Details GC cycle <cycle-start>, <cycle-end> The start and end of a GC cycle. GC STW increment <gc-start>, <gc-end> The start and end of a GC increment that begins with a pause. GC STW increment <concurrent-kickoff> The start of the initial GC increment of the global concurrent cycle that begins the initial mark operation. GC STW increment <concurrent-global-final> The start of the final GC increment of the global concurrent cycle that executes the final collection. GC operations and suboperations <gc-op> A GC operation such as mark or sweep, or a suboperation such as class unload.

Note: For more information about the XML structure of GC cycles, see GC cycles. For more information about GC cycle increments, see GC increments and interleaving.

The following examples use log excerpts to show how the different types of gencon cycle are logged.

"},{"location":"vgclog_examples/#scavenge-partial-gc-cycle","title":"Scavenge partial GC cycle","text":"

The following example is taken from a gencon log. The output is broken down into sections with supporting text to explain the GC processing that is taking place.

To search for a scavenge partial GC cycle, you can search for the type attribute value scavenge in cycle-start and cycle-end elements, or search for the <af> element that logs the allocation failure trigger.

By default, the gencon partial GC cycle runs by using a single STW pause. The cycle performs only one operation, a scavenge operation, which runs only on the nursery area. The cycle consists of a single GC increment, which is labeled by using the elements that are shown in the following table:

Table showing the gencon default partial scavenge cycle's GC increment and corresponding XML elements. GC operation GC increment STW or concurrent XML element of GC increment Details scavenge single STW <gc-start>, <gc-end> Contains detailed information about copied objects and the weak roots processing operation

The scavenge partial GC cycle follows a general structure in the verbose GC log as shown. Some elements are omitted for clarity:

\n<exclusive-start/>          (STW Pause starts)\n\n<af-start/>                 (allocation failure trigger recorded)\n\n<cycle-start/>              (scavenge cycle starts)\n\n<gc-start>                  (scavenge cycle increment starts)\n\n<mem-info>                  (memory status before operation)\n\n<mem></mem>                 (status of different areas of heap)\n\n</mem-info>\n\n</gc-start>\n\n<allocation-stats/>         (Snapshot of how memory was divided up between\n                            ... application threads before current cycle started)\n\n<gc-op> \u201cscavenge\"</gc-op>  (scavenge operation completed)\n\n<gc-end>                    (scavenge cycle increment ends)\n\n<mem-info>                  (memory status after operation)\n\n<mem></mem>                 (status of different areas of heap)\n\n</mem-info>\n\n</gc-end>\n\n</cycle-end>                (scavenge cycle ends)\n\n<allocation-satisfied/>     (required allocation has been achieved)\n\n<af-end/>\n\n<exclusive-end>             (STW for scavenge cycle ends)\n...\n\n

The first activity in the cycle is recorded by an <exclusive-start> element, which indicates the start of the STW pause. Application (or mutator) threads are halted to give the garbage collector exclusive access to the Java\u2122 object heap:

<!-- Start of gencon scavenge partial GC cycle example -->\n\n<exclusive-start id=\"12392\" timestamp=\"2020-10-18T13:35:45.000\" intervalms=\"406.180\">\n  <response-info timems=\"0.070\" idlems=\"0.070\" threads=\"0\" lastid=\"00000000013D6900\" lastname=\"LargeThreadPool-thread-68\" />\n</exclusive-start>\n

The <af-start> element indicates that the cycle was triggered by an allocation failure in the nursery (type=\"nursery\") area of the heap:

<af-start id=\"12393\" threadId=\"00000000013D7280\" totalBytesRequested=\"8200\" timestamp=\"2020-10-18T13:35:45.000\" intervalms=\"418.233\" type=\"nursery\" />\n

The <cycle-start> element marks the start of the cycle. The attribute type=\"scavenge\" confirms that this activity is a scavenge partial GC cycle:

<cycle-start id=\"12394\" type=\"scavenge\" contextid=\"0\" timestamp=\"2020-10-18T13:35:45.000\" intervalms=\"418.231\" />\n

Most elements are labeled with an id attribute that increases in value incrementally, atimestamp attribute, and a contextid attribute. All elements that record GC increments and operations that are associated with a particular cycle have a contextid value that matches the id value of the cycle. The <cycle-start> element of this example cycle has an id=\"12394\", so all subsequent elements that have a contextid=\"4\", such as the <gc-start> increment element and the <gc-op> operation element, are associated with this particular example cycle.

The <gc-start> element records the first GC increment. In this <gc-start> section, you can find information about the amount of memory available (<mem-info>) and where it is located in the Java object heap.

The memory snapshot within the <gc-start> element is taken before the scavenge operation and can be compared with a similar snapshot that is taken afterward to understand the effect on the heap.

<gc-start id=\"12395\" type=\"scavenge\" contextid=\"12394\" timestamp=\"2020-10-18T13:35:45.000\">\n  <mem-info id=\"12396\" free=\"414960320\" total=\"1073741824\" percent=\"38\">\n    <mem type=\"nursery\" free=\"0\" total=\"268435456\" percent=\"0\">\n      <mem type=\"allocate\" free=\"0\" total=\"241565696\" percent=\"0\" />\n      <mem type=\"survivor\" free=\"0\" total=\"26869760\" percent=\"0\" />\n    </mem>\n    <mem type=\"tenure\" free=\"414960320\" total=\"805306368\" percent=\"51\">\n      <mem type=\"soa\" free=\"374694592\" total=\"765040640\" percent=\"48\" />\n      <mem type=\"loa\" free=\"40265728\" total=\"40265728\" percent=\"100\" />\n    </mem>\n    <remembered-set count=\"21474\" />\n  </mem-info>\n</gc-start>\n

The following statements describe the object heap memory allocation at the start of the increment:

The next element <allocation-stats> shows a snapshot, which was taken before the cycle started, of how memory was divided up between application threads. In this example, the thread that used the most memory was LargeThreadPool-thread-79.

<allocation-stats totalBytes=\"235362176\" >\n  <allocated-bytes non-tlh=\"32880\" tlh=\"235329296\" />\n  <largest-consumer threadName=\"LargeThreadPool-thread-79\" threadId=\"00000000013F0C00\" bytes=\"6288544\" />\n</allocation-stats>\n

The scavenge GC operation is recorded by the <gc-op> element; child elements record details about the operation. For example,

<gc-op id=\"12397\" type=\"scavenge\" timems=\"11.649\" contextid=\"12394\" timestamp=\"2020-10-18T13:35:45.012\">\n  <scavenger-info tenureage=\"7\" tenuremask=\"4080\" tiltratio=\"89\" />\n  <memory-copied type=\"nursery\" objects=\"154910\" bytes=\"6027440\" bytesdiscarded=\"394832\" />\n  <memory-copied type=\"tenure\" objects=\"16171\" bytes=\"562848\" bytesdiscarded=\"3064\" />\n  <ownableSynchronizers candidates=\"10838\" cleared=\"10824\" />\n  <references type=\"soft\" candidates=\"24\" cleared=\"0\" enqueued=\"0\" dynamicThreshold=\"16\" maxThreshold=\"32\" />\n  <references type=\"weak\" candidates=\"390\" cleared=\"269\" enqueued=\"269\" />\n  <references type=\"phantom\" candidates=\"1\" cleared=\"0\" enqueued=\"0\" />\n  <object-monitors candidates=\"132\" cleared=\"0\"  />\n</gc-op>\n

The <memory-copied> element indicates that 5.75 MB (6,027,440B) of reachable objects were moved by the scavenge operation from the allocate space to the survivor space in the nursery area, and 0.54 MB(562,848 B) were moved to the tenure area.

The <scavenger-info> element shows that the tenure age is set to 7. Any object in the allocate space with an age less than or equal to 7 is copied to the survivor space during this scavengeoperation. Any object that is copied between the allocate and survivor areas more than 7 times is moved to the tenure area.

For more information about how the scavenge operation acts on the Java object heap, see GC processing.

The end of the increment is recorded with <gc-end> and provides another snapshot of memory allocation on the heap, similar to <gc-start>.

<gc-end id=\"12398\" type=\"scavenge\" contextid=\"12394\" durationms=\"11.785\" usertimems=\"46.278\" systemtimems=\"0.036\" stalltimems=\"0.145\" timestamp=\"2020-10-18T13:35:45.012\" activeThreads=\"4\">\n  <mem-info id=\"12399\" free=\"649473560\" total=\"1073741824\" percent=\"60\">\n    <mem type=\"nursery\" free=\"235142120\" total=\"268435456\" percent=\"87\">\n      <mem type=\"allocate\" free=\"235142120\" total=\"241565696\" percent=\"97\" />\n      <mem type=\"survivor\" free=\"0\" total=\"26869760\" percent=\"0\" />\n    </mem>\n    <mem type=\"tenure\" free=\"414331440\" total=\"805306368\" percent=\"51\" macro-fragmented=\"0\">\n      <mem type=\"soa\" free=\"374065712\" total=\"765040640\" percent=\"48\" />\n      <mem type=\"loa\" free=\"40265728\" total=\"40265728\" percent=\"100\" />\n    </mem>\n    <pending-finalizers system=\"0\" default=\"0\" reference=\"269\" classloader=\"0\" />\n    <remembered-set count=\"13792\" />\n  </mem-info>\n</gc-end>\n

The Java object heap memory allocation at the end of the increment is as follows:

The scavenge operation successfully reclaimed memory in the allocate space of the nursery area by copying objects from the allocate space into the survivor space of the nursery area, and copying objects from the survivor space into the tenure area.

The cycle ends (<cycle-end>). The following <allocation-satisfied> element indicates that the allocation request that caused the allocation failure can now complete successfully. The STW pause ends with the <exclusive-end> element:

<cycle-end id=\"12400\" type=\"scavenge\" contextid=\"12394\" timestamp=\"2020-10-18T13:35:45.012\" />\n<allocation-satisfied id=\"12401\" threadId=\"00000000013D6900\" bytesRequested=\"8200\" />\n<af-end id=\"12402\" timestamp=\"2020-10-18T13:35:45.012\" threadId=\"00000000013D7280\" success=\"true\" from=\"nursery\"/>\n<exclusive-end id=\"12403\" timestamp=\"2020-10-18T13:35:45.012\" durationms=\"12.319\" />\n\n<!-- End of gencon partial GC cycle example -->\n
"},{"location":"vgclog_examples/#summary","title":"Summary","text":"

Analyzing the structure and elements of this example log output shows that this example global cycle has the following characteristics:

"},{"location":"vgclog_examples/#concurrent-scavenge-partial-gc-cycle-non-default","title":"Concurrent scavenge partial GC cycle (non-default)","text":"

When concurrent scavenge mode is enabled, the partial GC cycle is run as a Concurrent Scavenge cycle. This partial GC cycle is divided into increments to enable the majority of the scavenge operation to run concurrently with running application (or mutator) threads. The concurrent increment can run while application threads run, and also while the intermediate concurrent increment of the global GC cycle runs. The interleaving of the concurrent scavenge partial GC cycle with the global cycle can be seen in the logs.

The following elements log the GC increments and operations of the concurrent scavenge partial GC cycle:

Table showing the gencon concurrent (non-default) partial scavenge cycle's GC increment and corresponding XML elements. GC operation GC increment STW or concurrent XML element of GC increment Details scavenge initial STW <gc-start>, <gc-end> Root scanning, reported as a single scavenge operation. scavenge intermediate concurrent <concurrent-start>, <concurrent-end> Live objects are traversed and evacuated (*copy forward*). Operation is reported as a scavenge operation. scavenge final STW <gc-start>, <gc-end> weak roots scanning, reported as a complex scavenge operation. <gc-op> contains specific details for each of the weak root groups.

To search for a concurrent scavenge partial GC cycle, you can search for the type attribute value scavenge in cycle-start and cycle-end elements, or search for the <af> element that logs the allocation failure trigger.

You can locate the concurrent scavenge partial cycle's concurrent increment by searching for <concurrent-start> and <concurrent-end>. The global cycle's intermediate concurrent increment, which can run at the same time, is not logged by an element, but begins immediately after application threads are restarted following the <cycle-start type=\"global\"/> element. For more information about the global cycle's intermediate concurrent increment, see gencon global GC cycle. For more information about GC increments, see GC increments and interleaving.

"},{"location":"vgclog_examples/#gencon-global-gc-cycle","title":"gencon global GC cycle","text":"

The following example shows how a global GC cycle is recorded in a gencon policy verbose GC log. The output is broken down into sections with supporting text to explain the GC processing that is taking place.

The global GC cycle runs when the tenure area is close to full, which typically occurs after many partial cycles. As such, the output can be found part way down a full log. For more information about the GC initialization section, see Initialization . For an example log output for a gencon partial cycle, see Scavenge partial GC cycle.

The global GC cycle is split into three increments, as shown in GC increments and interleaving. Splitting the cycle operations into the following increments reduces pause times by running the majority of the GC work concurrently. The concurrent increment pauses when a partial GC cycle is triggered and resumes after the partial cycle, or multiple cycles, finish. The interleaving of partial GC cycles with the global cycle's intermediate concurrent increment can be seen in the following gencon global GC cycle log output. A single partial GC cycle is logged between the initial and final increments of the global cycle.

To search for a global cycle, you can search for the type attribute value global in cycle-start and cycle-end elements, or search for the element that logs the initial concurrent increment, <concurrent-kickoff>.

The following elements log the GC increments and operations of the global GC cycle:

Table showing the gencon global cycle's GC increment and corresponding XML elements. GC operation GC increment STW or concurrent XML element of GC increment Details n/a - initiates cycle initial STW <concurrent-kickoff> No <gc-op> is logged. This increment just initiates the concurrent mark increment. concurrent mark intermediate concurrent none <concurrent-trace-info> records the progress of the concurrent mark increment. final collection final STW <concurrent-global-final> The increment is typically triggered when a card cleaning threshold is reached. The completion of a tracing phase can also trigger the increment. Operations include a final concurrent mark, a sweep, and an optional class unload and compact.

The global GC cycle follows a general structure in the verbose GC log. Some child elements are omitted for clarity. Multiple partial GC cycles can start and finish between the start and end of a global GC cycle. In the following example, the structure includes a single partial GC cycle within the global cycle:

\n<concurrent-kickoff/>       (global cycle 1st increment recorded)\n\n<exclusive-start/>          (STW pause starts)\n\n<cycle-start/>              (global cycle starts)\n\n<exclusive-end/>            (STW pause ends)\n\n(mutator threads running, global cycle concurrent increment running concurrently)\n\n\n<exclusive-start/>          (STW for partial GC cycle starts)\n\n\n...                         (partial GC cycle starts and completes)\n\n\n<exclusive-end/>            (STW for partial GC cycle ends)\n\n(mutator threads running, global cycle concurrent increment running concurrently)\n\n<exclusive-start/>          (STW pause starts)\n\n<concurrent-global-final/>  (global cycle final increment recorded)\n\n<gc-start/>                 (global cycle final increment starts)\n\n<allocation-stats/>         (Snapshot of how memory was divided up between\n                            ... application threads before current cycle started)\n\n<mem-info>                  (memory status before operations)\n\n<mem></mem>                 (status of different areas of heap)\n\n</mem-info>\n\n</gc-start>\n\n<gc-op> \u201ctype=rs-scan\"</gc-op>        (remembered set scan completed)\n\n<gc-op>\u201dtype=card-cleaning\" </gc-op>  (card cleaning completed)\n\n<gc-op> \u201ctype=mark\u201d</gc-op>           (final mark operation and weak roots processing completed)\n\n<gc-op> \u201ctype=classunload\u201d</gc-op>    (class unload operation completed)\n\n<gc-op \u201dtype=sweep\u201d />                (sweep operation completed)\n\n<gc-end>                     (global cycle final increment ends)\n\n<mem-info>                   (memory status after operations)\n\n<mem></mem>                  (status of different areas of heap)\n\n</mem-info>\n\n</gc-end>\n\n</cycle-end>                 (global cycle ends)\n\n<exclusive-end>              (STW pause ends)\n\n<exclusive-start>            (STW pause starts)\n...\n\n

The first activity in the cycle is recorded by a <concurrent-kickoff> element, which records the start of the first of three increments that make up a gencon global GC cycle. The <concurrent-kickoff> element records the following information:

<concurrent-kickoff id=\"12362\" timestamp=\"2020-10-18T13:35:44.341\">\n\n<kickoff reason=\"threshold reached\" targetBytes=\"239014924\" thresholdFreeBytes=\"33024922\" remainingFree=\"32933776\" tenureFreeBytes=\"42439200\" nurseryFreeBytes=\"32933776\" />\n\n</concurrent-kickoff>\n

For this example, the remainingFree bytes value of 31.4 MB (32,933,776B) is approaching the thresholdFreeBytes value of 31.5 MB (33,024,922B) so a global cycle is triggered.

This cycle aims to trace 228 MB (239,014,924B) during the concurrent increment. If the concurrent increment is interrupted by a card cleaning threshold value before it traces all 228 MB, the final STW increment completes the tracing during the STW pause.

Note: To analyze specific parts of a cycle, you can search for the elements that mark a specific increment of the cycle. For example, you can search for the element to locate the final increment of the gencon global cycle. See the details of a particular cycle, such as the gencon global GC cycle, to determine the element names for particular STW or concurrent GC increments or operations.

The next element recorded in the log, the <exclusive-start>element, records the start of an STW pause:

<exclusive-start id=\"12363\" timestamp=\"2020-10-18T13:35:44.344\" intervalms=\"342.152\">\n\n<response-info timems=\"0.135\" idlems=\"0.068\" threads=\"3\" lastid=\"00000000015DE600\" lastname=\"LargeThreadPool-thread-24\" />\n\n</exclusive-start>\n

The following <gc-start> element records details of the start of a new cycle.

<cycle-start id=\"12364\" type=\"global\" contextid=\"0\" timestamp=\"2020-10-18T13:35:44.344\" intervalms=\"516655.052\" />\n

The type attribute records the cycle as a global cycle. The contextid of the cycle is, which indicates that all GC events that are associated with this cycle are tagged in relation to the id of this cycle. In particular, all subsequent elements that are associated with this particular example cycle have a contextid value equal to the <cycle-start> id attribute value of \u201c12634\u201d.

The next element in the log is <exclusive-end>, which records the end of the STW pause:

<exclusive-end id=\"12365\" timestamp=\"2020-10-18T13:35:44.344\" durationms=\"0.048\" />\n

The operations and suboperations of the second increment of the gencon global cycle are now running concurrently.

The next section of the logs records an STW pause that is associated with an allocation failure. The <cycle-start> element that follows this STW pause indicates that the cycle is a scavenge cycle, which is the partial GC cycle that is used by the gencon GC:

...\n<cycle-start id=\"12368\" type=\"scavenge\" contextid=\"0\" timestamp=\"2020-10-18T13:35:44.582\" intervalms=\"580.047\" />\n...\n

Subsequent elements have a contextid=\u201c12368\u201d, which matches the id of this new scavengecycle. For more information about how this cycle is recorded in the logs, see Scavenge partial GC cycle.

The operations and suboperations of the second, concurrent increment of the gencon global cycle are paused while the STW scavenge operation is running, and resume when the STW pause finishes.

After the partial GC cycle completes and the STW pause finishes, the log records a new STW pause, which is triggered to enable the final gencon global GC increment to run. This final increment finishes marking the nursery area and completes the global cycle. The <exclusive-start> element is followed by a <concurrent-global-final> element, which logs the beginning of this final increment (and by implication, the end of the second increment).

<exclusive-start id=\"12378\" timestamp=\"2020-10-18T13:35:44.594\" intervalms=\"12.075\">\n\n<response-info timems=\"0.108\" idlems=\"0.040\" threads=\"3\" lastid=\"00000000018D3800\" lastname=\"LargeThreadPool-thread-33\" />\n\n</exclusive-start>\n\n<concurrent-global-final id=\"12379\" timestamp=\"2020-10-18T13:35:44.594\" intervalms=\"516905.029\" >\n\n<concurrent-trace-info reason=\"card cleaning threshold reached\" tracedByMutators=\"200087048\" tracedByHelpers=\"12164180\" cardsCleaned=\"4966\" workStackOverflowCount=\"0\" />\n\n</concurrent-global-final>\n

The reason attribute of the <concurrent-trace-info> child element indicates that this final STW increment of the global cycle was triggered because a card-cleaning threshold was reached. The concurrent tracing was stopped prematurely and the targetBytes concurrent tracing target, recorded at the cycle start by <concurrent-kickoff>, was not achieved concurrently. If the concurrent tracing completes without interruption, the <concurrent-trace-info element logs reason=tracing completed.

In the next section that begins with the gc-start element, you can find information about the amount of memory available (<mem-info>) and where it is located in the java object heap. This snapshot is taken before the final increment's operations and suboperations are run and can be compared with a similar snapshot that is taken afterward to understand the effect on the heap. The child element attribute values of the<mem> and <mem-info> elements indicate the status of the memory.

Note: You can double check that the increment is associated with the GC global cycle in the example by checking the contextid attribute value matches the id=12364 attribute value of the cycle's element.

<gc-start id=\"12380\" type=\"global\" contextid=\"12364\" timestamp=\"2020-10-18T13:35:44.594\">\n\n<mem-info id=\"12381\" free=\"277048640\" total=\"1073741824\" percent=\"25\">\n\n<mem type=\"nursery\" free=\"234609440\" total=\"268435456\" percent=\"87\">\n\n<mem type=\"allocate\" free=\"234609440\" total=\"241565696\" percent=\"97\" />\n\n<mem type=\"survivor\" free=\"0\" total=\"26869760\" percent=\"0\" />\n\n</mem>\n\n<mem type=\"tenure\" free=\"42439200\" total=\"805306368\" percent=\"5\">\n\n<mem type=\"soa\" free=\"2173472\" total=\"765040640\" percent=\"0\" />\n\n<mem type=\"loa\" free=\"40265728\" total=\"40265728\" percent=\"100\" />\n\n</mem>\n\n<pending-finalizers system=\"0\" default=\"0\" reference=\"405\" classloader=\"0\" />\n\n<remembered-set count=\"17388\" />\n\n</mem-info>\n\n</gc-start>\n\n<allocation-stats totalBytes=\"827488\" >\n\n<allocated-bytes non-tlh=\"96\" tlh=\"827392\" />\n\n<largest-consumer threadName=\"LargeThreadPool-thread-68\" threadId=\"00000000013D6900\" bytes=\"65632\" />\n\n</allocation-stats>\n

The next element <allocation-stats> shows a snapshot of how memory was divided up between application threads before the current cycle started. In this example, the thread that used the most memory was LargeThreadPool-thread-68.

For this example, at the start of this GC increment, the tenure area is low on free memory, as expected. 25% of the total heap is available as free memory, which is split between the following areas of the heap:

The <gc-op> elements and their child elements contain information about the operations and suboperations in the increment. The final increment of the gencon global cycle consists of multiple operations, each logged with a <gc-op> element. The type of operation is shown by the <gc-op> type attribute. The final increment of the example log runs five types of operation:

  1. rs-scan
  2. card-cleaning
  3. mark
  4. classunload
  5. sweep

Note: The final increment of a gencon global cycle can include an optional compact suboperation.

For more information about the different types of GC operation, see GC operations.

<gc-op id=\"12382\" type=\"rs-scan\" timems=\"3.525\" contextid=\"12364\" timestamp=\"2020-10-18T13:35:44.598\">\n\n<scan objectsFound=\"11895\" bytesTraced=\"5537600\" workStackOverflowCount=\"0\" />\n\n</gc-op>\n\n<gc-op id=\"12383\" type=\"card-cleaning\" timems=\"2.910\" contextid=\"12364\" timestamp=\"2020-10-18T13:35:44.601\">\n\n<card-cleaning cardsCleaned=\"3603\" bytesTraced=\"5808348\" workStackOverflowCount=\"0\" />\n\n</gc-op>\n\n<gc-op id=\"12384\" type=\"mark\" timems=\"6.495\" contextid=\"12364\" timestamp=\"2020-10-18T13:35:44.607\">\n\n<trace-info objectcount=\"1936\" scancount=\"1698\" scanbytes=\"61200\" />\n\n<finalization candidates=\"389\" enqueued=\"1\" />\n\n<ownableSynchronizers candidates=\"5076\" cleared=\"523\" />\n\n<references type=\"soft\" candidates=\"18420\" cleared=\"0\" enqueued=\"0\" dynamicThreshold=\"32\" maxThreshold=\"32\" />\n\n<references type=\"weak\" candidates=\"19920\" cleared=\"114\" enqueued=\"60\" />\n\n<references type=\"phantom\" candidates=\"671\" cleared=\"50\" enqueued=\"50\" />\n\n<stringconstants candidates=\"40956\" cleared=\"109\" />\n\n<object-monitors candidates=\"182\" cleared=\"51\" />\n\n</gc-op>\n\n<gc-op id=\"12385\" type=\"classunload\" timems=\"1.607\" contextid=\"12364\" timestamp=\"2020-10-18T13:35:44.609\">\n\n<classunload-info classloadercandidates=\"425\" classloadersunloaded=\"6\" classesunloaded=\"2\" anonymousclassesunloaded=\"1\" quiescems=\"0.000\" setupms=\"1.581\" scanms=\"0.019\" postms=\"0.007\" />\n\n</gc-op>\n\n<gc-op id=\"12386\" type=\"sweep\" timems=\"9.464\" contextid=\"12364\" timestamp=\"2020-10-18T13:35:44.618\" />\n

The end of the increment is recorded with <gc-end> and provides another snapshot of memory in the heap, similar to <gc-start>.

<gc-end id=\"12387\" type=\"global\" contextid=\"12364\" durationms=\"24.220\" usertimems=\"86.465\" systemtimems=\"0.000\" stalltimems=\"2.846\" timestamp=\"2020-10-18T13:35:44.618\" activeThreads=\"4\">\n\n<mem-info id=\"12388\" free=\"650476504\" total=\"1073741824\" percent=\"60\">\n\n<mem type=\"nursery\" free=\"235516088\" total=\"268435456\" percent=\"87\">\n\n<mem type=\"allocate\" free=\"235516088\" total=\"241565696\" percent=\"97\" />\n\n<mem type=\"survivor\" free=\"0\" total=\"26869760\" percent=\"0\" />\n\n</mem>\n\n<mem type=\"tenure\" free=\"414960416\" total=\"805306368\" percent=\"51\" micro-fragmented=\"98245682\" macro-fragmented=\"0\">\n\n<mem type=\"soa\" free=\"374694688\" total=\"765040640\" percent=\"48\" />\n\n<mem type=\"loa\" free=\"40265728\" total=\"40265728\" percent=\"100\" />\n\n</mem>\n\n<pending-finalizers system=\"1\" default=\"0\" reference=\"515\" classloader=\"0\" />\n\n<remembered-set count=\"13554\" />\n\n</mem-info>\n\n</gc-end>\n

60% of the heap now contains free memory as a result of the final global cycle increment, which is split between the following areas of the heap:

Note: The global GC cycle runs to reclaim memory in the tenure area. The freeing up of memory in the nursery area is achieved by using the partial GC cycle. For more information, see gencon policy (default).

After the final increment of the global cycle completes, the global cycle ends and the STW pause ends, as shown in the following output:

<cycle-end id=\"12389\" type=\"global\" contextid=\"12364\" timestamp=\"2020-10-18T13:35:44.619\" />\n\n<exclusive-end id=\"12391\" timestamp=\"2020-10-18T13:35:44.619\" durationms=\"24.679\" />\n
"},{"location":"vgclog_examples/#summary_1","title":"Summary","text":"

Analyzing the structure and elements of this example log output shows that this example global cycle has the following characteristics:

"},{"location":"vgclog_examples/#balanced-examples","title":"balanced examples","text":"

The balanced policy (-Xgcpolicy:balanced) uses two types of cycle to perform GC; a partial GC cycle and a global GC mark cycle. The policy might also run a third type of cycle, which is a global cycle, to reclaim memory after an allocation failure that results from tight memory conditions.

For more information about the cycles used in a particular policy, see GC policies.

The start of a balanced cycle is recorded in the log by the following elements and attributes:

Table showing types of balanced cycle, the corresponding trigger, and XML elements for each `type`. GC cycle or increment Value of type attribute of the cycle or increment elements Element that logs the cycle trigger Trigger reason partial cycle partial gc <allocation-taxation> Allocation taxation threshold reached. global mark cycle global mark phase <allocation-taxation> Allocation taxation threshold reached. global mark STW subincrement of global mark cycle mark increment n/a Allocation taxation threshold reached global mark concurrent subincrement of global mark cycle GMP work packet processing n/a Allocation taxation threshold reached global cycle global garbage collect <af-start> (or <sys-start reason=\"explicit\"> if triggered explicitly) Allocation failure. Occurs under tight memory conditions. Cycle runs rarely.

To locate a particular type of cycle, you can search for the type attribute of the <cycle-start> and <cycle-end> elements.

When memory in the Java object heap reaches a memory threshold, called an allocation taxation threshold, a balanced partial GC cycle, balanced global mark cycle, or balanced global mark cycle increment, is triggered. If the available memory in the heap is low, the GC triggers a balanced global mark cycle, or a global mark cycle increment if the global mark cycle is in progress. Otherwise, the GC triggers a partial cycle.

Partial GC cycles, global mark cycles, and global GC cycles set the allocation taxation threshold at the end of their cycle or increment to schedule the next cycle or increment. For balanced cycles, the taxation on the mutator threads refers to pausing the mutator threads while GC work is run.

When a partial cycle ends, if the cycle is not run between global mark phase increments of a global mark cycle, and a global mark cycle is not scheduled as the next cycle, the allocation taxation threshold is set to trigger the next partial cycle when the eden space is full. Specifically, the allocation threshold is set to be equal to the size of the eden space.

If a partial cycle runs within a global mark cycle, or if a global mark cycle is scheduled as the next cycle, the allocation taxation threshold, set at the end of the partial cycle, is set to be smaller than the size of the eden space. Specifically, the allocation taxation threshold is set to be half the size of the eden space so that the next global mark cycle or global mark cycle increment has enough memory available in the eden space to run.

For more information about GC increments, see GC increments and interleaving.

You can analyze the increments and operations that are associated with a particular type of cycle by locating and interpreting the elements in the following table:

Table showing increments and operations that are associated with the balanced partial and global mark cycles GC process Elements that log the start and end of the event> Details GC cycle <cycle-start>,<cycle-end> The start and end of a GC cycle GC STW increment <gc-start><gc-end> The start and end of a GC increment or subincrement that begins with a STW pause. For example, a global mark phase global mark GC cycle increment or a partial GC cycle increment GC concurrent increment <concurrent-start>, <concurrent-end> The start of the concurrent global mark phase work packet processing subincrements of the global mark cycle GC operations and phases <gc-op> A GC operation such as mark or sweep, or a suboperation such as class unload.

For more information about the XML structure of GC cycles, see GC cycles.

The following sections use log excerpts to show how the different GC processes are logged.

"},{"location":"vgclog_examples/#balanced-partial-gc-cycle","title":"balanced partial GC cycle","text":"

The following example is taken from a balanced policy verbose GC log. The output is broken down into sections to explain the GC processing that is taking place.

To search for a balanced partial GC cycle, you can search for the type attribute value partial gc in <cycle-start> and <cycle-end> elements.

The partial GC cycle reclaims memory in the heap for the allocation of new objects by reducing the number of used regions. The partial GC cycle always reduces used regions in the eden space and might also reclaim memory from older regions. Multiple partial GC cycles often run in between global mark phase increments of the balanced global mark GC cycle.

All the operations in a partial GC cycle run during a single STW pause, as shown in the following table:

Table showing the balanced partial GC cycle operation and corresponding XML elements. GC operation GC increment STW or concurrent XML element of GC increment copy forward, and optionally class unload, sweep, and compact single STW <gc-start>, <gc-end>

The following general structure shows a balanced partial GC cycle. Some child elements are omitted for clarity:

<exclusive-start/>                       (STW pause starts)\n\n<allocation-taxation/>                   (memory threshold trigger recorded)\n\n<cycle-start/>                            (partial cycle starts)\n\n<gc-start/>                             (partial  cycle increment starts)\n\n<mem-info>                            (memory status before operations)\n\n  <mem></mem>                         (status of different types of memory)\n\n</mem-info>         \n\n</gc-start>\n\n<allocation-stats/>                  (Snapshot of how memory was divided up between\n                                     ... application threads before current cycle started)\n\n<gc-op> type=\"copy forward\" </gc-op>    (copy forward operation completed)\n\n<gc-op> type=\"class unload\" </gc-op>    (class unload operation completed)\n\n<gc-op> type=\"sweep\" </gc-op>           (sweep operation completed)\n\n<gc-op> type=\"compact\" </gc-op>         (compact operation completed)\n\n<gc-end>                                (partial cycle increment ends)\n\n<mem-info>                            (memory status after operations)\n\n  <mem></mem>                         (status of different types of memory)\n\n</mem-info>         \n\n</gc-end>\n\n<cycle-end>                               (partial cycle ends)\n\n<exclusive-end>                           (STW pause ends)\n

When the balanced partial GC cycle is triggered, the GC runs an STW pause. Application (or mutator) threads are halted to give the garbage collector exclusive access to the heap. The STW pause is recorded in the logs by the <exclusive-start> element.

<exclusive-start id=\"184\" timestamp=\"2021-02-26T11:11:42.310\" intervalms=\"3745.790\">\n  <response-info timems=\"3.138\" idlems=\"1.056\" threads=\"2\" lastid=\"00000000006EDE00\" lastname=\"RunDataWriter.1\" />\n</exclusive-start>\n

An allocation taxation threshold triggers a balanced partial GC cycle. The logs record this trigger reason by using the<allocation-taxation> element.

<allocation-taxation id=\"185\" taxation-threshold=\"2147483648\" timestamp=\"2021-02-26T11:11:42.311\" intervalms=\"3745.785\" />\n

Details about the start of the cycle are recorded by the <cycle-start> element. The cycle is recorded as a partial gc with an id=336. Any subsequent elements that are associated with this cycle have a contextid=186 to match the cycle id. You can use this contextid value to distinguish the partial GC cycle increment and operations from interleaving increments and operations of other balanced cycles, such as global mark cycles.

<cycle-start id=\"186\" type=\"partial gc\" contextid=\"0\" timestamp=\"2021-02-26T11:11:42.311\" intervalms=\"3745.805\" />\n\n

The partial cycle begins its only GC increment, recorded by using the <gc-start> element. You can understand the effect that the increment operations have on the heap by comparing snapshots of the memory that are taken at the start and the end of the increment. The child elements <mem-info> and <mem> of the <gc-start> and <gc-end> elements record the amount of memory available and where it is located in the heap.

<gc-start id=\"187\" type=\"partial gc\" contextid=\"186\" timestamp=\"2021-02-26T11:11:42.311\">\n  <mem-info id=\"188\" free=\"897581056\" total=\"4294967296\" percent=\"20\">\n    <mem type=\"eden\" free=\"0\" total=\"2147483648\" percent=\"0\" />\n    <arraylet-primitive objects=\"1\" leaves=\"4\" largest=\"4\" />\n    <remembered-set count=\"2749664\" freebytes=\"160705664\" totalbytes=\"171704320\" percent=\"93\" regionsoverflowed=\"1\" regionsstable=\"12\" regionsrebuilding=\"0\"/>\n  </mem-info>\n</gc-start>\n

As expected, at the start of this increment, the eden regions are full. 856 MB (897,581,056 B) of the total 4096 MB (4294,967,296 B) heap, equivalent to 20% of the heap, is available as free memory.

The status of the remembered set, a metastructure specific to Eclipse OpenJ9\u2122 generational garbage collectors, is reported by the <remembered-set> element. The remembered set metastructure keeps a record of any object references that cross different regions. Each region corresponds to a single remembered set.

The partial GC cycle uses and prunes the remembered set. The regionsoverflowed value records the number of regions that exceeded the non-object heap memory allocation that is reserved for the remembered set. The partial GC cycle cannot reclaim memory from these overflow regions. The partial GC cycle also cannot reclaim memory from any regions whose remembered set is being rebuilt by an increment of a global mark cycle that is in progress.

At the start of the partial GC cycle, the remembered set is using 93% of its available memory capacity, with 153.26 MB (160705664 B) available. The set consists of 2,749,664 cards and has one overflow region.

The following element, <allocation-stats>, records information about how memory was divided between application (or mutator) threads before the start of the current cycle. For this example, the thread Group1.Backend.CompositeBackend{Tier1}.7 was the largest consumer of memory.

<allocation-stats totalBytes=\"2146431360\" >\n  <allocated-bytes non-tlh=\"96417448\" tlh=\"2050013912\" arrayletleaf=\"0\"/>\n  <largest-consumer threadName=\"Group1.Backend.CompositeBackend{Tier1}.7\" threadId=\"00000000007E9300\" bytes=\"275750048\" />\n</allocation-stats>\n

The operations of the GC increment are run and details are recorded in the <gc-op> elements. The logs show that this increment begins with a copy forward operation followed by a class unload. Other balanced partial GC cycles can also include sweep and compact operations. For more information about the operations involved in balanced partial GC cycles, see GC Processing.

<gc-op id=\"189\" type=\"copy forward\" timems=\"400.637\" contextid=\"186\" timestamp=\"2021-02-26T11:11:42.713\">\n  <memory-copied type=\"eden\" objects=\"4434622\" bytes=\"119281928\" bytesdiscarded=\"1382272\" />\n  <memory-copied type=\"other\" objects=\"8847813\" bytes=\"244414264\" bytesdiscarded=\"6243176\" />\n  <memory-cardclean objects=\"1446970\" bytes=\"64143048\" />\n  <regions eden=\"512\" other=\"80\" />\n  <remembered-set-cleared processed=\"2435794\" cleared=\"887129\" durationms=\"8.667\" />\n  <finalization candidates=\"66\" enqueued=\"56\" />\n  <ownableSynchronizers candidates=\"256500\" cleared=\"78012\" />\n  <references type=\"soft\" candidates=\"153648\" cleared=\"0\" enqueued=\"0\" dynamicThreshold=\"22\" maxThreshold=\"32\" />\n  <references type=\"weak\" candidates=\"1266\" cleared=\"610\" enqueued=\"430\" />\n  <stringconstants candidates=\"9479\" cleared=\"0\"  />\n  <object-monitors candidates=\"13576\" cleared=\"13505\"  />\n</gc-op>\n<gc-op id=\"190\" type=\"classunload\" timems=\"0.010\" contextid=\"186\" timestamp=\"2021-02-26T11:11:42.713\">\n  <classunload-info classloadercandidates=\"179\" classloadersunloaded=\"0\" classesunloaded=\"0\" anonymousclassesunloaded=\"0\" quiescems=\"0.000\" setupms=\"0.010\" scanms=\"0.000\" postms=\"0.000\" />\n</gc-op>\n

The logs show that the copy forward operation acts on the entire eden space (512 regions), recorded as type=eden, and 80 older regions, which are recorded as type=other. 113.76 MB (119281928 B) of memory was copied from the eden space to 1st generation regions and 233.10 MB (244414264 B) of memory in non-eden regions was copied to the next generation of regions. The copy forward operation is followed by a class unload operation.

In some cases, a copy forward operation moves some regions by copying forward the objects in those regions, but only marks the objects in other regions. For example, the following log excerpt is taken from a different partial cycle, which corresponds to a contextid of 2049. The copy forward operation in the following example involves marking some regions and copying forward other regions.

<gc-op id=\"2052\" type=\"copy forward\" timems=\"649.059\" contextid=\"2049\" timestamp=\"2021-02-26T11:22:34.901\">\n  <memory-copied type=\"eden\" objects=\"95989\" bytes=\"7882704\" bytesdiscarded=\"501088\" />\n  <memory-copied type=\"other\" objects=\"2955854\" bytes=\"86854064\" bytesdiscarded=\"626024\" />\n  <memory-cardclean objects=\"1304\" bytes=\"56840\" />\n  <memory-traced type=\"eden\" objects=\"23392785\" bytes=\"553756840\" />\n  <memory-traced type=\"other\" objects=\"5461302\" bytes=\"131394216\" />\n  <regions eden=\"488\" other=\"138\" />\n  <remembered-set-cleared processed=\"156775\" cleared=\"4897\" durationms=\"1.759\" />\n  <finalization candidates=\"31\" enqueued=\"12\" />\n  <ownableSynchronizers candidates=\"1992467\" cleared=\"1600904\" />\n  <references type=\"soft\" candidates=\"329190\" cleared=\"0\" enqueued=\"0\" dynamicThreshold=\"8\" maxThreshold=\"32\" />\n  <references type=\"weak\" candidates=\"697\" cleared=\"105\" enqueued=\"6\" />\n  <stringconstants candidates=\"9848\" cleared=\"0\"  />\n  <object-monitors candidates=\"1437\" cleared=\"1353\"  />\n  <heap-resize type=\"expand\" space=\"default\" amount=\"0\" count=\"1\" timems=\"0.000\" reason=\"continue current collection\" />\n  <warning details=\"operation aborted due to insufficient free space\" />\n</gc-op>\n

The logs record these two concurrent parts of a copy forward operation in the <gc-op type=\"copy forward\"> section by using a <memory-traced> child element. In addition,evacuated and marked attributes for the <regions> child element are used to distinguish between the number of regions that were copied-forward (recorded as evacuated) and the number of regions that were only marked and not copied-forward. For example, <regions eden=\"256\" other=\"308\" evacuated=\"308\" marked=\"256\" />.

Returning to the contextid=186 partial cycle example, the next element in the logs, <gc-end>, records the end of the increment and provides another snapshot of memory allocation on the heap, similar to <gc-start>.

<gc-end id=\"191\" type=\"partial gc\" contextid=\"186\" durationms=\"402.645\" usertimems=\"3157.520\" systemtimems=\"4.000\" stalltimems=\"47.689\" timestamp=\"2021-02-26T11:11:42.714\" activeThreads=\"8\">\n  <mem-info id=\"192\" free=\"3003121664\" total=\"4294967296\" percent=\"69\">\n    <mem type=\"eden\" free=\"2147483648\" total=\"2147483648\" percent=\"100\" />\n    <arraylet-primitive objects=\"1\" leaves=\"4\" largest=\"4\" />\n    <pending-finalizers system=\"56\" default=\"0\" reference=\"430\" classloader=\"0\" />\n    <remembered-set count=\"2922048\" freebytes=\"160016128\" totalbytes=\"171704320\" percent=\"93\" regionsoverflowed=\"1\" regionsstable=\"12\" regionsrebuilding=\"0\"/>\n  </mem-info>\n</gc-end>\n

The following information describes the heap memory allocation at the end of the increment:

The cycle completes and the GC restarts application threads.

<cycle-end id=\"193\" type=\"partial gc\" contextid=\"186\" timestamp=\"2021-02-26T11:11:42.714\" />\n<exclusive-end id=\"194\" timestamp=\"2021-02-26T11:11:42.714\" durationms=\"404.145\" />\n

The next cycle that is recorded in the logs is another partial GC cycle. The <gc-start>element records the following information:

<gc-start id=\"198\" type=\"partial gc\" contextid=\"197\" timestamp=\"2021-02-26T11:11:46.072\">\n  <mem-info id=\"199\" free=\"855638016\" total=\"4294967296\" percent=\"19\">\n    <mem type=\"eden\" free=\"0\" total=\"2147483648\" percent=\"0\" />\n    <arraylet-primitive objects=\"1\" leaves=\"4\" largest=\"4\" />\n    <remembered-set count=\"2922048\" freebytes=\"160016128\" totalbytes=\"171704320\" percent=\"93\" regionsoverflowed=\"1\" regionsstable=\"12\" regionsrebuilding=\"0\"/>\n  </mem-info>\n</gc-start>\n

The <mem-info> element shows that the following events occurred in between the end of the last (partial) GC cycle and the start of this cycle:

"},{"location":"vgclog_examples/#summary_2","title":"Summary","text":"

Analyzing the structure and elements of this example log output shows that this example balanced partial GC cycle has the following characteristics:

"},{"location":"vgclog_examples/#balanced-global-mark-gc-cycle","title":"balanced global mark GC cycle","text":"

The global mark GC cycle uses a mixture of STW and concurrent operations to build a new record of object liveness across the heap for use by the balanced partial GC cycle. The balanced GC runs a balanced global mark cycle, or a balanced global mark cycle increment if the global mark cycle is in progress, if the heap satisfies a low memory condition when the allocation taxation threshold is reached.

The global mark cycle runs a global mark phase and also triggers an associated sweep phase within the partial GC cycle that immediately follows the end of the global mark cycle.

To search for a balanced global mark cycle, you can search for the type attribute value global mark phase in <cycle-start> and <cycle-end> elements.

The global cycle is split into multiple increments, each recorded as type=\"global mark phase\". A global mark phase increment involves an STW subincrement, which runs a global mark operation during an STW pause, followed by a global mark phase (GMP) work packet subincrement. The GMP work packet subincrement involves a processing operation that runs concurrently. The GMP work packet subincrement might also use an STW pause to complete if the subincrement is interrupted by a partial or global cycle trigger.

Splitting the global mark phase into these increments and subincrements reduces pause times by running the majority of the GC work concurrently and interleaving global mark phase increments with partial GC cycles, and, rarely a balanced global GC cycles.

The following elements log the GC increments, subincrements, and operations of the global mark GC cycle:

Table showing the global mark cycle GC increments and corresponding XML elements GC increment GC operations> STW or concurrent XML element of GC increment Details global mark phase subincrement mark STW <gc-start>, <gc-end> The global mark phase operations start at the beginning of the cycle and run through all regions until the final region GMP work packet processing subincrement Work packet processing (WPP) operations concurrent and sometimes final operations during an STW to complete the subincrement <concurrent-start>, <concurrent-end> The GMP work packet processing subincrement runs immediately after the global mark phase final global mark phase increment final global mark phase operations including class unload STW <gc-start>, <gc-end> Final increment. Runs the final global mark phase operations, including weak roots processing, followed by operations to finish the cycle

The following structure shows a balanced global mark GC cycle. The lines are indented to help illustrate the flow and some child elements are omitted for clarity:

<exclusive-start/>                        (STW pause starts)\n\n<allocation-taxation/>                    (memory threshold trigger recorded)\n\n<cycle-start type=\"global mark phase\"/>   (global mark cycle starts)\n\n<gc-start type=\"global mark phase\"/>      (1st GMP STW subincrement starts)\n\n    <mem-info>                            (memory status before operations)\n\n    <remembered-set>\n\n    </mem-info>         \n\n</gc-start>\n\n<gc-op type=\"mark increment\" />           (STW copy forward operation completed)\n\n<gc-end>                                  (1st GMP STW subincrement ends)\n\n    <mem-info>                            (memory status after operations)\n\n    <remembered-set>\n\n    </mem-info>\n\n<gc-end>\n\n<concurrent-start type=\"GMP work packet processing\"/> (1st GMP concurrent subincrement starts)\n\n<exclusive-end/>                                      (STW pause ends and application threads resume)\n\n<concurrent-end type=\"GMP work packet processing\"/>   (1st GMP concurrent subincrement ends)\n\n<gc-op type=\"mark increment\"/>                        (marking operation runs concurrently)\n\n</concurrent-end type=\"GMP work packet processing\"/>\n\n...                                       (application threads run. STW pauses stop    \n                                          and start application threads to run\n                                          partial GC cycles.)\n\n<exclusive-start/>                        (STW pause starts)\n\n<gc-start type=\"global mark phase\"/>      (2nd STW GMP subincrement starts)\n\n...   \n\n<concurrent-start type=\"GMP work packet processing\"/> (2nd concurrent GMP subincrement starts)\n\n...\n\n<exclusive-end/>\n\n...                                       (application threads run. Partial GC cycles may run)\n\n<concurrent-end type=\"GMP work packet processing\" />  (2nd concurrent GMP subincrement ends)\n...\n\n</concurrent-end>\n\n...                                       (application threads run. Partial cycles\n                                          and GMP increments interleave)\n\n<exclusive-start/>                        (STW pause starts)\n\n...\n\n<gc-start type=\"global mark phase\"/>      (final STW GMP subincrement starts.)\n\n<gc-op type=\"mark increment\" />           (STW copy forward operation completed)\n\n<gc-op  type=\"class unload\" />            (STW class unload operation completed)\n\n<gc-end>                                  (1st GMP STW subincrement ends)\n...   \n<gc-end type=\"global mark phase\"/>        (final STW GMP subincrement ends. No concurrent subincrement runs)\n\n<cycle-end type=\"global mark phase\"/>     (end of global mark cycle)\n\n<exclusive-end/>                          (STW pause ends)    \n\n<exclusive-start/>                        (STW pause starts)\n\n<cycle-start type=\"partial gc\" />         (partial cycle starts)\n\n...\n\n<gc-op type=\"sweep\" />                    (Sweep operation associated with global mark cycle runs)\n\n...\n\n<cycle-end type=\"partial gc\"/>            (partial GC cycle ends)\n\n<exclusive-end/>                          (STw pause ends)\n
"},{"location":"vgclog_examples/#global-mark-phase","title":"Global mark phase","text":"

The first activity of the global mark cycle is an STW pause, recorded by an <exclusive-start> element that precedes the <cycle-start type=\"global mark phase\"/> element. The garbage collector pauses application threads to run the initial operations.

<exclusive-start id=\"1152\" timestamp=\"2021-02-26T11:17:25.033\" intervalms=\"1931.263\">\n  <response-info timems=\"3.082\" idlems=\"1.041\" threads=\"2\" lastid=\"00000000006EDE00\" lastname=\"RunDataWriter.1\" />\n</exclusive-start>\n

The <allocation-taxation> element indicates that an allocation taxation threshold triggered the cycle. The taxation threshold is recorded as 1024 MB (1,073,741,824), which is half the total memory of the eden space (2048 MB), as expected for threshold triggers of global mark cycles and increments. For more information about taxation thresholds for the balanced policy, see balanced examples.

<allocation-taxation id=\"1153\" taxation-threshold=\"1073741824\" timestamp=\"2021-02-26T11:17:25.034\" intervalms=\"1931.251\" />\n

Details about the start of the global mark GC cycle are recorded by the <cycle-start> element. The cycle is recorded as type global mark phase with id=1154. Any subsequent elements that are associated with this cycle have a contextid=1154 to match the global mark GC cycle id. You can use the contextid value to distinguish increments and operations of the global mark GC cycle from the partial cycles that interleave with it.

<cycle-start id=\"1154\" type=\"global mark phase\" contextid=\"0\" timestamp=\"2021-02-26T11:17:25.034\" intervalms=\"374365.075\" />\n

The cycle begins with the STW subincrement of a global mark phase increment. The STW subincrement is recorded by using the <gc-start> element of type global mark phase.

<gc-start id=\"1155\" type=\"global mark phase\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:25.034\">\n  <mem-info id=\"1156\" free=\"1442840576\" total=\"4294967296\" percent=\"33\">\n    <remembered-set count=\"2197888\" freebytes=\"162912768\" totalbytes=\"171704320\" percent=\"94\" regionsoverflowed=\"3\" regionsstable=\"130\" regionsrebuilding=\"0\"/>\n  </mem-info>\n</gc-start>\n

The <gc-start> element provides a snapshot of the free memory available in the heap and the status of the remembered set. At the start of the increment, the heap is 33% free; 1376 MB (1442840576 B) of the total 4096 MB (4294967296 B).

The <remembered-set> element records the status of the remembered set metastructure, a structure that records object references that cross different regions. During the rebuilding of the remembered set metastructure, any regions that cannot be rebuilt into a remembered set due to a lack of memory resource in the metastructure are marked as overflow regions. Partial GC cycles cannot reclaim memory from overflow regions.

The aim of the global mark cycle is to create a new record of object liveness by populating the remembered set. The global mark cycle also attempts to rebuild the remembered set information for the overflowed regions, which can be seen in the remembered set statistics. After the global mark cycle completes, the remembered set reflects a closer snapshot of the current liveness of the heap. This more accurate snapshot of object liveness optimizes the pruning of the set, which is run by the partial GC cycle when it consumes the object liveness snapshot.

The logs show that at the start of this STW subincrement, the remembered set count is 2,197,888 cards, the metastructure is using 94% of its total available memory, and three overflow regions need to be rebuilt.

The <gc-op> element records that the STW subincrement runs a mark operation. This operation begins the process of building a record of object liveness across the heap.

<gc-op id=\"1157\" type=\"mark increment\" timems=\"122.825\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:25.157\">\n  <trace-info objectcount=\"7726701\" scancount=\"7584109\" scanbytes=\"213445656\" />\n</gc-op>\n

The <trace-info> element records information about the marking and scanning stages of the mark increment operation. objectcount records the number of objects that were marked, ready for tracing. After marking live objects, a scan is run to trace objects and references. The following values are recorded:

In the example, the mark increment operation marked 7,726,701 objects and scanned 7,584,109 of these marked objects. The 7,584,109 of scanned objects take up 203.5 MB (213445656 B) of memory. The number of scanned objects is less than the number of marked objects because only objects that have children require scanning. Also, the scanning part of the marking operation might be interrupted by the garbage collector if a trigger threshold for a partial cycle or global cycle is reached during the marking operation.

The STW global mark phase subincrement ends, as recorded by <gc-end>, which records a snapshot of the memory status in the heap in a similar way to <gc-start>.

<gc-end id=\"1158\" type=\"global mark phase\" contextid=\"1154\" durationms=\"123.139\" usertimems=\"977.851\" systemtimems=\"0.000\" stalltimems=\"1.453\" timestamp=\"2021-02-26T11:17:25.157\" activeThreads=\"8\">\n  <mem-info id=\"1159\" free=\"1442840576\" total=\"4294967296\" percent=\"33\">\n    <remembered-set count=\"3263968\" freebytes=\"158648448\" totalbytes=\"171704320\" percent=\"92\" regionsoverflowed=\"0\" regionsstable=\"0\" regionsrebuilding=\"133\"/>\n  </mem-info>\n</gc-end>\n

The following comparison can be made between the snapshot at the beginning and end of this STW global mark phase subincrement:

The beginning of the second part of the global mark phase increment, the GMP work packet processing subincrememt, is recorded by <concurrent-start>. The child element <concurrent-mark-start> records the scan target of this subincrement as 242.74 MB (254,532,672 B).

<concurrent-start id=\"1160\" type=\"GMP work packet processing\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:25.157\">\n  <concurrent-mark-start scanTarget=\"254532672\" />\n</concurrent-start>\n

Now that the STW global mark phase subincrement is complete, application threads are restarted.

<exclusive-end id=\"1161\" timestamp=\"2021-02-26T11:17:25.157\" durationms=\"123.936\" />\n

The GMP work packet processing subincrement continues to run concurrently. The end of this operation is recorded by using the <concurrent-end> element.

<concurrent-end id=\"1162\" type=\"GMP work packet processing\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:25.469\" terminationReason=\"Work target met\">\n<gc-op id=\"1163\" type=\"mark increment\" timems=\"311.867\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:25.469\">\n  <trace-info scanbytes=\"254708852\" />\n</gc-op>\n</concurrent-end>\n

The child element <trace-info> shows that the processing scanned 242.91 MB (254,708,852 B), which slightly exceeds the 108.25 MB scan target.

Application threads continue to run and allocate memory. The garbage collector stops and starts the application threads to run partial GC cycles that reclaim free space in the eden space and some older regions. To see an example of how a balanced partial GC cycle appears in the logs, see the balanced partial GC cycle.

Following some partial GC cycles, an allocation taxation threshold is reached that triggers an STW pause followed by another global mark phase increment. The element <gc-start> in the following log excerpt has a contextid=1154 and type global mark phase, which indicates that this is a global mark phase subincrement associated with the global mark cycle example.

<exclusive-start id=\"1175\" timestamp=\"2021-02-26T11:17:28.993\" intervalms=\"1978.886\">\n  <response-info timems=\"5.111\" idlems=\"1.714\" threads=\"2\" lastid=\"00000000006EDE00\" lastname=\"RunDataWriter.1\" />\n</exclusive-start>\n<allocation-taxation id=\"1176\" taxation-threshold=\"1073741824\" timestamp=\"2021-02-26T11:17:28.994\" intervalms=\"1978.879\" />\n<gc-start id=\"1177\" type=\"global mark phase\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:28.994\">\n  <mem-info id=\"1178\" free=\"1451229184\" total=\"4294967296\" percent=\"33\">\n    <remembered-set count=\"3325824\" freebytes=\"158401024\" totalbytes=\"171704320\" percent=\"92\" regionsoverflowed=\"2\" regionsstable=\"0\" regionsrebuilding=\"133\"/>\n  </mem-info>\n</gc-start>\n

The <allocation-taxation> element shows that the allocation taxation threshold, which triggers this global mark phase increment, is set to 1024 MB, half of the size of the eden space, as expected.

<gc-start> records that the heap has 1384 MB (1,451,229,184 B) of free memory available at the beginning of this global mark phase increment. This value compares to the 1376 MB (1,442,840,576 B) of free memory available at the end of the previous global mark phase increment. Although free memory was reclaimed by the partial GC cycles that ran between these global mark phase increments, free memory was allocated to objects when application threads ran, resulting in a net reduction of free memory available.

The status of the heap at the beginning and end of STW subincrements are automatically recorded. For this STW subincrement, there are no <gc-op> elements recorded; <gc-end> immediately follows <gc-start> in the logs. For some STW subincrements, a mark operation is run.

<gc-end id=\"1179\" type=\"global mark phase\" contextid=\"1154\" durationms=\"0.289\" usertimems=\"1.000\" systemtimems=\"0.000\" stalltimems=\"0.000\" timestamp=\"2021-02-26T11:17:28.994\" activeThreads=\"8\">\n  <mem-info id=\"1180\" free=\"1451229184\" total=\"4294967296\" percent=\"33\">\n    <remembered-set count=\"3325824\" freebytes=\"158401024\" totalbytes=\"171704320\" percent=\"92\" regionsoverflowed=\"2\" regionsstable=\"0\" regionsrebuilding=\"133\"/>\n  </mem-info>\n</gc-end>\n

The second part of the increment, the GMP work packet processing subincrement, is recorded by using the <concurrent-start> and <concurrent-end> elements.

<concurrent-start id=\"1181\" type=\"GMP work packet processing\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:28.994\">\n  <concurrent-mark-start scanTarget=\"258671414\" />\n</concurrent-start>\n<exclusive-end id=\"1182\" timestamp=\"2021-02-26T11:17:28.994\" durationms=\"0.816\" />\n\n<concurrent-end id=\"1183\" type=\"GMP work packet processing\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:29.273\" terminationReason=\"Work target met\">\n<gc-op id=\"1184\" type=\"mark increment\" timems=\"279.311\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:29.274\">\n  <trace-info scanbytes=\"258767612\" />\n</gc-op>\n</concurrent-end>\n

The log excerpt shows the concurrent GMP work packet processing subincrement achieved the scan target of 246.69 MB (258671414 B). 246.78 MB (258767612 B) were scanned.

More partial cycles run. This pattern of interleaving of global mark increments with partial GC cycles repeats until a final global mark increment completes the global mark cycle. The final global mark phase increment consists of an STW global mark phase subincrement that includes mark increment and class unload operations.

<exclusive-start id=\"1217\" timestamp=\"2021-02-26T11:17:36.864\" intervalms=\"1986.124\">\n  <response-info timems=\"0.287\" idlems=\"0.104\" threads=\"2\" lastid=\"00000000006EDE00\" lastname=\"RunDataWriter.1\" />\n</exclusive-start>\n<allocation-taxation id=\"1218\" taxation-threshold=\"1073741824\" timestamp=\"2021-02-26T11:17:36.865\" intervalms=\"1986.101\" />\n<gc-start id=\"1219\" type=\"global mark phase\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:36.865\">\n  <mem-info id=\"1220\" free=\"1438646272\" total=\"4294967296\" percent=\"33\">\n    <remembered-set count=\"3514496\" freebytes=\"157646336\" totalbytes=\"171704320\" percent=\"91\" regionsoverflowed=\"3\" regionsstable=\"0\" regionsrebuilding=\"133\"/>\n  </mem-info>\n</gc-start>\n<gc-op id=\"1221\" type=\"mark increment\" timems=\"164.843\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:37.030\">\n  <trace-info objectcount=\"7715572\" scancount=\"7665293\" scanbytes=\"214739196\" />\n  <cardclean-info objects=\"3962203\" bytes=\"117924792\" />\n  <finalization candidates=\"206\" enqueued=\"30\" />\n  <ownableSynchronizers candidates=\"601780\" cleared=\"16925\" />\n  <references type=\"soft\" candidates=\"718240\" cleared=\"2858\" enqueued=\"2832\" dynamicThreshold=\"18\" maxThreshold=\"32\" />\n  <references type=\"weak\" candidates=\"2321\" cleared=\"142\" enqueued=\"0\" />\n  <references type=\"phantom\" candidates=\"8\" cleared=\"0\" enqueued=\"0\" />\n  <stringconstants candidates=\"9522\" cleared=\"0\"  />\n  <object-monitors candidates=\"7142\" cleared=\"7066\"  />\n</gc-op>\n<gc-op id=\"1222\" type=\"classunload\" timems=\"0.704\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:37.030\">\n  <classunload-info classloadercandidates=\"185\" classloadersunloaded=\"13\" classesunloaded=\"13\" anonymousclassesunloaded=\"0\" quiescems=\"0.000\" setupms=\"0.644\" scanms=\"0.043\" postms=\"0.016\" />\n</gc-op>\n<gc-end id=\"1223\" type=\"global mark phase\" contextid=\"1154\" durationms=\"169.521\" usertimems=\"1244.810\" systemtimems=\"3.000\" stalltimems=\"27.792\" timestamp=\"2021-02-26T11:17:37.034\" activeThreads=\"8\">\n  <mem-info id=\"1224\" free=\"1438646272\" total=\"4294967296\" percent=\"33\">\n    <pending-finalizers system=\"30\" default=\"0\" reference=\"2832\" classloader=\"0\" />\n    <remembered-set count=\"2241440\" freebytes=\"162738560\" totalbytes=\"171704320\" percent=\"94\" regionsoverflowed=\"3\" regionsstable=\"127\" regionsrebuilding=\"0\"/>\n  </mem-info>\n</gc-end>\n

Comparing the memory at the start and end of this final global mark phase increment shows the following status:

Following the final global mark increment, the global mark cycle completes and the GC ends the STW pause.

<cycle-end id=\"1225\" type=\"global mark phase\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:37.034\" />\n<exclusive-end id=\"1226\" timestamp=\"2021-02-26T11:17:37.034\" durationms=\"170.186\" />\n

The operations to create a record of object liveness across the heap, which began with the global mark cycle, is followed by a sweep phase. The sweep phase is triggered by the end of the global mark cycle to be included in the next partial GC cycle that runs.

"},{"location":"vgclog_examples/#sweep-phase","title":"Sweep phase","text":"

The sweep operation has the following two objectives:

While the global sweep operation is logically associated with the global mark phase, it does not run in the same global mark cycle. Instead, the sweep operation runs in the same STW increment as the first partial GC cycle that runs after the completion of the global mark cycle. This can be seen in the following log excerpt. After the log records the end of the global mark cycle, it records an STW pause followed by a partial gc cycle of id=1229. The global sweep operation that runs after the global mark phase is recorded in the <gc-op> element that is tagged as id=1229.

<exclusive-start id=\"1227\" timestamp=\"2021-02-26T11:17:38.804\" intervalms=\"1940.125\">\n...\n<cycle-start id=\"1229\" type=\"partial gc\" contextid=\"0\" timestamp=\"2021-02-26T11:17:38.805\" intervalms=\"3926.202\" />\n...\n</gc-start>\n...\n</gc-start>\n<gc-op id=\"1232\" type=\"sweep\" timems=\"9.472\" contextid=\"1229\" timestamp=\"2021-02-26T11:17:38.815\" />\n<gc-op id=\"1233\" type=\"copy forward\" timems=\"308.258\" contextid=\"1229\" timestamp=\"2021-02-26T11:17:39.124\">\n...\n<gc-op id=\"1234\" type=\"classunload\" timems=\"0.012\" contextid=\"1229\" timestamp=\"2021-02-26T11:17:39.125\">\n...\n<gc-end>\n...\n</gc-end>\n<cycle-end id=\"1237\" type=\"partial gc\" contextid=\"1229\" timestamp=\"2021-02-26T11:17:39.125\" />\n<exclusive-end id=\"1238\" timestamp=\"2021-02-26T11:17:39.125\" durationms=\"320.792\" />\n

A record of object liveness is now complete.

"},{"location":"vgclog_examples/#summary_3","title":"Summary","text":"

Analyzing the structure and elements of this example log output shows that this example balanced global mark GC cycle has the following characteristics:

"},{"location":"vgclog_examples/#balanced-global-gc-cycle","title":"balanced global GC cycle","text":"

The following global GC cycle example is taken from a balanced verbose GC log. The output is broken down into sections to explain the GC processing that is taking place.

A balanced global cycle is triggered if the VM is close to throwing an out of memory exception. This situation occurs only under tight memory conditions when the garbage collector cannot reclaim enough memory by using only partial and global mark cycles.

To search for a balanced global cycle or increment, you can search for the type attribute value global garbage collect of the cycle or increment element.

If the balanced global cycle is triggered during a balanced global mark GC cycle, a new global cycle is not recorded. Instead, the global mark cycle's global mark phase increment switches to a global garbage collect increment that is run as an STW increment. This switch is recorded in the logs by using a <cycle-continue> element, which precedes the gc-start element that records the new global garbage collect increment.

If the balanced global cycle is not triggered during a balanced global mark cycle, the global cycle is recorded as a new cycle by using the <cycle-start> element.

The element <sys-start reason=\"explicit\"> is used in the logs to record a cycle that was triggered explicitly rather than by the garbage collector. For example, the trigger reason is recorded as explicit if a cycle is triggered by an application calling System.gc(). For more information about explicitly or implicitly triggering a GC cycle, see Garbage collection.

The global cycle operations run as a single GC increment during an STW pause.

Table showing the balanced global cycle's GC increment and corresponding XML elements. GC increment GC operations STW or concurrent XML element of GC increment Details single STW mark-sweep operations, optionally followed by a compact operation STW <cycle-start>, <gc-end> Contains detailed information about where free memory is located and remembered set statistics

If the global cycle is triggered during a global mark cycle, the global cycle follows a general structure in the verbose GC log as shown. Some child elements are omitted for clarity:

...                                        (global mark cycle increment runs)\n\n<af-start/>                                (allocation failure trigger recorded)\n\n<concurrent-end/>                          (global mark cycle concurrent subincrement finishes )\n\n<allocation-taxation/>                     (memory threshold trigger recorded)\n\n<cycle-continue/>                          (change of cycle type from global mark to global)\n\n</gc-start type=\"global garbage collect\"/> (global cycle STW increment starts)\n\n<mem-info>                                 (memory status before operations)\n\n <mem></mem>                               (status of different types of memory)\n\n</mem-info>         \n\n</gc-start type=\"global garbage collect\"/>\n\n<allocation-stats/>                        (Snapshot of how memory was divided up between\n                                           ... application threads before current cycle started)\n<gc-op> type=\"mark\" </gc-op>                (mark operation completed)\n\n<gc-op> type=\"class unload\" </gc-op>        (class unload operation completed)\n\n<gc-op> type=\"sweep\" </gc-op>               (sweep operation completed)\n\n<gc-op> type=\"compact\" </gc-op>             (compact operation completed)\n\n<gc-end type=\"global garbage collect\">      (global cycle STW increment ends)\n\n<mem-info>                                  (memory status after operations)\n\n<mem></mem>                                 (status of different types of memory)\n\n</mem-info>         \n\n</gc-end type=\"global garbage collect\">\n\n<cycle-end type = \"global garbage collect\"/> (cycle ends)\n\n<allocation-satisfed/>                      (required allocation has been achieved)\n\n<exclusive-end>                             (STW pause ends)\n

The following example shows a balanced global cycle that is triggered during a global mark cycle.

The start of the GMP work processing subincrement of the global mark cycle, which runs concurrently with application threads, is recorded by using the <concurrent-start> element.

<concurrent-start id=\"2009\" type=\"GMP work packet processing\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:43.109\">\n  <concurrent-mark-start scanTarget=\"18446744073709551615\" />\n</concurrent-start>\n

After the start of the concurrent subincrement, the logs record an allocation failure by using <af-start>. The <concurrent-end> element attribute terminationReason shows that a termination of the concurrent increment was requested by the garbage collector.

<af-start id=\"2010\" threadId=\"00000000008AA780\" totalBytesRequested=\"24\" timestamp=\"2021-03-05T12:16:43.109\" intervalms=\"1212.727\" />\n<concurrent-end id=\"2011\" type=\"GMP work packet processing\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:43.110\" terminationReason=\"Termination requested\">\n<gc-op id=\"2012\" type=\"mark increment\" timems=\"0.893\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:43.110\">\n  <trace-info scanbytes=\"584612\" />\n</gc-op>\n</concurrent-end>\n

The next element, the <cycle-continue> element, records information about the switch of cycle type from a global mark cycle, recorded as type global mark phase, to a global cycle, recorded as type global garbage collect.

<cycle-continue id=\"2013\" oldtype=\"global mark phase\" newtype=\"global garbage collect\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:43.110\" />\n

A global cycle increment is recorded by <gc-start> and has the same contextid as the global mark cycle's elements. The global cycle operations are run during an STW pause and as a modification to the global mark cycle rather than a new cycle. The memory snapshot within the <gc-start> element is taken before the global increment's operations run and can be compared with a similar snapshot that is taken afterward to understand the effect on the heap.

<gc-start id=\"2014\" type=\"global garbage collect\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:43.110\">\n  <mem-info id=\"2015\" free=\"0\" total=\"838860800\" percent=\"0\">\n    <mem type=\"eden\" free=\"0\" total=\"524288\" percent=\"0\" />\n    <remembered-set count=\"12832\" freebytes=\"33331072\" totalbytes=\"33382400\" percent=\"99\" regionsoverflowed=\"0\" regionsstable=\"0\" regionsrebuilding=\"1593\"/>\n  </mem-info>\n</gc-start>\n

At the start of the global cycle's increment, the amount of memory available in the heap is zero. In some cases, the heap is close to full, and in other cases, the memory is full.

The next element <allocation-stats> shows a snapshot of how memory was divided up between application threads before the current cycle started.

<allocation-stats totalBytes=\"524200\" >\n  <allocated-bytes non-tlh=\"0\" tlh=\"524200\" arrayletleaf=\"0\"/>\n</allocation-stats>\n

The <allocation-stats> element shows that very little allocation took place. Global cycles are triggered due to an allocation failure, so the low memory allocation values are expected.

The following operations, each recorded by a <gc-op> element, run as part of the global cycle's increment:

<gc-op id=\"2016\" type=\"global mark\" timems=\"357.859\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:43.468\">\n  <trace-info objectcount=\"37461962\" scancount=\"37447916\" scanbytes=\"828311396\" />\n  <cardclean-info objects=\"311\" bytes=\"22632\" />\n  <finalization candidates=\"195\" enqueued=\"2\" />\n  <ownableSynchronizers candidates=\"2089\" cleared=\"0\" />\n  <references type=\"soft\" candidates=\"3059\" cleared=\"0\" enqueued=\"0\" dynamicThreshold=\"0\" maxThreshold=\"32\" />\n  <references type=\"weak\" candidates=\"10797\" cleared=\"0\" enqueued=\"0\" />\n  <references type=\"phantom\" candidates=\"6\" cleared=\"0\" enqueued=\"0\" />\n  <stringconstants candidates=\"10031\" cleared=\"0\"  />\n</gc-op>\n<gc-op id=\"2017\" type=\"classunload\" timems=\"0.123\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:43.468\">\n  <classunload-info classloadercandidates=\"25\" classloadersunloaded=\"0\" classesunloaded=\"0\" anonymousclassesunloaded=\"0\" quiescems=\"0.000\" setupms=\"0.123\" scanms=\"0.000\" postms=\"0.000\" />\n</gc-op>\n<gc-op id=\"2018\" type=\"sweep\" timems=\"5.120\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:43.474\" />\n<gc-op id=\"2019\" type=\"compact\" timems=\"762.323\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:44.236\">\n  <compact-info movecount=\"8024461\" movebytes=\"163375400\" />\n  <remembered-set-cleared processed=\"777104\" cleared=\"777104\" durationms=\"2.188\" />\n</gc-op>\n

The global cycle's increment ends. The end of the increment is recorded with <gc-end> and provides another snapshot of memory allocation on the heap, similar to <gc-start>.

<gc-end id=\"2020\" type=\"global garbage collect\" contextid=\"2003\" durationms=\"1126.788\" usertimems=\"7971.788\" systemtimems=\"1.000\" stalltimems=\"1016.256\" timestamp=\"2021-03-05T12:16:44.237\" activeThreads=\"8\">\n  <mem-info id=\"2021\" free=\"1572864\" total=\"838860800\" percent=\"0\">\n    <mem type=\"eden\" free=\"1572864\" total=\"1572864\" percent=\"100\" />\n    <pending-finalizers system=\"2\" default=\"0\" reference=\"0\" classloader=\"0\" />\n    <remembered-set count=\"874496\" freebytes=\"29884416\" totalbytes=\"33382400\" percent=\"89\" regionsoverflowed=\"0\" regionsstable=\"0\" regionsrebuilding=\"0\"/>\n  </mem-info>\n</gc-end>\n

Comparing the snapshot at the beginning and end of this STW global mark phase subincrement shows that memory was reclaimed and regions reassigned to create an empty eden space, equal to 1.5 MB (1,572,864 B). Because global cycles are triggered when memory conditions are tight, the global cycle is able to reclaim only a small amount of memory.

The cycle ends (<cycle-end>). The following <allocation-satisfied> element indicates that the allocation request that caused the allocation failure can now complete successfully.

<cycle-end id=\"2022\" type=\"global garbage collect\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:44.237\" />\n<allocation-satisfied id=\"2023\" threadId=\"00000000008A9E00\" bytesRequested=\"24\" />\n<af-end id=\"2024\" timestamp=\"2021-03-05T12:16:44.237\" threadId=\"00000000008AA780\" success=\"true\" />\n

The STW pause ends with the <exclusive-end> element.

<exclusive-end id=\"2025\" timestamp=\"2021-03-05T12:16:44.237\" durationms=\"1130.358\" />\n
"},{"location":"vgclog_examples/#summary_4","title":"Summary","text":"

Analyzing the structure and elements of this example log output shows that this global cycle has the following characteristics:

"},{"location":"x/","title":"-X","text":""},{"location":"x/#-x","title":"-X","text":"

Displays help on nonstandard options.

"},{"location":"x/#syntax","title":"Syntax","text":"
    -X\n
"},{"location":"x_jvm_commands/","title":"Using -X options","text":""},{"location":"x_jvm_commands/#using-x-command-line-options","title":"Using -X command-line options","text":"

Use these options to configure the Eclipse OpenJ9\u2122 virtual machine (VM). Unlike standard options, options prefixed with -X are nonstandard and are typically unique to a Java\u2122 virtual machine implementation. However, in some cases, -X option names are common to different VM implementations and might have the same function.

For options that take a <size> parameter, add a suffix to the size value: \"k\" or \"K\" to indicate kilobytes, \"m\" or \"M\" to indicate megabytes, \"g\" or \"G\" to indicate gigabytes, or \"t\" or \"T\" to indicate terabytes.

For example, to set the -Xmx value to 16 MB, you can specify -Xmx16M, -Xmx16m, -Xmx16384K, -Xmx16384k, or -Xmx16777216 on the command line.

"},{"location":"xaggressive/","title":"-Xaggressive","text":""},{"location":"xaggressive/#-xaggressive","title":"-Xaggressive","text":"

Enables performance optimizations and new platform exploitation that are expected to be the default in future releases.

"},{"location":"xaggressive/#syntax","title":"Syntax","text":"
    -Xaggressive\n
"},{"location":"xalwaysclassgc/","title":"-Xalwaysclassgc","text":""},{"location":"xalwaysclassgc/#-xalwaysclassgc","title":"-Xalwaysclassgc","text":"

Always perform dynamic class unloading during global garbage collection.

"},{"location":"xalwaysclassgc/#syntax","title":"Syntax","text":"
    -Xalwaysclassgc\n
"},{"location":"xalwaysclassgc/#default-behavior","title":"Default behavior","text":"

If you don't set this option, the default behavior is defined by -Xclassgc.

This option can be used with all Eclipse OpenJ9\u2122 GC policies.

"},{"location":"xalwaysclassgc/#see-also","title":"See also","text":""},{"location":"xaot/","title":"-Xaot","text":""},{"location":"xaot/#-xaot-xnoaot","title":"-Xaot / -Xnoaot","text":"

Use this option to control the behavior of the ahead-of-time (AOT) compiler. When the AOT compiler is active, the compiler selects the methods to be AOT compiled with the primary goal of improving startup time.

AOT compilation allows the compilation of Java\u2122 classes into native code for subsequent executions of the same program. The AOT compiler works with the class data sharing framework.

The AOT compiler generates native code dynamically while an application runs and caches any generated AOT code in the shared data cache. Subsequent VMs that execute the method can load and use the AOT code from the shared data cache without incurring the performance decrease experienced with JIT-compiled native code.

"},{"location":"xaot/#performance","title":"Performance","text":"

Because AOT code must persist over different program executions, AOT-generated code does not perform as well as JIT-generated code. AOT code usually performs better than interpreted code.

In a VM without an AOT compiler or with the AOT compiler disabled, the JIT compiler selectively compiles frequently used methods into optimized native code. There is a time cost associated with compiling methods because the JIT compiler operates while the application is running. Because methods begin by being interpreted and most JIT compilations occur during startup, startup times can be increased.

Startup performance can be improved by using the shared AOT code to provide native code without compiling. There is a small time cost to load the AOT code for a method from the shared data cache and bind it into a running program. The time cost is low compared to the time it takes the JIT compiler to compile that method.

"},{"location":"xaot/#default-behavior","title":"Default behavior","text":"

The AOT compiler is enabled by default, but is only active for classes that are found in the shared classes cache. See Introduction to class data sharing for information about the shared classes cache, how class sharing is enabled, and what options are available to modify class sharing behavior.

"},{"location":"xaot/#syntax","title":"Syntax","text":"Setting Action Default -Xaot Enable AOT yes -Xaot:<parameter>[=<value>] (See Note) Enable AOT with modifications -Xnoaot Disable AOT

Note: You can concatenate several parameters in a comma-separated list, for example: -Xaot:<parameter1>[=<value1>], <parameter2>[=<value2>].

Specify the -Xaot option only once. By default, if you specify this option multiple times, only the last option takes effect. You can use the -XX:+MergeCompilerOptions option to merge all the existing instances of the -Xaot options logically.

"},{"location":"xaot/#parameters-for-xaot","title":"Parameters for -Xaot","text":"Parameter Effect verbose Reports information about the AOT and JIT compiler configuration and method compilation. count Specifies the number of times a method is called before it is compiled. exclude Excludes specified methods when AOT code is compiled. limit Includes specified methods when AOT code is compiled. limitFile Compiles only the methods listed in the specified limit file. loadExclude Excludes specified methods when AOT code is loaded. loadLimit Includes specified methods when AOT code is loaded. loadLimitFile Loads only the methods listed in the specified limit file."},{"location":"xaot/#verbose","title":"verbose","text":"
    -Xaot:verbose\n
Reports information about the AOT and JIT compiler configuration and method compilation."},{"location":"xaot/#count","title":"count","text":"
    -Xaot:count=<n>\n
Specifies the number of times, <n>, a method is called before it is compiled or loaded from an existing shared classes cache. Setting -Xaot:count=0 forces the AOT compiler to compile everything on first execution, which is useful for problem determination."},{"location":"xaot/#exclude","title":"exclude","text":"
    -Xaot:exclude={<method_name>}\n

Excludes a Java method when AOT code is compiled from the shared classes cache. Use this option if the method causes the program to fail.

<method_name> is the method or methods that are to be excluded; the wildcard * may be used. Specify as much of the full package, class and method as necessary.

For example, -Xaot:exclude={test/sample/MyClass.testMethod()V} excludes the single method specified. However, -Xaot:exclude={test/sample/MyClass.testMethod()*} excludes the method regardless of return type. Similarly, -Xaot:exclude={*} excludes all methods.

Note: exclude has the same effect regardless of whether it's specified on -Xjit or -Xaot. In consequence, if you specify -Xaot:exclude, JIT compilation is also prevented and the methods specified are always interpreted.

"},{"location":"xaot/#limit","title":"limit","text":"
    -Xaot:limit={<method_name>}\n

Only the Java methods specified are included when AOT code is compiled from the shared classes cache. <method_name> is the method or methods that are to be included (the wildcard * may be used, see -Xaot:exclude for details).

Note: limit has the same effect regardless of whether it's specified on -Xjit or -Xaot. In consequence, if you specify -Xaot:limit, JIT compilation is also restricted to those methods specified; other methods are always interpreted.

"},{"location":"xaot/#limitfile","title":"limitFile","text":"
    -Xaot:limitFile=(<filename>,<m>,<n>)\n

Compiles or loads only the methods listed on lines <m> to, and including, <n> in the specified limit file, <filename>. Methods not listed in the limit file and methods listed on lines outside the range are not compiled or loaded.

Note: limitFile has the same effect regardless of whether it's specified on -Xjit or -Xaot. In consequence, if you specify -Xaot:limitFile, JIT compilation is also restricted to those methods specified; other methods are always interpreted.

"},{"location":"xaot/#loadexclude","title":"loadExclude","text":"
    -Xaot:loadExclude={<method_name>}\n

Excludes the specified Java methods when AOT code is loaded from the shared classes cache. In consequence, the compiler does a JIT compilation on those methods instead.

<method_name> is the method or methods that are to be excluded (the wildcard * may be used, see -Xaot:exclude for details). This option does not prevent the method from being compiled.

Note: loadExclude can only be specified on -Xaot; it does not have an equivalent on -Xjit.

"},{"location":"xaot/#loadlimit","title":"loadLimit","text":"
    -Xaot:loadLimit={<method_name>}\n

Only the Java methods specified are included when AOT code is loaded from the shared classes cache. In consequence, the compiler does a JIT compilation on other methods instead.

<method_name> is the method or methods that are to be included (the wildcard * may be used; see -Xaot:exclude for details).

Note: loadLimit can only be specified on -Xaot; it does not have an equivalent on -Xjit. This option filters what AOT code the compiler is allowed to load from the shared classes cache.

"},{"location":"xaot/#loadlimitfile","title":"loadLimitFile","text":"
    -Xaot:loadLimitFile=(<filename>,<m>,<n>)\n

Loads only the methods listed on lines <m> to, and including, <n> in the specified limit file. In consequence, the compiler does a JIT compilation on other methods instead.

<filename>. Methods not listed in the limit file and methods listed on lines outside the range are not loaded.

Note: loadLimitFile can only be specified on -Xaot; it does not have an equivalent on -Xjit.

"},{"location":"xaot/#see-also","title":"See also","text":""},{"location":"xargencoding/","title":"-Xargencoding","text":""},{"location":"xargencoding/#-xargencoding","title":"-Xargencoding","text":"

The java and javaw launchers accept arguments and class names containing any character that is in the character set of the current locale. You can also specify any Unicode character in the class name and arguments by using Java\u2122 escape sequences.

To do this, use the -Xargencoding command-line option.

"},{"location":"xargencoding/#syntax","title":"Syntax","text":"
    -Xargencoding:<parameter>\n
"},{"location":"xargencoding/#parameters","title":"Parameters","text":""},{"location":"xargencoding/#no-parameter","title":"No parameter","text":"
    -Xargencoding\n
You can use Unicode escape sequences in the argument list that you pass to this option. To specify a Unicode character, use escape sequences in the form \\u####, where # is a hexadecimal digit (0-9, A-F). For example, to specify a class that is called HelloWorld and use Unicode encoding for both capital letters, use this command:
java -Xargencoding \\u0048ello\\u0057orld\n
"},{"location":"xargencoding/#utf8","title":"utf8","text":"
    -Xargencoding:utf8\n
Use utf8 encoding."},{"location":"xargencoding/#latin","title":"latin","text":"
    -Xargencoding:latin\n
Use ISO8859_1 encoding."},{"location":"xbootclasspath/","title":"-Xbootclasspath","text":""},{"location":"xbootclasspath/#-xbootclasspath","title":"-Xbootclasspath","text":"

This Oracle\u00ae HotSpot\u2122 option specifies the search path for bootstrap classes and resources. The default is to search for bootstrap classes and resources in the internal VM directories and .jar files. The option is recognized by the Eclipse OpenJ9\u2122 VM.

"},{"location":"xbootclasspath/#syntax","title":"Syntax","text":"Limited to... Setting Effect -Xbootclasspath:<path> Sets the search path for bootstrap classes and resources. -Xbootclasspath/p:<path> Prepends the specified resources to the front of the bootstrap class path. -Xbootclasspath/a:<path> Appends the specified resources to the end of the bootstrap class path. where <path> represents directories and compressed or Java\u2122 archive files separated with colons (:). On Windows\u2122 systems, use a semicolon (;) as a separator.

Oracle advise that you should \"not deploy applications that use this option to override a class in rt.jar, because this violates the JRE binary code license.\"

"},{"location":"xceehdlr/","title":"-XCEEHDLR","text":""},{"location":"xceehdlr/#-xceehdlr","title":"-XCEEHDLR","text":"

(31-bit z/OS\u00ae only)

Controls Eclipse OpenJ9\u2122 VM Language Environment\u00ae condition handling.

"},{"location":"xceehdlr/#syntax","title":"Syntax","text":"
    -XCEEHDLR\n
"},{"location":"xceehdlr/#explanation","title":"Explanation","text":"

Use the -XCEEHDLR option if you want the new behavior for the Java\u2122 and COBOL interoperability batch mode environment, because this option makes signal and condition handling behavior more predictable in a mixed Java and COBOL environment.

When the -XCEEHDLR option is enabled, a condition triggered by an arithmetic operation while executing a Java Native Interface (JNI) component causes the VM to convert the Language Environment condition into a Java ConditionException.

When the -XCEEHDLR option is used the VM does not install POSIX signal handlers for the following signals:

Instead, user condition handlers are registered by the VM, using the CEEHDLR() method. These condition handlers are registered every time a thread calls into the VM. Threads call into the VM using the Java Native Interface and including the invocation interfaces, for example JNI\\_CreateJavaVM.

The Java runtime continues to register POSIX signal handlers for the following signals:

Signal chaining using the libjsig.so library is not supported.

When the -XCEEHDLR option is used, condition handler actions take place in the following sequence:

  1. All severity 0 and severity 1 conditions are percolated.
  2. If a Language Environment condition is triggered in JNI code as a result of an arithmetic operation, the VM condition handler resumes executing Java code as if the JNI native code had thrown a com.ibm.le.conditionhandling.ConditionException exception. This exception class is a subclass of java.lang.RuntimeException. Note: The Language Environment conditions that correspond to arithmetic operations are CEE3208S through CEE3234S. However, the Language Environment does not deliver conditions CEE3208S, CEE3213S, or CEE3234S to C applications, so the VM condition handler will not receive them.
  3. If the condition handling reaches this step, the condition is considered to be unrecoverable. RAS diagnostic information is generated, and the VM ends by calling the CEE3AB2() service with abend code 3565, reason code 0, and cleanup code 0.

Restriction: You cannot use -Xsignal:userConditionHandler=percolate and -XCEEHDLR together.

"},{"location":"xceehdlr/#see-also","title":"See also","text":""},{"location":"xcheck/","title":"-Xcheck","text":""},{"location":"xcheck/#-xcheck","title":"-Xcheck","text":"

You can use the -Xcheck option to run checks during Eclipse OpenJ9\u2122 virtual machine (VM) startup, such as memory checks or checks on JNI functions.

"},{"location":"xcheck/#syntax","title":"Syntax","text":"
    -Xcheck:<parameter>\n
"},{"location":"xcheck/#parameters","title":"Parameters","text":"Parameter Effect classpath Checks the classpath and reports errors such as a missing directory or JAR file. dump Checks the operating system for settings that might truncate system dumps. (AIX\u00ae and Linux\u00ae only) gc Runs additional checks on garbage collection. jni Runs additional checks for JNI functions. memory Identifies memory leaks inside the VM using strict checks that cause the VM to exit on failure. vm Performs additional checks on the VM."},{"location":"xcheck/#classpath","title":"classpath","text":"
    -Xcheck:classpath\n
Checks the classpath and reports errors such as a missing directory or JAR file."},{"location":"xcheck/#dump","title":"dump","text":"

AIX and Linux only

    -Xcheck:dump\n

Checks operating system settings during VM startup. Messages are issued if the operating system has settings that might truncate system dumps.

On AIX systems, the following messages are possible:

This message indicates that the AIX operating system user limit is set to restrict the size of system dumps to the value indicated. If a system dump is produced by the VM it might be truncated, and therefore of greatly reduced value in investigating the cause of crashes and other issues. For more information about how to set user limits on AIX, see Setting system resource limits on AIX and Linux systems. This message indicates that the AIX operating system Enable full CORE dumpoption is set to FALSE. This setting might result in truncated system dumps. For more information about how to set this option correctly on AIX, see Setting system resource limits on AIX and Linux systems.

On Linux systems, the following messages are possible:

This message indicates that the Linux operating system user limit is set to restrict the size of system dumps to the value indicated. If a system dump is produced by the VM, it might be truncated and therefore of greatly reduced value in investigating the cause of crashes and other issues. Review the documentation that is provided for your operating system to correctly configure the value for ulimits. For further information, see Setting system resource limits on AIX and Linux systems. This message means that an external program, abrt-hook-ccpp, is configured in the operating system to intercept any system dump files that are generated. This program is part of the Automatic Bug Reporting Tool (ABRT). For more information, see Automatic Bug Reporting Tool. This tool might interfere with the VM's system dump file processing by renaming or truncating system dumps. Review the configuration of the ABRT tool and messages that are written by the tool in/var/log/messages. If problems occur when generating system dumps from the VM, consider disabling ABRT. This message means that an external program, apport, is configured in the operating system to intercept any system dump files that are generated. For more information about this tool, see: Apport The tool might interfere with the VM's system dump file processing by renaming or truncating system dumps. Review the configuration of the Apport tool and messages that are written by the tool in /var/log/apport.log. If problems occur when generating system dumps from the VM, consider disabling the Apport tool. This message indicates that the Linux /proc/sys/kernel/core_pattern option is set to rename system dumps. The tokens that are used in the operating system dump name might interfere with the VM's system dump file processing, in particular with file names specified in the VM -Xdump options. If problems occur when generating system dumps from the VM, consider changing the /proc/sys/kernel/core_pattern setting to the default value of core."},{"location":"xcheck/#gc","title":"gc","text":"
    -Xcheck:gc[:help][:<scan options>][:<verify options>][:<misc options>]\n
Runs additional checks on garbage collection. By default, no checks are made. There are many scan, verify, and miscellaneous suboptions available. If you do not specify any, all possible scan and verify suboptions are run, plus the miscellaneous verbose and check suboptions. For more information, see the output of -Xcheck:gc:help."},{"location":"xcheck/#jni","title":"jni","text":"
    -Xcheck:jni[:help][:<option>]\n
Runs additional checks for JNI functions. By default, no checks are made. For more information, see the output of -Xcheck:jni:help."},{"location":"xcheck/#memory","title":"memory","text":"
    -Xcheck:memory[:<option>]\n
Identifies memory leaks inside the VM by using strict checks that cause the VM to exit on failure. Restriction: You cannot include -Xcheck:memory in the options file (see -Xoptionsfile).

The available parameters are as follows:

:all (Default if no options specified) Enables checking of all allocated and freed blocks on every free and allocate call. This check of the heap is the most thorough. It typically causes the VM to exit on nearly all memory-related problems soon after they are caused. This option has the greatest affect on performance. :callsite=<number_of_allocations>

Displays callsite information every <number_of_allocations>. De-allocations are not counted. Callsite information is presented in a table with separate information for each callsite. Statistics include:

Callsites are presented as sourcefile:linenumber for C code and assembly function name for assembler code.

Callsites that do not provide callsite information are accumulated into an \"unknown\" entry.

:failat=<number_of_allocations>

Causes memory allocation to fail (return NULL) after <number_of_allocations>. For example, setting <number_of_allocations> to 13 causes the 14th allocation to return NULL. De-allocations are not counted. Use this option to ensure that VM code reliably handles allocation failures. This option is useful for checking allocation site behavior rather than setting a specific allocation limit.

:ignoreUnknownBlocks Ignores attempts to free memory that was not allocated using the -Xcheck:memory tool. Instead, the -Xcheck:memory statistics that are printed out at the end of a run indicates the number of \"unknown\" blocks that were freed. :mprotect=[top|bottom] Locks pages of memory on supported platforms, causing the program to stop if padding before or after the allocated block is accessed for reads or writes. An extra page is locked on each side of the block returned to the user. If you do not request an exact multiple of one page of memory, a region on one side of your memory is not locked. The top and bottom options control which side of the memory area is locked. top aligns your memory blocks to the top of the page (lower address), so buffer underruns result in an application failure. bottom aligns your memory blocks to the bottom of the page (higher address) so buffer overruns result in an application failure. Standard padding scans detect buffer underruns when using top and buffer overruns when using bottom. :nofree Keeps a list of blocks that are already used instead of freeing memory. This list, and the list of currently allocated blocks, is checked for memory corruption on every allocation and deallocation. Use this option to detect a dangling pointer (a pointer that is \"dereferenced\" after its target memory is freed). This option cannot be reliably used with long-running applications (such as WebSphere\u00ae Application Server), because \"freed\" memory is never reused or released by the VM. :noscan Checks for blocks that are not freed. This option has little effect on performance, but memory corruption is not detected. This option is compatible only with subAllocator, callsite, and callsitesmall. :quick Enables block padding only and is used to detect basic heap corruption. Every allocated block is padded with sentinel bytes, which are verified on every allocate and free. Block padding is faster than the default of checking every block, but is not as effective. :skipto=<number_of_allocations> Causes the program to check only on allocations that occur after <number_of_allocations>. De-allocations are not counted. Use this option to speed up VM startup when early allocations are not causing the memory problem. The VM performs approximately 250+ allocations during startup. :subAllocator[=<size_in_MB>] Allocates a dedicated and contiguous region of memory for all VM allocations. This option helps to determine if user JNI code or the VM is responsible for memory corruption. Corruption in the VM subAllocator heap suggests that the VM is causing the problem; corruption in the user-allocated memory suggests that user code is corrupting memory. Typically, user and VM allocated memory are interleaved. :zero Newly allocated blocks are set to 0 instead of being filled with the 0xE7E7xxxxxxxxE7E7 pattern. Setting these blocks to 0 helps you to determine whether a callsite is expecting zeroed memory, in which case the allocation request is followed by memset(pointer, 0, size)."},{"location":"xcheck/#vm","title":"vm","text":"
    -Xcheck:vm[:<option>]\n
Performs additional checks on the VM. By default, no checking is performed. For more information, run -Xcheck:vm:help."},{"location":"xclassgc/","title":"-Xclassgc","text":""},{"location":"xclassgc/#-xclassgc-xnoclassgc","title":"-Xclassgc / -Xnoclassgc","text":"

These options enable or disable the garbage collection (GC) of storage that is associated with Java classes that are no longer being used by the Eclipse OpenJ9\u2122 VM.

When enabled, GC occurs only on class loader changes. To always enable dynamic class unloading regardless of class loader changes, set -Xalwaysclassgc.

Note: Disabling class GC is not recommended because unlimited native memory growth can occur, which can lead to out-of-memory errors.

"},{"location":"xclassgc/#syntax","title":"Syntax","text":"Setting Action Default -Xclassgc Enables dynamic class unloading on demand yes -Xnoclassgc Disables dynamic class unloading

These options can be used with all OpenJ9 GC policies.

"},{"location":"xclassgc/#see-also","title":"See also","text":""},{"location":"xcodecache/","title":"-Xcodecache","text":""},{"location":"xcodecache/#-xcodecache","title":"-Xcodecache","text":"

Use this option to tune performance.

This option sets the size of each block of memory that is allocated to store the native code of compiled Java\u2122 methods. By default, this size is selected internally according to the processor architecture and the capability of your system. The maximum value you can specify is 32 MB. If you set a value larger than 32 MB, the JIT ignores the input and sets the value to 32 MB.

Note: The JIT compiler might allocate more than one code cache for an application. Use the -Xcodecachetotal option to set the maximum amount of memory that is used by all code caches.

"},{"location":"xcodecache/#syntax","title":"Syntax","text":"
    -Xcodecache<size>\n
See Using -X command-line options for more information about specifying the <size> parameter."},{"location":"xcodecachetotal/","title":"-Xcodecachetotal","text":""},{"location":"xcodecachetotal/#-xcodecachetotal","title":"-Xcodecachetotal","text":"

Use this option to set the maximum size limit for the JIT code cache. This option also affects the size of the JIT data cache.

"},{"location":"xcodecachetotal/#syntax","title":"Syntax","text":"
    -Xcodecachetotal<size>\n

The default size is 256 MB for a 64-bit VM and 64 MB for a 31/32-bit VM.

See Using -X command-line options for more information about specifying the <size> parameter.

"},{"location":"xcodecachetotal/#explanation","title":"Explanation","text":"

By default, the total JIT code cache size is 256 MB for a 64-bit VM and 64 MB for a 31/32-bit VM or 25% of the physical memory available to the VM process, whichever is lesser. Long-running, complex, server-type applications can fill the JIT code cache, which can cause performance problems because not all of the important methods can be JIT-compiled. Use the -Xcodecachetotal option to increase or decrease the maximum code cache size to a setting that suits your application. The minimum size of the code cache is restricted to 2 MB.

The value that you specify is rounded up to a multiple of the code cache block size, as specified by the -Xcodecache option. If you specify a value for the -Xcodecachetotal option that is smaller than the default setting, that value is ignored.

When you use this option, the maximum size limit for the JIT data cache, which holds metadata about compiled methods, is increased or decreased proportionally to support the JIT compilations.

The maximum size limits, for both the JIT code and data caches, that are in use by the VM are shown in Javadump output. Look for lines that begin with 1STSEGLIMIT. Use this information together with verbose JIT tracing to determine suitable values for this option on your system. For example Javadump output, see Java dump: Storage Management (MEMINFO).

"},{"location":"xcodecachetotal/#see-also","title":"See also","text":""},{"location":"xcomp/","title":"-Xcomp","text":""},{"location":"xcomp/#-xcomp","title":"-Xcomp","text":"

The use of this option is deprecated; use -Xjit:count=0 instead.

"},{"location":"xcomp/#syntax","title":"Syntax","text":"
    -Xcomp\n
"},{"location":"xcompactexplicitgc/","title":"-Xcompactexplicitgc","text":""},{"location":"xcompactexplicitgc/#xcompactexplicitgc-xnocompactexplicitgc","title":"\u2011Xcompactexplicitgc / \u2011Xnocompactexplicitgc","text":"

These options enable or disable full compaction each time System.gc() is called.

Compaction takes place on global garbage collections if you specify -Xcompactgc or if compaction triggers are met.

"},{"location":"xcompactexplicitgc/#syntax","title":"Syntax","text":"Setting Action Default -Xcompactexplicitgc Enable compaction yes -Xnocompactexplicitgc Disable compaction"},{"location":"xcompactexplicitgc/#see-also","title":"See also","text":""},{"location":"xcompactgc/","title":"-Xcompactgc","text":""},{"location":"xcompactgc/#-xcompactgc-xnocompactgc","title":"-Xcompactgc / -Xnocompactgc","text":"

These options enable or disable full compaction on system and global garbage collection (GC) activities.

"},{"location":"xcompactgc/#syntax","title":"Syntax","text":"Setting Action -Xcompactgc Enable full compaction -Xnocompactgc Disable full compaction"},{"location":"xcompactgc/#default-behavior","title":"Default behavior","text":"

If a compaction option is not specified, the garbage collector compacts based on a series of triggers. These triggers attempt to compact only when it is beneficial to the future performance of the VM.

These options are not applicable to the following GC policies:

"},{"location":"xcompactgc/#see-also","title":"See also","text":""},{"location":"xcompilationthreads/","title":"-XcompilationThreads","text":""},{"location":"xcompilationthreads/#-xcompilationthreads","title":"-XcompilationThreads","text":"

Use this option to specify the number of compilation threads that are used by the JIT compiler.

"},{"location":"xcompilationthreads/#syntax","title":"Syntax","text":"
    -XcompilationThreads<n>\n
Where <n> is the number of threads. The minimum value is 1. The default and maximum values depend on whether the VM is running with the JITServer feature enabled and if so, whether the VM is running as a JITServer server, as shown in the following table: JIT compiler scenario Default value Maximum value JIT and JITServer client Determined by internal JIT heuristics that consider the number of CPUs that the VM is allowed to use 15 JITServer server 63 999 Any number outside this range is ignored. Setting the compilation threads to zero does not disable the JIT compiler. If you want to disable the JIT, use the -Xint option."},{"location":"xcompilationthreads/#explanation","title":"Explanation","text":"

When multiple compilation threads are used, the JIT might generate several diagnostic log files. A log file is generated for each compilation thread. The naming convention for the log file generated by the first compilation thread uses the following pattern:

<specified_filename>.<date>.<time>.<pid>\n

The first compilation thread has ID 0. Log files generated by the second and subsequent compilation threads append the ID of the corresponding compilation thread as a suffix to the log file name. The pattern for these log file names is as follows:

<specified_filename>.<date>.<time>.<pid>.<compilation_thread_ID>\n

For example, the second compilation thread has ID 1. The result is that the corresponding log file name has the form:

<specified_filename>.<date>.<time>.<pid>.1\n
"},{"location":"xcompilationthreads/#see-also","title":"See also","text":""},{"location":"xcompressedrefs/","title":"-Xcompressedrefs","text":""},{"location":"xcompressedrefs/#-xcompressedrefs-xnocompressedrefs","title":"-Xcompressedrefs / -Xnocompressedrefs","text":"

(64-bit only)

These options enable or disable the use of compressed references.

Restriction: You cannot include -Xcompressedrefs in the options file (see -Xoptionsfile).

"},{"location":"xcompressedrefs/#syntax","title":"Syntax","text":"Setting Action Default -Xcompressedrefs Enable compression yes (see Default behavior) -Xnocompressedrefs Disable compression"},{"location":"xcompressedrefs/#default-behavior","title":"Default behavior","text":"

Compressed references are enabled by default when -Xmx \u2264 57 GB.

z/OS\u00ae: This threshold value assumes that you have APAR OA49416 installed. If you do not have the APAR installed, the threshold value is 25 GB.

AIX\u00ae and Linux\u00ae: For the metronome garbage collection policy, the threshold is 25 GB.

"},{"location":"xcompressedrefs/#see-also","title":"See also","text":""},{"location":"xconcurrentbackground/","title":"-Xconcurrentbackground","text":""},{"location":"xconcurrentbackground/#-xconcurrentbackground","title":"-Xconcurrentbackground","text":"

Specifies the number of low-priority background threads that are attached to assist the mutator threads in concurrent mark operations. This option maps directly to the HotSpot -XX:ParallelCMSThreads=N and -XX:ConcGCThreads=N options.

"},{"location":"xconcurrentbackground/#syntax","title":"Syntax","text":"
    -Xconcurrentbackground<n>\n
"},{"location":"xconcurrentbackground/#default-behavior","title":"Default behavior","text":"

The default value is 1.

Note: This value is reported in the header section of a verbose GC log with the entry <attribute name=\"gcthreads Concurrent Mark\" value=\"1\" />.

This option is not supported with the balanced GC policy (-Xgcpolicy:balanced) or metronome GC policy (-Xgcpolicy:metronome).

"},{"location":"xconcurrentbackground/#see-also","title":"See also","text":""},{"location":"xconcurrentlevel/","title":"-Xconcurrentlevel","text":""},{"location":"xconcurrentlevel/#-xconcurrentlevel","title":"-Xconcurrentlevel","text":"

This option indicates the ratio between the amount of heap allocated and the amount of heap marked, which is known as the allocation tax rate.

"},{"location":"xconcurrentlevel/#syntax","title":"Syntax","text":"
    -Xconcurrentlevel<number>\n
"},{"location":"xconcurrentlevel/#default-behavior","title":"Default behavior","text":"

The default is 8.

This option is not supported with the balanced GC policy (-Xgcpolicy:balanced) or metronome GC policy (-Xgcpolicy:metronome).

"},{"location":"xconcurrentslack/","title":"-Xconcurrentslack","text":""},{"location":"xconcurrentslack/#-xconcurrentslack","title":"-Xconcurrentslack","text":"

Attempts to keep the specified amount of the heap space free in concurrent collectors by starting the concurrent operations earlier.

Using this option can sometimes alleviate pause time problems in concurrent collectors at the cost of longer concurrent cycles, affecting total throughput.

"},{"location":"xconcurrentslack/#syntax","title":"Syntax","text":"
    -Xconcurrentslack<size>\n
See Using -X command-line options for more information about specifying the <size> parameter."},{"location":"xconcurrentslack/#default-behavior","title":"Default behavior","text":"

The default value is 0, which is optimal for most applications.

This option is not supported with the balanced GC policy (-Xgcpolicy:balanced), the optimize for throughput policy (-Xgcpolicy:optthruput), or metronome GC policy (-Xgcpolicy:metronome).

"},{"location":"xconmeter/","title":"-Xconmeter","text":""},{"location":"xconmeter/#-xconmeter","title":"-Xconmeter","text":"

This option determines the usage of which area, LOA (large object area) or SOA (small object area), is metered and therefore which allocations are taxed during concurrent mark operations.

"},{"location":"xconmeter/#syntax","title":"Syntax","text":"
    -Xconmeter:<parameter>\n
"},{"location":"xconmeter/#parameters","title":"Parameters","text":""},{"location":"xconmeter/#soa","title":"soa","text":"
    -Xconmeter:soa\n
(Default) Applies the allocation tax to allocations from the small object area (SOA)."},{"location":"xconmeter/#loa","title":"loa","text":"
    -Xconmeter:loa\n
Applies the allocation tax to allocations from the large object area (LOA)."},{"location":"xconmeter/#dynamic","title":"dynamic","text":"
    -Xconmeter:dynamic\n
The collector dynamically determines which area to meter based on which area is exhausted first, whether it is the SOA or the LOA."},{"location":"xconmeter/#default-behavior","title":"Default behavior","text":"

By default, allocation tax is applied to the SOA.

This option is not supported with the balanced GC policy (-Xgcpolicy:balanced) or metronome GC policy (-Xgcpolicy:metronome).

"},{"location":"xdisablejavadump/","title":"-Xdisablejavadump","text":""},{"location":"xdisablejavadump/#-xdisablejavadump","title":"-Xdisablejavadump","text":"

Turns off Java dump generation on errors and signals.

"},{"location":"xdisablejavadump/#syntax","title":"Syntax","text":"
    -Xdisablejavadump\n
"},{"location":"xdisablejavadump/#default-behavior","title":"Default behavior","text":"

By default, Javadump generation is enabled.

"},{"location":"xdisablejavadump/#see-also","title":"See also","text":""},{"location":"xdump/","title":"-Xdump","text":""},{"location":"xdump/#-xdump","title":"-Xdump","text":"

OpenJ9 produces various types of diagnostic information for analysis when different events occur, such as a general protection fault. The dumps produced are controlled by dump agents, which are initialized when the OpenJ9 virtual machine (VM) starts. The default settings for the dump agents are sufficient for most cases. However, you can use the -Xdump option on the command line to fine tune the dump agent settings. For example, you can use the -Xdump option to add and remove dump agents for various VM events, update default dump settings, and limit the number of dumps that are produced.

A large set of options and suboptions are available for controlling dumps, which provides a lot of flexibility.

"},{"location":"xdump/#xdump-option-builder","title":"Xdump Option Builder","text":"

Use the Xdump Option Builder tool to help you specify the correct options and avoid incompatibilities.

"},{"location":"xdump/#syntax","title":"Syntax","text":"
    -Xdump:<parameter>\n

The following table lists the help options for -Xdump, which provide usage and configuration information:

Command Result -Xdump:help Displays general dump help. -Xdump:events Lists available trigger events. -Xdump:request Lists additional VM requests. -Xdump:tokens Lists recognized label tokens. -Xdump:what Shows registered agents on startup. -Xdump:<agent>:help Displays dump agent usage information.

The following options can be used to control the production of diagnostic data:

Parameter Result -Xdump:none Removes all default dump agents and any preceding dump options. -Xdump:dynamic Enable support for pluggable agents -Xdump:nofailover Discards dumps when the default or specified dump location is full. -Xdump:directory=<path> Specifies a directory for all dump types to be written to. This directory path is prefixed to the path of all non-absolute dump file names, including the file names for the default dump agents. -Xdump:suspendwith=<offset> Modifies the signal that is used to suspend VM threads while a dump file is being written. Use <offset> to change the default signal number. (Linux\u00ae only) -Xdump:<agent>:<suboptions> Provides detailed suboptions per dump agent that provide more granular control.

Dump agents can be configured at a very granular level by specifying suboptions. The <events> suboption is the prime trigger mechanism. If no events are specified explicitly, then the default settings for the corresponding agent are added. For more information, see Default dump agents. You can update the default dump settings by using the defaults suboption. The full set of suboptions are listed in the following table:

Dump agent suboptions Result -Xdump:<agent>:none Removes the dump agent. -Xdump:<agent>:defaults Prints the default options for the dump agent. -Xdump:<agent>:events=<events> Triggers a dump agent when a specific event occurs. -Xdump:<agent>:exec=<command> Starts an external application for the dump agent. -Xdump:<agent>:file=<filename> Specifies where to write the dump for the dump agent. -Xdump:<agent>:filter=<filter> Filters dumps by wildcards or events. -Xdump:<agent>:msg_filter=<filter> Filters on text strings within an exception message. -Xdump:<agent>:opts=<options> Used by specific dump agents to select the type of dump file to produce. -Xdump:<agent>:priority=<0-999> Specifies the priority that the dump agents run in. -Xdump:<agent>:range=<ranges> Starts and stops a dump agent on a particular occurrence of a VM. -Xdump:<agent>:request=<requests> Asks the VM to prepare the state before starting the dump agent.

You can have multiple -Xdump options on the command line. You can also have multiple dump types triggered by multiple events. For example, the following command turns off the creation of heap dump files, and creates a dump agent that produces a heap dump file and a Java\u2122 dump file when either a vmstart or vmstop event occurs:

java -Xdump:heap:none -Xdump:heap+java:events=vmstart+vmstop -mp . -m <class> [args...]\n

Note: Multiple suboptions that follow an Xdump suboption must be split with a comma (,), for example:

java -Xdump:java:events=vmstart,file=/STDERR/ -version\n

For more detailed information on these parameters and suboptions, including examples, see Parameters.

"},{"location":"xdump/#dump-agents","title":"Dump agents","text":"

A dump agent performs diagnostic tasks when triggered. Most dump agents save information on the state of the VM in some form of dump or trace file for later analysis. An exception is the \"tool\" agent, which can be used to trigger external processes when specific events occur.

Dump agent Description stack Stack dumps are very basic dumps in which the status and Java stack of the thread is written to stderr. console Console dumps are very basic dumps, in which the status of every Java thread is written to stderr. system System dumps capture the raw process image or address space of an application. tool The tool option allows external processes to be started when an event occurs. java Java dumps are an internally generated and formatted analysis of the VM, giving information that includes the Java threads present, the classes loaded, and heap statistics. heap Heap dumps capture all object instances in the heap, including each object address, type or class name, size, and references to other objects. snap Take a snap of the trace buffers, which contain tracepoint data. ceedump LE CEEDUMP dumps are z/OS\u00ae formatted summary system dumps that show stack traces for each thread that is in the VM process, together with register information and a short dump of storage for each register. jit JIT compiler dumps contain diagnostic data in a binary format. exit Shut down the VM."},{"location":"xdump/#default-dump-agents","title":"Default dump agents","text":"

During VM initialization a set of dump agents are added by default. You can override this set of dump agents using -Xdump on the command line. To show the registered dump agents, user the Xdump:what option on the command line. The following sample output shows the default dump agents that are in place on a Linux system:

java -Xdump:what\n\nRegistered dump agents\n----------------------\n-Xdump:system:\n    events=gpf+abort+traceassert+corruptcache,\n    file=/home/user/core.%Y%m%d.%H%M%S.%pid.%seq.dmp,\n    range=1..0,\n    priority=999,\n    request=serial\n----------------------\n-Xdump:system:\n    events=systhrow,\n    filter=java/lang/OutOfMemoryError,\n    file=/home/user/core.%Y%m%d.%H%M%S.%pid.%seq.dmp,\n    range=1..1,\n    priority=999,\n    request=exclusive+compact+prepwalk\n----------------------\n-Xdump:heap:\n    events=systhrow,\n    filter=java/lang/OutOfMemoryError,\n    file=/home/user/heapdump.%Y%m%d.%H%M%S.%pid.%seq.phd,\n    range=1..4,\n    priority=500,\n    request=exclusive+compact+prepwalk,\n    opts=PHD\n----------------------\n-Xdump:java:\n    events=gpf+user+abort+traceassert+corruptcache,\n    file=/home/user/javacore.%Y%m%d.%H%M%S.%pid.%seq.txt,\n    range=1..0,\n    priority=400,\n    request=exclusive+preempt\n----------------------\n-Xdump:java:\n    events=systhrow,\n    filter=java/lang/OutOfMemoryError,\n    file=/home/user/javacore.%Y%m%d.%H%M%S.%pid.%seq.txt,\n    range=1..4,\n    priority=400,\n    request=exclusive+preempt\n----------------------\n-Xdump:snap:\n    events=gpf+abort+traceassert+corruptcache,\n    file=/home/user/Snap.%Y%m%d.%H%M%S.%pid.%seq.trc,\n    range=1..0,\n    priority=300,\n    request=serial\n----------------------\n-Xdump:snap:\n    events=systhrow,\n    filter=java/lang/OutOfMemoryError,\n    file=/home/user/Snap.%Y%m%d.%H%M%S.%pid.%seq.trc,\n    range=1..4,\n    priority=300,\n    request=serial\n----------------------\n-Xdump:jit:\n    events=gpf+abort,\n    file=/home/user/jitdump.%Y%m%d.%H%M%S.%pid.%seq.dmp,\n    range=1..0,\n    priority=200,\n    request=serial\n----------------------\n
"},{"location":"xdump/#dump-agent-tokens","title":"Dump agent tokens","text":"

You can use tokens to add context to dump file names and directories, and to pass command-line arguments to the tool agent. The tokens available are listed in the following tables:

Token Description %Y Year (4 digits) %y Year (2 digits) %m Month (2 digits) %d Day of the month (2 digits) %H Hour (2 digits) %M Minute (2 digits) %S Second (2 digits) %home Java home directory %last Last dump %pid Process ID %seq Dump counter %tick msec counter %uid User name

The following tokens are applicable only to z/OS:

Token Description %asid Address space ID %job Job name %jobid Job ID %sysname SYSNAME sysparm &DS Dump Section. An incrementing sequence number used for splitting TDUMP files to be less than 2 GB in size. (64-bit only)"},{"location":"xdump/#merging-dump-agents","title":"Merging dump agents","text":"

If you configure more than one dump agent, each responds to events according to its configuration. However, the internal structures representing the dump agent configuration might not match the command line because dump agents are merged for efficiency. Two sets of options can be merged as long as none of the agent settings conflict. This means that the list of installed dump agents and their parameters produced by -Xdump:what might not be grouped in the same way as the original -Xdump options that configured them.

For example, you can use the following command to specify that a dump agent creates a Java dump file on class unload:

java -Xdump:java:events=unload -Xdump:what\n

This command does not create a new agent, as can be seen in the results from the -Xdump:what option.

...\n----------------------\n-Xdump:java:\n    events=gpf+user+abort+unload+traceassert+corruptcache,\n    file=/home/user/javacore.%Y%m%d.%H%M%S.%pid.%seq.txt,\n    range=1..0,\n    priority=400,\n    request=exclusive+preempt\n----------------------\n

The configuration is merged with the existing Java dump agent for events gpf, user, abort, traceassert, and corruptcache, because none of the specified options for the new unload agent conflict with those for the existing agent.

In the previous example, if one of the parameters for the unload agent is changed so that it conflicts with the existing agent, then it cannot be merged. For example, the following command specifies a different priority, forcing a separate agent to be created:

java -Xdump:java:events=unload,priority=100 -Xdump:what\n

The results of the -Xdump:what option in the command are as follows.

...\n----------------------\n-Xdump:java:\n    events=unload,\n    file=/home/user/javacore.%Y%m%d.%H%M%S.%pid.%seq.txt,\n    range=1..0,\n    priority=100,\n    request=exclusive+preempt\n----------------------\n-Xdump:java:\n    events=gpf+user+abort+traceassert+corruptcache,\n    file=/home/user/javacore.%Y%m%d.%H%M%S.%pid.%seq.txt,\n    range=1..0,\n    priority=400,\n    request=exclusive+preempt\n----------------------\n

To merge dump agents, the request, filter, opts, file, and range parameters must match exactly. If you specify multiple agents that filter on the same string, but keep all other parameters the same, the agents are merged. For example:

java -Xdump:none -Xdump:java:events=uncaught,filter=java/lang/NullPointerException -Xdump:java:events=unload,filter=java/lang/NullPointerException -Xdump:what\n

The results of this command are as follows:

Registered dump agents\n----------------------\n-Xdump:java:\n    events=unload+uncaught,\n    filter=java/lang/NullPointerException,\n    file=/home/user/javacore.%Y%m%d.%H%M%S.%pid.%seq.txt,\n    range=1..0,\n    priority=400,\n    request=exclusive+preempt\n----------------------\n
"},{"location":"xdump/#dump-events","title":"Dump events","text":"

Dump agents are triggered by events occurring during operation of the OpenJ9 VM. Some events can be filtered to improve the relevance of the output.

The following table shows the events that are available as dump agent triggers:

Event Triggered when.... Filters on.... gpf A General Protection Fault (GPF) occurs. Not applicable user The VM receives the SIGQUIT (Linux, macOS\u00ae, AIX\u00ae, z/OS) or SIGBREAK (Windows\u2122) signal from the operating system. Not applicable user2 The VM receives the SIGUSR2 (Linux, AIX, z/OS, and macOS) signal from the operating system. Not applicable abort The VM receives the SIGABRT signal from the operating system. Not applicable vmstart The virtual machine is started. Not applicable vmstop The virtual machine stops. Exit code; for example, filter=#129..#192#-42#255 load A class is loaded. Class name; for example, filter=java/lang/String unload A class is unloaded. Not applicable throw An exception is thrown explicitly in Java code. Use 'systhrow' for unexpected VM exceptions. Exception class name; for example, filter=java/lang/OutOfMem* catch An exception is caught. Exception class name; for example, filter=*Memory* uncaught A Java exception is not caught by the application. Exception class name; for example, filter=*MemoryError systhrow A Java exception is about to be thrown by the VM. This is different from the 'throw' event because it is only triggered for error conditions detected internally in the VM. Exception class name; for example, filter=java/lang/OutOfMem*. thrstart A new thread is started. Not applicable blocked A thread becomes blocked. Not applicable thrstop A thread stops. Not applicable fullgc A garbage collection cycle is started. Not applicable slow A thread takes longer than 50 ms to respond to an internal VM request. Time taken; for example, filter=#300ms will trigger when a thread takes longer than 300 ms to respond to an internal VM request. allocation A Java object is allocated with a size matching the given filter specification. Object size; a filter must be supplied. For example, filter=#5m will trigger on objects larger than 5 Mb. Ranges are also supported; for example, filter=#256k..512k will trigger on objects 256 - 512 Kb in size. traceassert An internal error occurs in the VM. Not applicable corruptcache The VM finds that the shared classes cache is corrupt. Not applicable excessivegc An excessive amount of time is being spent in the garbage collector. Not applicable

Notes:

-Xdump:system:events=user2,request=exclusive+prepwalk\n
"},{"location":"xdump/#parameters","title":"Parameters","text":"

-Xdump:<agent>:<suboptions> descriptions and examples.

"},{"location":"xdump/#help","title":"help","text":"

To print usage information for a specific dump agent, use -Xdump:<agent>:help

"},{"location":"xdump/#noneoptions","title":"none:<options>","text":"

Use the -Xdump:none option to add and remove dump agents for various VM events, update default dump settings (such as the dump name), and limit the number of dumps that are produced.

The option can be used to affect all agents by specifying -Xdump:none:<options> or specific agents by specifying -Xdump:<agent>:none:<suboptions>

where <suboptions> is one of the following control types:

Explanations for these suboptions are provided elsewhere in this topic.

To remove all default dump agents and any preceding dump options, use -Xdump:none. Use this option so that you can subsequently specify a completely new dump configuration.

You can also remove dump agents of a particular type. Here are some examples:

To turn off all heap dumps (including default agents) but leave Java dumps enabled, use the following option:

-Xdump:java+heap:events=vmstop -Xdump:heap:none\n

To turn off all dump agents for corruptcache events:

-Xdump:none:events=corruptcache\n

To turn off just system dumps for corruptcache events:

-Xdump:system:none:events=corruptcache\n

To turn off all dumps when a java/lang/OutOfMemory error is thrown:

-Xdump:none:events=systhrow,filter=java/lang/OutOfMemoryError\n

To turn off just system dumps when a java/lang/OutOfMemory error is thrown:

-Xdump:system:none:events=systhrow,filter=java/lang/OutOfMemoryError\n

If you remove all dump agents by using -Xdump:none with no further -Xdump options, the VM still provides these basic diagnostic outputs:

Note: Removing dump agents and specifying a new dump configuration can require a long set of command-line options. To reuse command-line options, save the new dump configuration in a file and use the -Xoptionsfile option. For more information, see -Xoptionsfile.

"},{"location":"xdump/#defaults","title":"defaults","text":"

Each dump type has default options. To view the default options for a particular dump type, use -Xdump:<agent>:defaults.

You can change the default options at run time. For example, you can direct Java dump files into a separate directory for each process, and guarantee unique files by adding a sequence number to the file name using:

-Xdump:java:defaults:file=dumps/%pid/javacore-%seq.txt\n

Or, for example, on z/OS, you can add the jobname to the Java dump file name using:

-Xdump:java:defaults:file=javacore.%job.%H%M%S.txt\n

This option does not add a Java dump agent; it updates the default settings for Java dump agents. Further Java dump agents will then create dump files using this specification for filenames, unless overridden.

Note: Changing the defaults for a dump type will also affect the default agents for that dump type added by the VM during initialization. For example, if you change the default file name for Java dump files, that will change the file name used by the default Java dump agents. However, changing the default range option will not change the range used by the default Java dump agents, because those agents override the range option with specific values.

"},{"location":"xdump/#eventsevent","title":"events=<event>","text":"

To trigger a dump as a result of an event, use the -Xdump:<agent>:events=<event> suboption. For a list of possible events, see Dump events.

For example, the following command instructs the VM to create a dump agent at startup that produces a Heap dump whenever the vmstop event happens:

-Xdump:heap:events=vmstop\n
"},{"location":"xdump/#execcommand","title":"exec=<command>","text":"

The exec suboption is used by the tool dump agent to specify an external application to start. You can set a specific command to run for a particular dump agent with the following command:

-Xdump:<agent>:exec=<command>\n
"},{"location":"xdump/#filefilename","title":"file=<filename>","text":"

The file suboption specifies where the diagnostics information is written for the specified dump type. The syntax is -Xdump:<agent>:file=<filename>.

For example, to create a Heap dump called my.dmp when a vmstop event is received, use:

java -Xdump:heap:events=vmstop,file=my.dmp\n

When producing system dump files on z/OS platforms, use the dsn option instead of the file option. For example:

java -Xdump:system:events=vmstop,dsn=%uid.MYDUMP\n
"},{"location":"xdump/#writing-to-stdoutstderr","title":"Writing to STDOUT/STDERR","text":"

Add one of the following options to write a Java dump file to STDOUT or STDERR respectively:

-Xdump:java:file=/STDOUT/\n-Xdump:java:file=/STDERR/\n
"},{"location":"xdump/#tokens","title":"Tokens","text":"

You can use tokens to add context to dump file names. For a list of tokens, see Dump agent tokens.

"},{"location":"xdump/#file-location","title":"File location","text":"

The location for the dump file is selected from the following options, in this order:

  1. The location specified by the -Xdump:<agent>:file suboption on the command line (if that location includes a path). This location applies to the specified dump agent type only.
  2. The location specified by the -Xdump:directory option on the command line. This location applies to all dump agent types.
  3. The location specified by the relevant environment variable:

    Dump agent type z/OS operating systems Other operating systems Java dumps _CEE_DMPTARG IBM_JAVACOREDIR Heap dumps _CEE_DMPTARG IBM_HEAPDUMPDIR System dumps JAVA_DUMP_TDUMP_PATTERN IBM_COREDIR JIT dumps _CEE_DMPTARG IBM_COREDIR Snap traces _CEE_DMPTARG IBM_COREDIR
  4. The current working directory of the OpenJ9 VM process.

If the directory does not exist, it is created.

If the dump file cannot be written to the selected location, the VM reverts to using the following locations, in this order:

  1. On Windows platforms only, the system default location is C:\\WINDOWS.
  2. The location specified by the TMPDIR environment variable.
  3. The C:\\Temp on Windows operating systems, or the /tmp directory on other operating systems.

This VM action does not apply to system dumps on z/OS operating systems that use the dsn option. You can prevent the VM reverting to different dump locations by using the -Xdump:nofailover option.

"},{"location":"xdump/#filterfilter","title":"filter=<filter>","text":"

Some VM events occur thousands of times during the lifetime of an application. Dump agents can use filters and ranges to avoid producing an excessive number of dump files. The following syntax must be used:

-Xdump:<agent>:filter=<filter>\n
"},{"location":"xdump/#wildcards","title":"Wildcards","text":"

You can use a wildcard in your exception event filter by placing an asterisk only at the beginning or end of the filter. The following command does not work because the second asterisk is not at the end:

-Xdump:java:events=throw,filter=*InvalidArgumentException#*.myVirtualMethod\n

To fix the problem, change this filter to the following string:

-Xdump:java:events=throw,filter=*InvalidArgumentException#MyApplication.*\n
"},{"location":"xdump/#class-loading-and-exception-events","title":"Class loading and exception events","text":"

You can filter class loading (load) and exception (throw, catch, uncaught, systhrow) events by the name of the class that is being loaded, thrown or caught. For example:

-Xdump:java:events=load,filter=java/lang/String\n-Xdump:java:events=throw,filter=java/lang/ArrayStoreException\n-Xdump:java:events=catch,filter=java/lang/NullPointerException\n

In addition, you can filter throw, uncaught, and systhrow exception events by the name of the method that throws the exception. The name of the parent class must include the full package name, using the forward slash (/) as a separator. Use a dot (.) to separate the method name from the class name. You can use an asterisk (*) as a wildcard character, to include all methods (optional portions are shown in brackets). For example:

-Xdump:java:events=throw,filter=ExceptionClassName[#com/ibm/ThrowingClassName.throwingMethodName[#stackFrameOffset]]\n

For example, to trigger a Java dump when method MyApplication.myMethod() throws a NullPointerException exception, use the following syntax:

-Xdump:java:events=throw,filter=java/lang/NullPointerException#com/ibm/MyApplication.myMethod\n

The stack frame offset allows you to filter on the name of a method that calls the throwing method. This option is useful if the exception is being thrown from a general purpose or utility class. For example, to trigger a Java dump when a method called by MyApplication.main() throws a NullPointerException, use the following syntax:

-Xdump:java:events=throw,filter=java/lang/NullPointerException#com/ibm/MyApplication.main#1\n

The default value of the stack frame offset is zero.

You can filter the catch exception events by Java method name (optional portions are shown in brackets). For example:

-Xdump:java:events=catch,filter=ExceptionClassName[#com/ibm/CatchingClassName.catchingMethodName]\n

You can filter throw, uncaught, and systhrowexception events by Java method name (optional portions are shown in brackets):

-Xdump:java:events=throw,filter=ExceptionClassName[#com/ibm/ThrowingClassName.throwingMethodName[#stackFrameOffset]]\n

You can filter the catch exception events by Java method name (optional portions are shown in brackets):

-Xdump:java:events=catch,filter=ExceptionClassName[#com/ibm/CatchingClassName.catchingMethodName]\n

Note: The filters apply to the stacktrace and fire every time the same exception is rethrown, which might result in multiple Java core files.

"},{"location":"xdump/#vmstop-event","title":"vmstop event","text":"

You can filter the VM shut down event (vmstop) by using one or more exit codes:

-Xdump:java:events=vmstop,filter=#129..192#-42#255\n
"},{"location":"xdump/#slow-event","title":"slow event","text":"

You can filter the slow event to change the time threshold from the default of 50 ms:

-Xdump:java:events=slow,filter=#300ms\n
"},{"location":"xdump/#allocation-event","title":"allocation event","text":"

You must filter the allocation event to specify the size of objects that cause a trigger. You can set the filter size from zero up to the maximum value of a 32-bit pointer on 32-bit platforms, or the maximum value of a 64-bit pointer on 64-bit platforms. Setting the lower filter value to zero triggers a dump on all allocations.

For example, to trigger dumps on allocations greater than 5 Mb in size, use:

-Xdump:stack:events=allocation,filter=#5m\n

To trigger dumps on allocations between 256 Kb and 512 Kb in size, use:

-Xdump:stack:events=allocation,filter=#256k..512k\n
"},{"location":"xdump/#other-events","title":"Other events","text":"

If you apply a filter to an event that does not support filtering, the filter is ignored.

"},{"location":"xdump/#msg_filterfilter","title":"msg_filter=<filter>","text":"

You can use the msg_filter suboption to filter on text strings within an exception message, allowing you to reduce the number of dump files produced. This option is supported only for the following events: throw, catch, systhrow, and uncaught.

Use the following syntax to include message filtering in your dump output:

-Xdump:<agent>:events=<event>,msg_filter=<filter>`\n

where <filter> is a text string from the exceptions that you want to include in the dump file. This suboption supports asterisks as wild cards.

The following example filters java/lang/VerifyError exceptions that contain the text string class format:

-Xdump:java:events=throw,filter=java/lang/VerifyError,msg_filter=*class format*\n
"},{"location":"xdump/#optsoptions","title":"opts=<options>","text":"

The full syntax is -Xdump:<agent>:opts=<options>.

The heap dump agent uses this suboption to specify the type of file to produce. On z/OS, the system dump agent uses this suboption to specify the type of dump to produce.

"},{"location":"xdump/#heap-dumps","title":"Heap dumps","text":"

You can specify a PHD heap dump file (PHD), a classic text heap dump file (CLASSIC), or both. The default is a PHD file. For example:

-Xdump:heap:opts=PHD  \n-Xdump:heap:opts=CLASSIC\n-Xdump:heap:opts=PHD+CLASSIC\n
"},{"location":"xdump/#zos-system-dumps","title":"z/OS system dumps","text":"

You can specify a system transaction dump (IEATDUMP), an LE dump (CEEDUMP), or both. The default is an IEADUMP file. For example:

-Xdump:system:opts=IEATDUMP\n-Xdump:system:opts=CEEDUMP\n-Xdump:system:opts=IEATDUMP+CEEDUMP\n

The ceedump agent is the preferred way to specify LE dumps, for example:

-Xdump:ceedump:events=gpf\n
"},{"location":"xdump/#tool-dumps","title":"Tool dumps","text":"

The tool dump agent supports two suboptions that can be specified using the opts subption. You can run the external process asynchronously with opts=ASYNC. You can also specify a delay in milliseconds that produces a pause after starting the command. These two options can be used independently or together. The following examples show different options for starting a new process that runs myProgram:

-Xdump:tool:events=vmstop,exec=myProgram\n

Without the opts suboption, the tool dump agent starts the process, and waits for the process to end before continuing.

-Xdump:tool:events=vmstop,exec=myProgram,opts=ASYNC\n

When opts=ASYNC is specified, the tool dump agent starts the process, and continues without waiting for the new process to end.

-Xdump:tool:events=vmstop,exec=myProgram,opts=WAIT1000\n

This option starts the process, waits for the process to end, and then waits a further 1 second (1000 milliseconds) before continuing.

-Xdump:tool:events=vmstop,exec=myProgram,opts=ASYNC+WAIT10000\n

Finally, the last example starts the process and waits for 10 seconds before continuing, whether the process is still running or not. This last form is useful if you are starting a process that does not end, but requires time to initialize properly.

"},{"location":"xdump/#priority0-999","title":"priority=<0-999>","text":"

One event can generate multiple dump files. The agents that produce each dump file run sequentially and their order is determined by the priority keyword set for each agent. The full syntax for this command is -Xdump:<agent>:priority=<0-999>.

Examination of the output from -Xdump:what shows that a gpf event produces a snap trace, a Java dump file, and a system dump file. In this example, the system dump runs first, with priority 999. The snap dump runs second, with priority 500. The Java dump runs last, with priority 10:

-Xdump:heap:events=vmstop,priority=123\n

The maximum value allowed for priority is 999. Higher priority dump agents are started first.

If you do not specifically set a priority, default values are taken based on the dump type. The default priority and the other default values for a particular type of dump, can be displayed by using -Xdump:<type>:defaults. For example:

java -Xdump:heap:defaults -version\n

Default -Xdump:heap settings:

  events=gpf+user\n  filter=\n  file=/home/user/heapdump.%Y%m%d.%H%M%S.%pid.phd\n  range=1..0\n  priority=500\n  request=exclusive+compact+prepwalk\n  opts=PHD\n
"},{"location":"xdump/#rangeranges","title":"range=<ranges>","text":"

You can start and stop dump agents on a particular occurrence of a VM event by using the range suboption: -Xdump:<agent>:range=<ranges>

For example:

-Xdump:java:events=fullgc,range=100..200\n

Note: range=1..0 against an event means \"on every occurrence\".

The VM default dump agents have the range suboption set to 1..0 for all events except systhrow. Most systhrow events with filter=java/lang/OutOfMemoryError have the range suboption set to 1..4, which limits the number of dump files produced on OutOfMemory conditions to a maximum of 4. For more information, see Default dump agents.

If you add a new dump agent and do not specify the range, a default of 1..0 is used.

"},{"location":"xdump/#requestrequests","title":"request=<requests>","text":"

Use the request suboption to ask the VM to prepare the state before starting the dump agent: -Xdump:<agent>:request=<requests>

The available suboptions are listed in the following table:

suboption value Description exclusive Request exclusive access to the VM. compact Run garbage collection. This option removes all unreachable objects from the heap before the dump file is generated. prepwalk Prepare the heap for walking. You must also specify exclusive when you use this option. serial Suspend other dumps until this dump is finished. preempt Applies to the Java dump agent and controls whether native threads in the process are forcibly pre-empted in order to collect stack traces. If this option is not specified, only Java stack traces are collected in the Java dump.

You can specify more than one request option by using +. For example:

-Xdump:heap:request=exclusive+compact+prepwalk\n

The VM exclusive access mechanism allows a VM thread to halt the activity of other VM threads in a controlled way by using internal VM locks. When the request=exclusive option is specified for a dump agent, the VM thread that is producing the dump waits for threads that are running Java code to halt, and for garbage collection operations to complete, before the dump file is written. This process helps ensure that the dump has consistent data. When the dump is complete, the mechanism allows the other threads to resume.

By default, only system dumps for OutOfMemoryError exceptions request exclusive access. Other system dump events typically result from a crash. In these cases, exclusive access is not requested because acquiring locks during a crash can be problematic.

If system dumps are requested by using the com.ibm.jvm.Dump.SystemDump() API, the default system dump agent settings are used, and exclusive access is not requested. However, if you intend to use the system dump file for Java heap memory analysis, use the following option to request exclusive access when the dump is taken:

-Xdump:system:defaults:request=exclusive+compact+prepwalk\n

These settings avoid capturing a dump file with in-flight data during garbage collection. As an alternative, you can use the com.ibm.jvm.Dump.triggerDump() API and specify request=exclusive+compact+prepwalk on the API call.

For more information about the com.ibm.jvm.Dump API, see the API reference information.

The default setting of the request suboption for Java dump files is request=exclusive+preempt. To change the settings so that Java dump files are produced without pre-empting threads to collect native stack traces, use the following option:

-Xdump:java:request=exclusive\n

The Java dump agent ignores the request=exclusive setting if a user event occurs and another event already has exclusive access. In this scenario, the Java dump agent shares the access instead. This behavior is useful because it allows you to obtain a Java dump file during a deadlock situation, when exclusive access is not released. However, the resulting Java dump file, even in other situations, might omit thread stacks and contain inconsistent thread information, as indicated by the following line in the file:

1TIPREPINFO    Exclusive VM access not taken: data may not be consistent across javacore sections\n

On operating systems other than Windows, you can enforce exclusive access and obtain a complete dump file by specifying that the user2 event triggers the Java dump agent instead of the user event. For example:

-Xdump:java:events=user2,request=exclusive+preempt\n

When a user2 event occurs, for example, when you enter kill -USR2 <pid> on the command line, the Java dump agent accepts the request=exclusive setting and waits for exclusive access before creating the Java dump file.

For more information about events, see Dump events.

In general, the default request options are sufficient.

"},{"location":"xdump/#dump-output","title":"Dump output","text":"

Dump output is written to different files, depending on the type of dump and the platform. File names include a time stamp.

Dump type File name (AIX, Linux, macOS, Windows) File name (z/OS) System dump core.%Y%m%d.%H%M%S.%pid.dmp %uid.JVM.TDUMP.%job.D%Y%m%d.T%H%M%S (31-bit), %uid.JVM.%job.D%y%m%d.T%H%M%S.X&DS (64-bit) See Note Java dump javacore.%Y%m%d.%H%M%S.%pid.%seq.txt javacore.%Y%m%d.%H%M%S.%pid.%seq.txt Heap dump heapdump.%Y%m%d.%H%M%S.%pid.phd heapdump.%Y%m%d.T%H%M%S.phd JIT dump jitdump%Y%m%d.%H%M%S.%pid.%seq.dmp jitdump%Y%m%d.%H%M%S.%pid.%seq.dmp LE CEEDUMP - CEEDUMP.%Y%m%d.%H%M%S.%pid See Note

The tokens used in this table, for example %Y, are described in Dump agent tokens.

Note: On z/OS, the system dump file name can be set with the JAVA_DUMP_TDUMP_PATTERN environment variable. The CEEDUMP, which is not produced by default, is stored in the directory specified by _CEE_DMPTARG or the current directory if _CEE_DMPTARG is not specified.

"},{"location":"xdump/#system-dumps-on-linux","title":"System dumps on Linux","text":"

Linux does not provide an operating system API for generating a system dump from a running process. The VM produces system dumps on Linux by using the fork() API to start an identical process to the parent VM process. The VM then generates a SIGSEGV signal in the child process. The SIGSEGV signal causes Linux to create a system dump for the child process. The parent VM processes and renames the system dump, as required, by the -Xdump options, and might add additional data into the dump file.

The system dump file for the child process contains an exact copy of the memory areas used in the parent. The dump viewer can obtain information about the Java threads, classes, and heap from the system dump. However, the dump viewer, and other system dump debuggers show only the single native thread that was running in the child process.

You can use the Linux kernel.core_pattern setting to specify the name and path for system dumps. The VM dump agents override the Linux system dump name and path by renaming the dump as specified in the -Xdump options. If the kernel.core_pattern setting specifies a different file system to the -Xdump options, the VM dump agents might be unable to change the file path. In this case the VM renames the dump file, but leaves the file path unchanged. You can find the dump file name and location in the JVMDUMP010I message.

Note: If you use the %t specifier in the kernel.core_pattern setting, the VM does not rename the dump. The VM cannot determine the exact time that Linux generated the core file, and therefore cannot be certain which Linux dump file is the correct one to rename.

"},{"location":"xdump/#piped-system-dumps","title":"Piped system dumps","text":"

The Linux option, kernel.core_pattern=|<program>, might be set to pipe system dumps to a system dump processing program (specified by <program>). If such a program is specified and the VM cannot find the system dump, you will see the following messages:

These messages do not necessarily indicate a problem with the system dump. Review the documentation for the program listed in the kernel.core_pattern property to find the location of the system dump and how to configure the program to ensure that the dump file is not truncated.

You can find the current setting of kernel.core_pattern by running one of the following commands. For example,

$ cat /proc/sys/kernel/core_pattern\n|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h\n
$ sysctl kernel.core_pattern\nkernel.core_pattern = |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h\n

The kernel.core_pattern setting is also available in a Java dump. For example:

2CISYSINFO     /proc/sys/kernel/core_pattern = |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h\n

Here are some of the most common system dump processing programs and their default system dump locations:

In container environments, such as OpenShift, piped system dump files are stored in the worker node rather than in the container. Here is one example method for retrieving a dump file that was piped to the systemd-coredump program:

  1. To access the system dump files, you must have access to the cluster as a user that has the cluster-admin role.
  2. Find the worker node of the pod. For example:

    oc get pod --namespace MyNamespace --output \"jsonpath={.spec.nodeName}{'\\n'}\" MyPodname

    Where, MyNamespace and MyPodname are names of your namespace and pod.

  3. Start a debug pod on the worker node. For example:

    oc debug node/MyNode -t

    Where, MyNode is the worker node retrieved in step 2.

  4. List the available system dump files. For example:

#chroot /host coredumpctl\n\nTIME                             PID        UID   GID SIG COREFILE  EXE\n\nWed 2022-08-03 18:52:29 UTC  2923161 1000650000     0  11 present   /opt/java/semeru/jre/bin/java\n
  1. Find the line for the system dump that you want to download, copy the PID number from that row, and then pass it to the info sub-command to search for the dump location. For example:
# chroot /host coredumpctl info 2923161 | grep Storage:\nStorage: /var/lib/systemd/coredump/core.kernel-command-.1000650000.08b9e28f46b348f3aabdffc6896838e0.2923161.1659552745000000.lz4\n
  1. Run a command to print output on a loop so that the debug pod doesn't timeout:

    while true; do echo 'Sleeping'; sleep 8; done

  2. Open a new terminal and then find the debug pod and namespace. For example:

$ oc get pods --field-selector=status.phase==Running --all-namespaces | grep debug\nopenshift-debug-node-pwcn42r47f       worker3-debug       1/1     Running            0                  3m38s\n
  1. Use the namespace (first column) and pod name (second column) that you retrieved in step 7 to download the system dump file from the Storage location that was listed in the output of step 5 on the worker node. Ensure that you prefix the Storage location with /host/. For example:
oc cp --namespace openshift-debug-node-pwcn42r47f worker3-debug:/host/var/lib/systemd/coredump/core.kernel-command-.1000650000.08b9e28f46b348f3aabdffc6896838e0.2923161.1659552745000000.lz4 core.dmp.lz4\n

This example stores the system dump locally in a compressed file, core.dmp.lz4.

  1. After the download completes, in the first terminal window, exit the loop by pressing Ctrl+C and end the debug pod by typing exit.
"},{"location":"xdump/#see-also","title":"See also","text":""},{"location":"xenableexcessivegc/","title":"-Xdisableexcessivegc","text":""},{"location":"xenableexcessivegc/#xenableexcessivegc-xdisableexcessivegc","title":"\u2011Xenableexcessivegc / \u2011Xdisableexcessivegc","text":"

These options enable or disable the throwing of an OutOfMemory exception if excessive time is spent in the GC.

If excessive time is spent in the GC, the option returns null for an allocate request and thus causes an OutOfMemory exception to be thrown.

Note: The OutOfMemory exception is thrown only when the heap has been fully expanded and the percentage of application run time that is spent in garbage collection is at least 95%. This percentage is the default value that triggers an excessive GC event. You can control this value with the -Xgc:excessiveGCratio option.

"},{"location":"xenableexcessivegc/#syntax","title":"Syntax","text":"Setting Effect Default -Xenableexcessivegc Enable exception yes -Xdisableexcessivegc Disable exception

These options can be used with all Eclipse OpenJ9\u2122 GC policies.

"},{"location":"xenableexplicitgc/","title":"-Xdisableexplicitgc","text":""},{"location":"xenableexplicitgc/#xenableexplicitgc-xdisableexplicitgc","title":"\u2011Xenableexplicitgc / \u2011Xdisableexplicitgc","text":"

The options enable or disable garbage collection (GC) when calls are made to System.gc().

"},{"location":"xenableexplicitgc/#syntax","title":"Syntax","text":"Setting Effect Default -Xenableexplicitgc Enable explicit GC calls yes -Xdisableexplicitgc Disable explicit GC calls"},{"location":"xenableexplicitgc/#explanation","title":"Explanation","text":"

Although it is possible to programmatically trigger a global GC by calling System.gc(), performance can be adversely affected by halting the application before it is really necessary. Use this option to prevent the VM responding to application requests for a GC cycle.

The default for all Eclipse OpenJ9\u2122 GC policies is -Xenableexplicitgc except for -Xgcpolicy:nogc, where the default is -Xdisableexplicitgc.

These options can be used with all OpenJ9 GC policies.

"},{"location":"xenablestringconstantgc/","title":"-Xdisablestringconstantgc","text":""},{"location":"xenablestringconstantgc/#xenablestringconstantgc-xdisablestringconstantgc","title":"\u2011Xenablestringconstantgc / \u2011Xdisablestringconstantgc","text":"

These options enable or disable the collection of strings from the string intern table.

"},{"location":"xenablestringconstantgc/#syntax","title":"Syntax","text":"Setting Effect Default -Xenablestringconstantgc Enable collection yes -Xdisablestringconstantgc Disable collection

This option is not supported with the balanced GC policy (-Xgcpolicy:balanced).

"},{"location":"xfastresolve/","title":"-Xfastresolve","text":""},{"location":"xfastresolve/#-xfastresolve","title":"-Xfastresolve","text":"

Tune performance by improving the resolution time for classes when the field count exceeds the specified threshold.

If profiling tools show significant costs in field resolution, change the threshold until the costs are reduced. If you enable this option, additional memory is used when the threshold is exceeded.

Note: The use of this option is deprecated.

"},{"location":"xfastresolve/#syntax","title":"Syntax","text":"
    -Xfastresolve<n>\n
where <n> is the required threshold."},{"location":"xfuture/","title":"-Xfuture","text":""},{"location":"xfuture/#-xfuture","title":"-Xfuture","text":"

As described in the Oracle \"Non-Standard Options\" documentation, this HotSpot option turns on strict class-file format checks. For compatibility, this option is also supported by the Eclipse OpenJ9\u2122 VM.

"},{"location":"xfuture/#syntax","title":"Syntax","text":"
    -Xfuture\n
"},{"location":"xfuture/#explanation","title":"Explanation","text":"

Oracle recommend that you use this flag when you are developing new code because stricter checks will become the default in future releases.

Note: You cannot use this setting in conjunction with -XX:+ClassRelationshipVerifier.

"},{"location":"xfuture/#default-behavior","title":"Default behavior","text":"

By default, strict format checks are disabled.

"},{"location":"xgc/","title":"-Xgc","text":""},{"location":"xgc/#-xgc","title":"-Xgc","text":"

Options that change the behavior of the garbage collector.

"},{"location":"xgc/#syntax","title":"Syntax","text":"
    -Xgc:<parameter>\n
"},{"location":"xgc/#parameters","title":"Parameters","text":"Parameter Effect breadthFirstScanOrdering Sets the scan mode to breadth first. classUnloadingKickoffThreshold Sets a threshold to start an early concurrent global garbage collection (GC) cycle due to recent, heavy class loading activity classUnloadingThreshold Sets a threshold to trigger a class unloading operation in a global GC cycle concurrentScavenge Enables a GC mode with less pause times. dnssExpectedTimeRatioMaximum Sets the maximum percentage of time to spend on local GC pauses dnssExpectedTimeRatioMinimum Sets the minimum percentage of time to spend on local GC pauses dynamicBreadthFirstScanOrdering Sets scan mode to dynamic breadth first. excessiveGCratio Sets a boundary value beyond which GC is deemed to be excessive. hierarchicalScanOrdering Sets scan mode to hierarchical. minContractPercent Sets the minimum percentage of the heap that can be contracted at any given time. maxContractPercent Sets the maximum percentage of the heap that can be contracted at any given time. noConcurrentScavenge Disables concurrent scavenge. noSynchronousGCOnOOM Prevents an application stopping to allow GC activity. overrideHiresTimerCheck Overrides GC operating system checks for timer resolution. preferredHeapBase Sets a memory range for the Java\u2122 heap. (AIX\u00ae, Linux\u00ae, macOS\u00ae, and Windows\u2122 only) scvNoAdaptiveTenure Turns off the adaptive tenure age in the generational concurrent GC policy. scvTenureAge Sets the initial scavenger tenure age in the generational concurrent GC policy. stdGlobalCompactToSatisfyAllocate Prevents the GC from performing a compaction unless absolutely required. synchronousGCOnOOM Stops an application to allow GC activity. targetPausetime Sets the target GC pause time for the metronome and balanced GC policies. targetUtilization Sets application utilization for the metronome GC policy. tlhIncrementSize Sets the size of the thread local heap (TLH) increment. tlhInitialSize Sets the initial size of the thread local heap. tlhMaximumSize Sets the maximum size of the thread local heap. verboseFormat Sets the verbose GC format. verbosegcCycleTime Sets the criteria for verbose GC logging."},{"location":"xgc/#breadthfirstscanordering","title":"breadthFirstScanOrdering","text":"
     -Xgc:breadthFirstScanOrdering\n
This option sets the scan mode for GC operations that evacuate objects in the heap (scavenge operations (gencon) and copy forward operations (balanced)) to breadth first mode. The scan mode reflects the method for traversing the object graph and is also known as Cheney's algorithm."},{"location":"xgc/#classunloadingkickoffthreshold","title":"classUnloadingKickoffThreshold","text":"
     -Xgc:classUnloadingKickoffThreshold=<value>\n
Where <value> is equal to the number of class loaders plus the number of anonymous classes that are loaded since the previous class unloading operation. This option sets a threshold that is used to start an early concurrent global GC cycle due to recent class loading activity. The default value is 80000. This option is applicable to the following GC policies: gencon and optavgpause."},{"location":"xgc/#classunloadingthreshold","title":"classUnloadingThreshold","text":"
     -Xgc:classUnloadingThreshold=<value>\n
Where <value> is equal to the number of class loaders plus the number of anonymous classes that are loaded since the previous class unloading operation. This option sets a threshold that is used to trigger an optional GC class unloading operation in a global GC cycle, irrespective of how the global GC cycle is triggered. The default value is 6. This option is applicable to the following GC policies: gencon, optavgpause, and optthruput."},{"location":"xgc/#concurrentscavenge","title":"concurrentScavenge","text":"

(64-bit only)

    -Xgc:concurrentScavenge\n

This option supports pause-less garbage collection mode when you use the Generational Concurrent (gencon) garbage collection policy (the default policy). This option cannot be used with any other GC policies.

If you set this option, the VM attempts to reduce GC pause times for response-time sensitive, large-heap applications. This mode can be enabled with hardware-based support (Linux on IBM Z\u00ae and z/OS\u00ae) and software-based support (64-bit: Linux on (x86-64, POWER\u00ae, IBM Z\u00ae) AIX\u00ae, macOS\u00ae, and z/OS).

Note: Linux on IBM Z and z/OS

This option is supported by all generations of IBM Z hardware to enable pause-less GC with two modes of operation: hardware-based and software-based operations. IBM z13\u2122 and earlier hardware operates in software-based pause-less GC mode; IBM z14\u2122 and later hardware (with supported software) operates in hardware-based mode.

Hardware-based pause-less GC is supported on IBM z14 and later hardware running the following software:

Operating systems:

Hypervisors:

If these requirements are not met, the option is ignored.

Note: On z/OS, the virtual storage used might exceed the Java maximum heap size. Set the z/OS memory limit, specified by ulimit -M, to a larger value than the maximum heap size.

"},{"location":"xgc/#dnssexpectedtimeratiomaximum","title":"dnssExpectedTimeRatioMaximum","text":"
    -Xgc:dnssExpectedTimeRatioMaximum=<value>\n
Setting Value Default <value> [percentage] 5 for gencon, 5 for balanced

The maximum percentage of time spent in local garbage collection pauses. For the gencon policy, this refers to the amount of time spent on the nursery area of the heap (scavenge operation). For the balanced policy, this refers to the amount of time spent on the eden regions of the heap (PGC operation).

This option applies only to the gencon and balanced GC policies.

"},{"location":"xgc/#dnssexpectedtimeratiominimum","title":"dnssExpectedTimeRatioMinimum","text":"
    -Xgc:dnssExpectedTimeRatioMinimum=<value>\n
Setting Value Default <value> [percentage] 1 for gencon, 2 for balanced

The minimum percentage of time spent in local garbage collection pauses. For the gencon policy, this refers to the amount of time spent in Scavenge operation (on the nursery area of the heap). For the balanced policy, this refers to the amount of time spent in PGC operations (mostly on the eden and young regions, but also some other regions for de-fragmentation purposes).

This option applies only to the gencon and balanced GC policies.

"},{"location":"xgc/#dynamicbreadthfirstscanordering","title":"dynamicBreadthFirstScanOrdering","text":"
     -Xgc:dynamicBreadthFirstScanOrdering\n
This option sets the scan mode for GC operations that evacuate objects in the heap (scavenge operations (gencon) and copy forward operations (balanced)) to dynamic breadth first mode. This scan mode reflects the method for traversing the object graph and is a variant that adds partial depth first traversal on top of the breadth first scan mode. The aim of dynamic breadth first mode is driven by object field hotness. This mode is the default for the balanced GC policy."},{"location":"xgc/#excessivegcratio","title":"excessiveGCratio","text":"
    -Xgc:excessiveGCratio=<value>\n
Setting Value Default <value> [percentage] 95

where <value> is a percentage of total application run time that is spent in GC.

The default value is 95, which means that anything over 95% of total application run time spent on GC is deemed excessive. This option can be used only when -Xenableexcessivegc is set (enabled by default).

This option can be used with all Eclipse OpenJ9\u2122 GC policies.

"},{"location":"xgc/#hierarchicalscanordering","title":"hierarchicalScanOrdering","text":"
    -Xgc:hierarchicalScanOrdering\n
This option sets the scan mode for the scavenge operation (gencon GC policy) to hierarchical mode. This mode reflects the method for traversing the object graph and adds partial depth first traversal on top of breadth first scan mode. The aim of hierarchical mode is to minimize object distances. This option is the default for the gencon GC policy."},{"location":"xgc/#mincontractpercent","title":"minContractPercent","text":"
    -Xgc:minContractPercent=<n>\n
Setting Value Default <n> [percentage] -

The minimum percentage of the heap that can be contracted at any given time.

This option can be used with all OpenJ9 GC policies.

"},{"location":"xgc/#maxcontractpercent","title":"maxContractPercent","text":"
    -Xgc:maxContractPercent=<n>\n
Setting Value Default <n> [percentage] -

The maximum percentage of the heap that can be contracted at any given time. For example, -Xgc:maxContractPercent=20 causes the heap to contract by as much as 20%.

This option can be used with all OpenJ9 GC policies.

"},{"location":"xgc/#noconcurrentscavenge","title":"noConcurrentScavenge","text":"

(64-bit only)

    -Xgc:noConcurrentScavenge\n

This option disables pause-less garbage collection that you might have enabled with the -Xgc:concurrentScavenge option when using the default gencon GC policy. This option applies only to the gencon GC policy.

Note: No concurrent scavenge is the default state, but the noConcurrentScavenge option is useful as it will disable concurrent scavenge even if it has been enabled by a previous option; the right-most option always takes precedence.

"},{"location":"xgc/#nosynchronousgconoom","title":"nosynchronousGCOnOOM","text":"
    -Xgc:nosynchronousGCOnOOM\n
Setting -Xgc:nosynchronousGCOnOOM implies that when heap memory is full your application stops and issues an out-of-memory message. The default is -Xgc:synchronousGCOnOOM. This option applies only to the metronome GC policy."},{"location":"xgc/#overridehirestimercheck","title":"overrideHiresTimerCheck","text":"
    -Xgc:overrideHiresTimerCheck\n

When the VM starts, the GC checks that the operating system can meet the timer resolution requirements for the requested target pause time. Typically, this check correctly identifies operating systems that can deliver adequate time resolution. However, in some cases the operating system provides a more conservative answer than strictly necessary for GC pause time management, which prevents startup. Specifying this parameter causes the GC to ignore the answer returned by the operating system. The VM starts, but GC pause time management remains subject to operating system performance, which might not provide adequate timer resolution.

Note: Use this option with caution, and only when you are unable to use a supported operating system.

This option applies only to the metronome GC policy.

"},{"location":"xgc/#preferredheapbase","title":"preferredHeapBase","text":"

(AIX, Linux, macOS, and Windows only)

    -Xgc:preferredHeapBase=<address>\n
Setting Value Default <value> [hexadecimal] -

where, <address> is the base memory address for the heap. Use this option with the -Xcompressedrefs option to allocate the heap you specify with the -Xmx option, in a memory range of your choice. If -Xcompressedrefs is not specified, this option has no effect. In the following example, the heap is located at the 4 GB mark, leaving the lowest 4 GB of address space for use by other processes.

-Xgc:preferredHeapBase=0x100000000\n

If the heap cannot be allocated in a contiguous block at the preferredHeapBase address you specified, an error occurs detailing a Garbage Collection (GC) allocation failure startup. When the preferredHeapBase option is used with the -Xlp option, the preferredHeapBase address must be a multiple of the large page size. If you specify an inaccurate heap base address, the heap is allocated with the default page size.

This option can be used with all OpenJ9 GC policies.

"},{"location":"xgc/#scvnoadaptivetenure","title":"scvNoAdaptiveTenure","text":"
    -Xgc:scvNoAdaptiveTenure\n
Turns off the adaptive tenure age in the gencon GC policy. The initial age that is set is maintained throughout the run time of the VM. See scvTenureAge. This option applies only to the gencon GC policy."},{"location":"xgc/#scvtenureage","title":"scvTenureAge","text":"
    -Xgc:scvTenureAge=<n>\n
Setting Value Default <n> [1 - 14] 10

Sets the initial scavenger tenure age in the gencon GC policy. For more information, see gencon policy (default).

This option applies only to the gencon GC policy.

"},{"location":"xgc/#stdglobalcompacttosatisfyallocate","title":"stdGlobalCompactToSatisfyAllocate","text":"
    -Xgc:stdGlobalCompactToSatisfyAllocate\n
Prevents the GC from performing a compaction unless absolutely required to satisfy the current allocation failure by removing the dynamic compaction triggers that look at heap occupancy. This option works only with the following GC policies: This option is not supported with the balanced GC policy (-Xgcpolicy:balanced) or metronome GC policy (-Xgcpolicy:metronome)."},{"location":"xgc/#synchronousgconoom","title":"synchronousGCOnOOM","text":"
    -Xgc:synchronousGCOnOOM\n
GC cycles can occur when the Java heap runs out of memory. If there is no more free space in the heap, using -Xgc:synchronousGCOnOOM stops your application while GC operations remove unused objects. If free space runs out again, consider decreasing the target utilization to allow GC operations more time to complete. Setting -Xgc:nosynchronousGCOnOOM implies that when heap memory is full your application stops and issues an out-of-memory message. The default is -Xgc:synchronousGCOnOOM. This option applies only to the metronome GC policy."},{"location":"xgc/#targetpausetime","title":"targetPausetime","text":"
    -Xgc:targetPausetime=N\n
Sets the target GC pause time, where N is the time in milliseconds. When this option is specified with the metronome policy, the garbage collector operates with pauses that do not exceed the value specified. If this option is not specified when using the metronome policy, the default pause time target is set to 3 milliseconds. For example, running with -Xgc:targetPausetime=20 causes the garbage collector to pause for no longer than 20 milliseconds during GC operations.

When this option is specified with the balanced policy, the GC will use the specified pause time as a soft pause time target. If this option is not specified when using the balanced policy, the default pause time target is set to 200 milliseconds. If the GC pauses are longer than the specified target, then the GC may shrink the amount of eden regions in order to satisfy the target pause time. If the percentage of time spent in PGC pauses is higher than dnssExpectedTimeRatioMaximum and the GC pauses are longer than the specified pause time target, then the target pause time may not be satisfied, in order to balance reaching the target pause time goal and percentage of time in GC pause goal.

Note: Specifying an ultra low targetPausetime with the Balanced GC policy may cause the percentage of time spent in GC pauses to noticeably increase.

This option applies only to the metronome and balanced GC policies.

"},{"location":"xgc/#targetutilization","title":"targetUtilization","text":"
    -Xgc:targetUtilization=N\n

Sets the application utilization to N%; the garbage collector attempts to use at most (100-N)% of each time interval. Reasonable values are in the range of 50-80%. Applications with low allocation rates might be able to run at 90%. The default is 70%.

In the following example, the maximum size of the heap is set to 30 MB. The garbage collector attempts to use 25% of each time interval because the target utilization for the application is set to 75%.

java -Xgcpolicy:metronome -Xmx30m -Xgc:targetUtilization=75 Test\n

This option applies only to the metronome GC policy.

"},{"location":"xgc/#tlhincrementsize","title":"tlhIncrementSize","text":"
    -Xgc:tlhIncrementSize=<bytes>\n
Sets the increment size of the thread local heap (TLH), which plays a key role in cache allocation. Threads start creating TLHs with a predefined initial size (default 2 KB). On every TLH refresh, the requested size for that thread is increased by an increment (default 4 KB). Use this option to control the increment size. This option can be used with all OpenJ9 GC policies."},{"location":"xgc/#tlhinitialsize","title":"tlhInitialSize","text":"
    -Xgc:tlhInitialSize=<bytes>\n
Sets the initial size of the TLH. The default size is 2 KB. This option can be used with all OpenJ9 GC policies."},{"location":"xgc/#tlhmaximumsize","title":"tlhMaximumSize","text":"
    -Xgc:tlhMaximumSize=<bytes>\n
Sets the maximum size of the TLH. The size of the TLH varies from 512 bytes (768 on 64-bit JVMs) to 128 KB, depending on the allocation rate of the thread. Larger TLHs can help reduce heap lock contention, but might also reduce heap utilisation and increase heap fragmentation. Typically, when the maximum TLH size is increased, you should also increase the increment size (-XtlhIncrementSize) proportionally, so that active threads can reach the maximum requested TLH size more quickly. This option can be used with all OpenJ9 GC policies."},{"location":"xgc/#verboseformat","title":"verboseFormat","text":"
    -Xgc:verboseFormat=<format>\n
Setting Value Default <format> default yes deprecated

This option does not apply to the metronome GC policy. The verbose log format for the metronome GC policy is equivalent to -Xgc:verboseFormat=deprecated.

"},{"location":"xgc/#verbosegccycletime","title":"verbosegcCycleTime","text":"
    -Xgc:verbosegcCycleTime=N\n

N is the time in milliseconds that the summary information should be logged.

Note: The cycle time does not mean that the summary information is logged precisely at that time, but when the last GC event that meets this time criterion passes.

This option applies only to the metronome GC policy.

"},{"location":"xgcmaxthreads/","title":"-Xgcmaxthreads","text":""},{"location":"xgcmaxthreads/#-xgcmaxthreads","title":"-Xgcmaxthreads","text":"

Specifies the maximum number of threads that the garbage collector can use for parallel operations. This option behaves in the same way as -Xgcthreads but does not enforce a fixed thread count, which allows the garbage collector to adjust the thread count when used with the -XX:+AdaptiveGCThreading option.

"},{"location":"xgcmaxthreads/#syntax","title":"Syntax","text":"
    -Xgcmaxthreads<number>\n

Where <number> is the maximum number of threads that can be used for parallel operations.

"},{"location":"xgcpolicy/","title":"-Xgcpolicy","text":""},{"location":"xgcpolicy/#-xgcpolicy","title":"-Xgcpolicy","text":"

Controls which garbage collection (GC) policy is used for your Java\u2122 application.

"},{"location":"xgcpolicy/#syntax","title":"Syntax","text":"
    -Xgcpolicy:<parameter>\n
"},{"location":"xgcpolicy/#parameters","title":"Parameters","text":"Parameter Default gencon yes balanced (64-bit only) metronome (AIX\u00ae, Linux\u00ae x86 only) optavgpause optthruput nogc

For a detailed description of the policies, when to use them, and how they work, see Garbage Collection policies. The following GC policies are available:

"},{"location":"xgcpolicy/#gencon","title":"gencon","text":"
    -Xgcpolicy:gencon\n
The generational concurrent policy (default) requires a heap that is divided into two main areas (nursery and tenure) to manage two generation groups (new and older). The policy uses a global GC cycle of concurrent mark-sweep operations, optionally followed by compact operations. The policy also uses a partial GC cycle to run scavenge operations on the nursery area. The partial cycle helps reduce the frequency and duration of the global GC cycle. Note that scavenge is a stop-the-world operation, unless -Xgcpolicy:gencon is specified with the -Xgc:concurrentScavenge option. To learn more about this policy, when to use it, and how it works, see Garbage collection: gencon policy."},{"location":"xgcpolicy/#balanced-64-bit-only","title":"balanced (64-bit only)","text":"
    -Xgcpolicy:balanced\n
The Balanced policy requires a multi-region heap to manage multiple generations of objects. The policy uses a global GC cycle that involves an incremental concurrent mark operation (global mark phase), followed by stop-the-world (STW) sweep operation. The policy also uses a partial GC cycle to run copy forward or mark-compact operations. Regions are individually managed to reduce the maximum pause time on large heaps and increase the efficiency of garbage collection. The policy tries to avoid global collections by matching object allocation and survival rates. With the balanced policy, the global mark and partial GC cycles interleave. The global STW sweep operation runs within the same GC increment as the first partial GC cycle that follows the global mark phase. The balanced policy also exploits large systems that have Non-Uniform Memory Architecture (NUMA) characteristics (x86 and POWER\u2122 platforms only), which might further improve application throughput. Note: If you are using this GC policy in a Docker container that uses the default seccomp Docker profile, you must start the container with --security-opt seccomp=unconfined to exploit NUMA characteristics. These options are not required if you are running in Kubernetes because unconfined is set by default (see Seccomp). To learn more about this policy, how it works, and when to use it, see Garbage collection: balanced policy."},{"location":"xgcpolicy/#balanced-defaults-and-options","title":"balanced defaults and options","text":"

The initial heap size is Xmx/1024, rounded down to the nearest power of 2, where Xmx is the maximum heap size available. You can override this value by specifying the -Xms option on the command line.

The following options can also be specified on the command line with -Xgcpolicy:balanced:

The behavior of the following options is different when specified with -Xgcpolicy:balanced:

-Xcompactgc (default) Forces compaction in each Global GC cycle. -Xnocompactgc Disables internal compaction heuristics in Global GC cycles. -Xcompactexplicitgc (default) Forces compaction in explicit Global GC cycles, such as those invoked by System.gc(). Compaction in implicit Global GC remains optional, triggered by internal heuristics. -Xnocompactexplicitgc Disables compaction in explicit Global GC cycles. Compaction in implicit Global GC remains optional, triggered by internal heuristics. -Xgc:targetPausetime Uses the specified GC pause time as a soft GC pause time target.

The following options are ignored when specified with -Xgcpolicy:balanced:

"},{"location":"xgcpolicy/#optavgpause","title":"optavgpause","text":"
    -Xgcpolicy:optavgpause\n

The optimize for pause time policy requires a flat heap and uses a global GC cycle to run concurrent mark-sweep operations, optionally followed by compact operations. Pause times are shorter than with optthruput, but application throughput is reduced. The impact on throughput occurs because some garbage collection work is taking place in the context of mutator (application) threads, and because GC frequency is increased.

To learn more about this policy and when to use it, see Garbage collection: optavgpause policy.

"},{"location":"xgcpolicy/#optthruput","title":"optthruput","text":"
    -Xgcpolicy:optthruput\n

The optimize for throughput policy requires a flat heap and uses a global GC cycle to run mark-sweep operations, optionally followed by compact operations. Because the application stops during a global GC cycle, long pauses can occur.

To learn more about this policy, how it works, and when to use it, see Garbage collection: optthruput policy.

"},{"location":"xgcpolicy/#metronome-aix-linux-x86-only","title":"metronome (AIX, Linux x86 only)","text":"
    -Xgcpolicy:metronome\n

The metronome policy is an incremental, deterministic garbage collector with short pause times. Applications that are dependent on precise response times can take advantage of this technology by avoiding potentially long delays from GC activity. The metronome policy is supported on specific hardware and operating system configurations.

To learn more about this policy, how it works, and when to use it, see Garbage collection: metronome policy.

"},{"location":"xgcpolicy/#metronome-options","title":"metronome options","text":"

The following options are specific to the metronome GC policy:

-Xgc:targetPausetime option also applies to the metronome GC policy. This option applies only to the metronome and balanced GC policies.

"},{"location":"xgcpolicy/#nogc","title":"nogc","text":"
    -Xgcpolicy:nogc\n

This policy handles only memory allocation and heap expansion, but doesn't reclaim any memory. If the available Java heap becomes exhausted, an OutOfMemoryError exception is triggered and the VM stops.

You should be especially careful when using any of the following techniques with nogc because memory is never released under this policy: - Finalization - Direct memory access - Weak, soft, and phantom references

To learn when to use this policy, see Garbage collection: nogc policy.

This policy can also be enabled with the -XX:+UseNoGC option.

Further details are available at JEP 318: Epsilon: A No-Op Garbage Collector.

"},{"location":"xgcsplitheap/","title":"-Xgc:splitheap","text":""},{"location":"xgcsplitheap/#-xgcsplitheap","title":"-Xgc:splitheap","text":"

(Windows\u2122 32-bit only)

By default, the VM uses a contiguous Java\u2122 heap to store Java objects. However, on Windows 32-bit systems, there are restrictions in the 32-bit memory space that prevents a process accessing more than 2GB of memory, even if there is more memory available. To increase the maximum allocatable heap size, Eclipse OpenJ9\u2122 can split the heap, allowing memory use up to the 4GB limit.

Restrictions:

"},{"location":"xgcsplitheap/#syntax","title":"Syntax","text":"
    -Xgc:splitheap\n
"},{"location":"xgcsplitheap/#explanation","title":"Explanation","text":"

Use -Xgc:splitheap for applications that must run on the 32-bit VM because of 32-bit JNI libraries, a 32-bit operating system, or 32-bit hardware, but need large Java heaps. By using a larger heap, you can allocate more objects before incurring a garbage collection (GC) and you can increase the number of live objects that you can use before an OutOfMemoryError exception occurs.

With a split heap, the old area is committed to its maximum size (set with -Xmox) in a lower region of memory and the new area is committed to its maximum size (set with -Xmnx) in a higher region of memory.

This option is not recommended if your application works in the any of the following ways:

"},{"location":"xgcthreads/","title":"-Xgcthreads","text":""},{"location":"xgcthreads/#-xgcthreads","title":"-Xgcthreads","text":"

Sets the number of threads that the garbage collector uses for parallel operations.

Notes:

This option enforces a fixed thread count and cannot be used with the -XX:+AdaptiveGCThreading option, which enables the garbage collector to adjust the number of parallel threads based on heuristics. If you want to use -XX:+AdaptiveGCThreading, use -Xgcmaxthreads instead of -Xgcthreads.

"},{"location":"xgcthreads/#syntax","title":"Syntax","text":"
    -Xgcthreads<number>\n
"},{"location":"xgcthreads/#explanation","title":"Explanation","text":"

The total number of GC threads is composed of one application thread with the remainder being dedicated GC threads. By default, the number is set to n-1, where n is the number of reported CPUs, up to a maximum of 64. Where SMT or hyperthreading is in place, the number of reported CPUs is larger than the number of physical CPUs. Likewise, where virtualization is in place, the number of reported CPUs is the number of virtual CPUs assigned to the operating system. To set it to a different number, for example 4, use -Xgcthreads4. The minimum valid value is 1, which disables parallel operations, at the cost of performance. No advantage is gained if you increase the number of threads to more than the default setting.

On systems running multiple VMs or in LPAR environments where multiple VMs can share the same physical CPUs, you might want to restrict the number of GC threads used by each VM. The restriction helps prevent the total number of parallel operation GC threads for all VMs exceeding the number of physical CPUs present, when multiple VMs perform garbage collection at the same time.

This option is directly mapped to the HotSpot option -XX:ParallelGCThreads and can be used with all Eclipse OpenJ9\u2122 GC policies.

"},{"location":"xgcworkpackets/","title":"-Xgcworkpackets","text":""},{"location":"xgcworkpackets/#-xgcworkpackets","title":"-Xgcworkpackets","text":"

Specifies the total number of work packets available in the global collector.

"},{"location":"xgcworkpackets/#syntax","title":"Syntax","text":"
    -Xgcworkpackets<number>\n
"},{"location":"xgcworkpackets/#explanation","title":"Explanation","text":"

If you do not specify a value, the collector allocates a number of packets based on the maximum heap size.

This option can be used with all Eclipse OpenJ9\u2122 GC policies.

"},{"location":"xint/","title":"-Xint","text":""},{"location":"xint/#-xint","title":"-Xint","text":"

As described in the Oracle \"Non-Standard Options\" documentation, this VM option runs an application in interpreted-only mode. For compatibility, this option is also supported by the Eclipse OpenJ9\u2122 VM.

"},{"location":"xint/#syntax","title":"Syntax","text":"
    -Xint\n
"},{"location":"xint/#explanation","title":"Explanation","text":"

If you use this option, the OpenJ9 VM uses only the interpreter, disabling the OpenJ9 just-in-time (JIT) and ahead-of-time (AOT) compilers. By default, both these compilers are enabled, although the AOT compiler is not used by the VM unless shared classes are also enabled.

"},{"location":"xjit/","title":"-Xjit","text":""},{"location":"xjit/#-xjit-xnojit","title":"-Xjit / -Xnojit","text":"

Use this option to control the behavior of the JIT compiler.

Specifying -Xjit with no parameters has no effect because the JIT compiler is enabled by default.

Specifying -Xnojit turns off the JIT compiler but does not affect the AOT compiler.

Specify the -Xjit option only once. By default, if you specify this option multiple times, only the last option takes effect. You can use the -XX:+MergeCompilerOptions option to merge all the existing instances of the -Xjit options logically.

You can specify multiple parameters for the -Xjit option by using commas to separate the parameters. For example:

-Xjit:enableGPU,exclude={ilog/rules/engine/sequential/generated/*}

Parameters such as exclude are additive so you can specify them multiple times within the same -Xjit option.

"},{"location":"xjit/#syntax","title":"Syntax","text":"Setting Action Default -Xjit Enable JIT yes -Xjit[:<parameter>=<value>{,<parameter>=<value>}] Enable JIT with options -Xnojit Disable JIT"},{"location":"xjit/#parameters","title":"Parameters","text":"

These parameters can be used to modify the behavior of -Xjit:

Parameter Effect count Specifies the number of times a method is called before it is compiled. disableRMODE64 Allows the JIT to allocate executable code caches above the 2 GB memory bar. enableGPU Allows the JIT to offload certain processing tasks to a graphics processing unit (GPU) exclude Excludes the specified method from compilation. limit Includes the specified method in compilation. limitFile Compile methods that are listed in the limit file. optlevel Forces the JIT compiler to compile all methods at a specific optimization level. verbose Reports information about the JIT and AOT compiler configuration and method compilation. vlog Sends verbose output to a file. perfTool Facilitates JIT-compiled code symbol resolution when profiling the VM on Linux."},{"location":"xjit/#count","title":"count","text":"
    -Xjit:count=<n>\n
Specifies the number of times, <n>, a method is called before it is compiled. For example, setting count=0 forces the JIT compiler to compile everything on first execution, which is useful for problem determination."},{"location":"xjit/#disablermode64","title":"disableRMODE64","text":"

(z/OS\u00ae only)

    -Xjit:disableRMODE64\n
From z/OS V2R3, residency mode for 64-bit applications (RMODE64) is enabled by default. This feature allows the JIT to allocate executable code caches above the 2 GB memory bar, which is the default behavior. Use this option to turn off this JIT behavior."},{"location":"xjit/#enablegpu","title":"enableGPU","text":"

(Windows (x86-64) or Linux (x86-64 and IBM POWER LE))

    -Xjit:enableGPU\n
Enables the JIT compiler to offload certain processing tasks to a graphics processing unit (GPU). The JIT determines which functions to offload based on performance heuristics. Systems must support NVIDIA Compute Unified Device Architecture (CUDA). The JIT requires the CUDA Toolkit 7.5 and your GPU device must have a minimum compute capability of 3.0. To troubleshoot operations between the JIT compiler and the GPU, use -Xjit:enableGPU={verbose}, which provides output showing the processing tasks that are offloaded and their status. To send this output to a file (output.txt), run -Xjit:enableGPU={verbose},vlog=output.txt when you start your application."},{"location":"xjit/#exclude","title":"exclude","text":"
    -Xjit:exclude={<method>}\n

Excludes the specified method from compilation.

<method_name> is the method or methods that are to be excluded; the wildcard * may be used. Specify as much of the full package, class and method as necessary.

For example, -Xjit:exclude={test/sample/MyClass.testMethod()V} excludes the single method specified. However, -Xjit:exclude={test/sample/MyClass.testMethod()*} excludes the method regardless of return type. Similarly, -Xjit:exclude={*} excludes all methods.

Note: exclude has the same effect regardless of whether it is specified on -Xaot or -Xjit. In consequence, if you specify -Xjit:exclude, AOT compilation is also prevented and the methods specified are always interpreted.

"},{"location":"xjit/#limit","title":"limit","text":"
    -Xjit:limit={<method_name>}\n
Only the Java\u2122 methods specified are included when code is compiled or loaded from the shared classes cache. <method_name> is the method or methods that are to be included (the wildcard * can be used, see -Xjit:exclude for details). Note: limit has the same effect regardless of whether it is specified on -Xaot or -Xjit. In consequence, if you specify -Xjit:limit, AOT compilation is also restricted to those methods specified; other methods are always interpreted."},{"location":"xjit/#limitfile","title":"limitFile","text":"
    -Xjit:limitFile=(<vlog_filename>, <m>, <n>)\n
Compile only the methods that are listed on lines <m> to <n> in the specified limit file, where the limit file is a verbose log that you generated with the -Xjit:verbose,vlog=<vlog_filename> option. Methods that are not listed in the limit file and methods that are listed on lines outside the range are not compiled. Note: limitFile has the same effect regardless of whether it is specified on -Xaot or -Xjit. In consequence, if you specify -Xjit:limitFile, AOT compilation is also restricted to those methods specified; other methods are always interpreted."},{"location":"xjit/#optlevel","title":"optlevel","text":"
    -Xjit:optlevel=[noOpt|cold|warm|hot|veryHot|scorching]\n
Forces the JIT compiler to compile all methods at a specific optimization level. Specifying optlevel might have an unexpected effect on performance, including reduced overall performance."},{"location":"xjit/#verbose","title":"verbose","text":"
    -Xjit:verbose\n
Generates a JIT verbose log. The log provides a summary of which methods were compiled by the JIT and some of the compilation heuristic decisions that were taken while the JIT operates inside the Eclipse OpenJ9\u2122 VM.
-Xjit:verbose={compileStart}\n

Prints a line when the JIT is about to start compiling a method.

-Xjit:verbose={compileEnd}\n

Prints a line when the JIT stops compiling a method.

-Xjit:verbose={compilePerformance}\n

Adds the values time (time taken to do the compilation) and mem (the amount of memory that was allocated during the compilation) into each line. This option includes the compileStart and compileEnd suboptions by default.

-Xjit:verbose={disableInlining}\n

Turns off inlining operations.

-Xjit:verbose={inlining}\n

Shows the methods that are inlined.

Note: Suboptions can be chained together by using a pipe (|) symbol. When used, you must enclose the full option name in single quotation marks (') to avoid the shell misinterpreting these characters as pipe commands. For example:

java '-Xjit:verbose={compileStart|compileEnd|inlining}' -version\n
"},{"location":"xjit/#vlog","title":"vlog","text":"
    -Xjit:vlog=<vlog_filename>\n
Sends verbose output to a file, of the format <vlog_filename>.<date>.<time>.<JVM_process_ID>, which is created in your current directory. Running the command multiple times produces multiple distinct versions of this file. If you do not specify this parameter, the output is sent to the standard error output stream (STDERR). This type of log file can be used with the limitFile suboption to target the compilation of specific methods."},{"location":"xjit/#perftool","title":"perfTool","text":"
    -Xjit:perfTool\n
generates a /tmp/perf-<pid>.map file for the JIT-compiled code. This file is used by the Linux\u00ae system profiler, perf, to map the samples in the JIT-compiled code to the corresponding Java method names for profiling the VM.

For more information, see -XX:[+|-]PerfTool.

"},{"location":"xjit/#examples","title":"Examples","text":""},{"location":"xjit/#generating-a-jit-verbose-log","title":"Generating a JIT verbose log","text":"

The following example requests a JIT verbose log of the java -version command:

java -Xjit:verbose,vlog=vlogfile -version\n
"},{"location":"xjit/#analyzing-jit-performance","title":"Analyzing JIT performance","text":"

The following example requests information about the performance of JIT compiler threads, with output written to vlogfile.

java -Xjit:verbose={compilePerformance},vlog=vlogfile -version\n

The output generated by using this command adds the following information to compilation entry:

"},{"location":"xjit/#analyzing-inlining-operations","title":"Analyzing inlining operations","text":"

The following example generates output that contains performance data and inlining operations. The suboptions count and -XcompilationThreads1 are used only to simplify the output. These options are not recommended for production because performance will be affected.

java '-Xjit:verbose={compileStart|compileEnd|inlining},count=5,vlog=vlogfile' -XcompilationThreads1 -version\n
"},{"location":"xjit/#see-also","title":"See also","text":""},{"location":"xjni/","title":"-Xjni","text":""},{"location":"xjni/#-xjni","title":"-Xjni","text":"

Sets JNI options.

"},{"location":"xjni/#syntax","title":"Syntax","text":"
    -Xjni:<parameter>\n
"},{"location":"xjni/#parameters","title":"Parameters","text":""},{"location":"xjni/#arraycachemax","title":"arrayCacheMax","text":"
    -Xjni:arrayCacheMax=<size in bytes>\n    -Xjni:arrayCacheMax=unlimited\n
Sets the maximum size of the array cache. The default size is 128 KB (-Xjni:arrayCacheMax=131072)."},{"location":"xlinenumbers/","title":"-Xlinenumbers","text":""},{"location":"xlinenumbers/#-xlinenumbers-xnolinenumbers","title":"-Xlinenumbers / -Xnolinenumbers","text":"

These options enable or disable line numbers in stack traces for debugging.

"},{"location":"xlinenumbers/#syntax","title":"Syntax","text":"Setting Effect Default -Xlinenumbers Enable yes -Xnolinenumbers Disable"},{"location":"xlinenumbers/#explanation","title":"Explanation","text":"

If you start the Eclipse OpenJ9\u2122 VM with -Xnolinenumbers when creating a new shared classes cache, the Class Debug Area is not created. The option -Xnolinenumbers advises the VM not to load any class debug information, so there is no need for this region. If -Xscdmx is also used on the command line to specify a non zero debug area size, then a debug area is created despite the use of -Xnolinenumbers.

"},{"location":"xloa/","title":"-Xloa","text":""},{"location":"xloa/#-xloa-xnoloa","title":"-Xloa / -Xnoloa","text":"

This option enables or prevents the allocation of a large object area (LOA) during garbage collection (GC).

"},{"location":"xloa/#syntax","title":"Syntax","text":"Setting Effect Default -Xloa Enable LOA yes (see Default behavior) -Xnoloa Disable LOA"},{"location":"xloa/#default-behavior","title":"Default behavior","text":"

By default, allocations are made in the small object area (SOA). If there is no room in the SOA, and an object is larger than 64KB, the object is allocated in the LOA.

If the LOA is not used, it is shrunk to zero after a few collections. You can disable it explicitly by specifying the -Xnoloa option.

"},{"location":"xloa/#explanation","title":"Explanation","text":"

The LOA is an area of the tenure area of the heap set used solely to satisfy allocations for large objects. The LOA is used when the allocation request cannot be satisfied in the main area (the SOA of the tenure heap.

As objects are allocated and freed, the heap can become fragmented in such a way that allocation can be met only by time-consuming compactions. This problem is more pronounced if an application allocates large objects. In an attempt to alleviate this problem, the LOA is allocated. A large object in this context is considered to be any object 64 KB or greater in size. Allocations for new TLH objects are not considered to be large objects.

This option is not supported with the balanced GC policy (-Xgcpolicy:balanced) or metronome GC policy (-Xgcpolicy:metronome), which do not use an LOA. Any LOA options passed on the command line are ignored. These policies address the issues that are solved by an LOA by reorganizing object layout with the VM to reduce heap fragmentation and compaction requirements.

"},{"location":"xloa/#see-also","title":"See also","text":""},{"location":"xloaminimum/","title":"-Xloainitial","text":""},{"location":"xloaminimum/#-xloainitial-xloaminimum-xloamaximum","title":"-Xloainitial / -Xloaminimum / -Xloamaximum","text":"

Specifies the initial, minimum, and maximum proportion of the current tenure space allocated to the large object area (LOA).

The LOA does not shrink to less than the minimum value.

"},{"location":"xloaminimum/#syntax","title":"Syntax","text":"Setting Effect Default -Xloainitial<value> Set initial space 0.05 -Xloaminimum<value> Set minimum space 0.01 -Xloamaximum<value> Set minimum space 0.5"},{"location":"xloaminimum/#see-also","title":"See also","text":"

This option is not supported with the balanced GC policy (-Xgcpolicy:balanced) or metronome GC policy (-Xgcpolicy:metronome), which do not use an LOA.

"},{"location":"xlockreservation/","title":"-XlockReservation","text":""},{"location":"xlockreservation/#-xlockreservation","title":"-XlockReservation","text":"

Enables an optimization that presumes a monitor is owned by the thread that last acquired it.

This optimization minimizes the runtime cost of acquiring and releasing a monitor for a single thread if the monitor is rarely acquired by multiple threads.

"},{"location":"xlockreservation/#syntax","title":"Syntax","text":"
    -XlockReservation\n
"},{"location":"xlockword/","title":"-Xlockword","text":""},{"location":"xlockword/#-xlockword","title":"-Xlockword","text":"

Test whether performance optimizations are negatively impacting an application.

"},{"location":"xlockword/#syntax","title":"Syntax","text":"
    -Xlockword:<parameters>\n
"},{"location":"xlockword/#parameters","title":"Parameters","text":""},{"location":"xlockword/#mode","title":"mode","text":"
    -Xlockword:mode=all\n    -Xlockword:mode=default\n

Locking optimizations typically reduce memory usage and improve performance. However, there might be some situations where a smaller heap size is achieved for an application, but overall application performance decreases.

For example, if your application synchronizes on objects that are not typically synchronized on, such as Java.lang.String, run the following test: Use the following command-line option to revert to behavior that is closer to earlier versions and monitor application performance:

-Xlockword:mode=all\n

If performance does not improve, remove the previous command-line options or use the following command-line option to reestablish the new behavior:

-Xlockword:mode=default\n
"},{"location":"xlockword/#nolockword","title":"nolockword","text":"
    -Xlockword:nolockword=<class_name>\n

Removes the lockword from object instances of the class <class_name>, reducing the space required for these objects. However, this action might have an adverse effect on synchronization for those objects.

You should only use this option for troubleshooting.

"},{"location":"xlockword/#what","title":"what","text":"
    -Xlockword:what\n
Shows the current lockword configuration."},{"location":"xlog/","title":"-Xlog","text":""},{"location":"xlog/#-xlog","title":"-Xlog","text":"

This option is supported for better compatibility with the reference implementation. However, only forms of -Xlog that enable garbage collection (GC) logging are recognized. Note that the behavior of this option changed in Eclipse OpenJ9\u2122 0.24.0.

"},{"location":"xlog/#syntax","title":"Syntax","text":"
    -Xlog[:<parameters>]\n

Note: In Eclipse OpenJ9 version 0.24.0, the -Xsyslog option replaced the existing OpenJ9 -Xlog option for message logging to avoid conflicts with the reference implementation. For backward compatibility, you can control the behavior of the -Xlog option with the -XX:[+|-]LegacyXlogOption option.

"},{"location":"xlog/#explanation","title":"Explanation","text":"

Use of the -Xlog option is supported for GC logging only. The following table describes the behavior of the option depending on what you specify on the command line.

-Xlog option type Behavior An option that returns GC data. For example -Xlog:gc An equivalent OpenJ9 GC logging option is enabled. See the next table for more details. An option that, in the reference implementation, returns GC data and also other data. For example: -Xlog, -Xlog:all, -Xlog:gc+<other_tag>, or -Xlog:gc:stdout An equivalent OpenJ9 GC logging option is enabled as before but because non-GC data is not supported, the following error message is also produced: JVMJ9VM007W Command-line option unrecognised: <option> An option that, in the reference implementation, returns only non-GC data Non-GC data is not supported, so the following error message is produced: JVMJ9VM007W Command-line option unrecognised: <option>

The following table shows some examples of the mapping between -Xlog parameters and the equivalent OpenJ9 GC parameters:

-Xlog parameter OpenJ9 GC equivalent -Xlog:gc -Xlog:gc:stderr -verbose:gc -Xlog:gc:<filename> -Xlog:gc:file=<filename> -Xverbosegclog:<updated_filename>

In the table, the value of <filename> can contain the following tokens, which are processed and passed to the -Xverbosegclog option as <updated_filename>:

"},{"location":"xlog/#see-also","title":"See also","text":""},{"location":"xlp/","title":"-Xlp","text":""},{"location":"xlp/#-xlp","title":"-Xlp","text":"

Requests the Eclipse OpenJ9\u2122 VM to allocate the Java\u2122 object heap and JIT code cache memory with large pages.

Note: This option is deprecated in all versions later than Java 8. Use the -Xlp:codecache and -Xlp:objectheap options instead.

Restriction: This option does not work on macOS\u00ae.

If you use the -Xgc:preferredHeapBase option with -Xlp, the preferredHeapBase address must be a multiple of the large page size. If you specify an inaccurate heap base address, the heap is allocated with the default page size.

To find out the large page sizes available and the current setting, use the -verbose:sizes option. These current settings are the requested sizes and not the sizes obtained. For object heap size information, check the -verbose:gc output.

To use the large pages in the VM, enable the large pages support in the operating system for the machine to be used. The process for enabling the large page support differs in different operating systems. For more information, see Configuring large page memory allocation.

If the configured large page size is greater than the size of the total code cache for JIT, then the page size that is used for code cache allocation is recalculated. The next available lower page size on the system is identified and used for the code cache allocation.

For example, if 1 GB, 2 MB and 4 KB pages are available on a system, the VM checks the total size of the JIT code cache. If the total JIT code cache size is not modified (by using the -Xcodecachetotal option), then for a 64-bit VM, the JIT code cache size will be the default size, 256 MB. In this case, the VM does not use 1 GB pages for the code cache because the size of the page exceeds the total size of the code cache (256 MB for 64-bit systems). Thus, the next available page size lower than 256 MB is used for code cache allocation. In this example, the next available lower size page is 2 MB. 128 pages (of 2 MB each) are allocated for the code cache.

"},{"location":"xlp/#syntax","title":"Syntax","text":"
    -Xlp[<size>]\n

For more information about the <size> parameter, see Using -X command-line options.

"},{"location":"xlp/#explanation","title":"Explanation","text":""},{"location":"xlp/#aix","title":"AIX\u00ae","text":"

If <size> is specified, the VM attempts to allocate the JIT code cache memory by using pages of that size. Allocating large pages by using -Xlp is supported only on the 64-bit VM, not the 32-bit VM.

If a size is not specified, this option requests the VM to allocate the Java object heap (the heap from which Java objects are allocated) with large (16 MB) pages.

If large pages are not available, the Java object heap is allocated with the next smaller page size that is supported by the system. AIX requires special configuration to enable large pages.

The VM supports the use of large pages only to back the Java object heap shared memory segments. The VM uses shmget() with the SHM_LGPG and SHM_PIN flags to allocate large pages. The -Xlp option replaces the environment variable IBM_JAVA_LARGE_PAGE_SIZE, which is now ignored if set.

For more information about configuring AIX support for large pages, see Large pages in the AIX product documentation.

"},{"location":"xlp/#linux","title":"Linux\u00ae","text":"

If <size> is specified, the VM attempts to allocate the JIT code cache memory by using pages of that size. Allocating large pages by using -Xlp is supported only on the 64-bit VM, not the 32-bit VM.

If large pages are not available, the VM does not start and produces an error message. The VM uses shmget() to allocate large pages for the heap. Large pages are supported by systems that have Linux kernels v2.6 or higher.

Note: Linux for IBM Z\u00ae supports only a large page size of 1 M.

Depending on the architecture, 1 MB or 2 MB large pages, when available, are the default size for the object heap and the code cache. The options that control these sizes are Xlp:codecache and -Xlp:objectheap.

"},{"location":"xlp/#windows","title":"Windows\u2122","text":"

If <size> is specified, the VM attempts to allocate the JIT code cache memory by using pages of that size.

Allocating large pages by using -Xlp is supported only on the 64-bit VM, not the 32-bit VM.

"},{"location":"xlp/#zos","title":"z/OS\u00ae","text":"

If <size> is specified but unsuccessful, or if executable pages of that size are not supported, 1 M pageable is attempted. If 1 M pageable is not available, the JIT code cache memory is allocated by using the default or smallest available executable page size.

If <size> is not specified, the 1 M nonpageable size is used. If large pages are not supported by the hardware, or enabled in RACF\u00ae, the VM does not start and produces an error message.

Allocating large pages by using -Xlp is supported only on the 64-bit VM, not the 31-bit VM. The -Xlp[<size>] option supports only a large page size of 2 G and 1 M (nonpageable).

1 M pageable pages, when available, are the default size for the object heap and the code cache. The options that control these sizes are Xlp:codecache and -Xlp:objectheap.

Specifying -Xlp1M uses a 1 M pageable size for the code cache, when available. Specifying -Xlp2G sets the object heap size, but generates a warning that 2 G nonpageable pages cannot be used for the code cache. Use the -Xlp:objectheap:pagesize=2G,nonpageable option to avoid the warning.

"},{"location":"xlp/#limitation-and-workaround","title":"Limitation and workaround","text":"

The VM ends if insufficient operating system resources are available to satisfy the request. However, an error message is not issued. There are a number of reasons why the VM cannot honor a large page request. For example, there might be insufficient large pages available on the system at the time of the request. To check whether the -Xlp request was honored, you can review the output from -verbose:gc. Look for the attributes requestedPageSize and pageSize in the -verbose:gc log file. The attribute requestedPageSize contains the value specified by -Xlp. The attribute pageSize is the actual page size used by the VM.

"},{"location":"xlp/#see-also","title":"See also","text":""},{"location":"xlpcodecache/","title":"-Xlp:codecache","text":""},{"location":"xlpcodecache/#-xlpcodecache","title":"-Xlp:codecache","text":"

Requests the Eclipse OpenJ9\u2122 VM to allocate the JIT code cache by using large page sizes.

If the requested large page size is not available, the VM starts, but the JIT code cache is allocated by using a platform-defined size. A warning is displayed when the requested page size is not available.

To find out the large page sizes available and the current setting, use the -verbose:sizes option. These current settings are the requested sizes and not the sizes obtained. For object heap size information, check the -verbose:gc output.

To use the large pages in the VM, enable the large pages support on your local system. The process for enabling the large page support differs in different operating systems. For more information, see Configuring large page memory allocation.

If the configured large page size is greater than the size of the total code cache for JIT, then the page size that is used for code cache allocation is recalculated. The next available lower page size on the system is identified and used for the code cache allocation.

For example, if 1 GB, 2 MB and 4 KB pages are available on a system, the VM checks the total size of the JIT code cache. If the total JIT code cache size is not modified (by using the -Xcodecachetotal option), then for a 64-bit VM, the JIT code cache size will be the default size, 256 MB. In this case, the VM does not use 1 GB pages for the code cache because the size of the page exceeds the total size of the code cache (256 MB for 64-bit systems). Thus, the next available page size lower than 256 MB is used for code cache allocation. In this example, the next available lower size page is 2 MB. 128 pages (of 2 MB each) are allocated for the code cache.

"},{"location":"xlpcodecache/#syntax","title":"Syntax","text":"

AIX\u00ae, Linux\u00ae, macOS\u00ae, and Windows\u2122:

    -Xlp:codecache:pagesize=<size>\n

z/OS\u00ae:

    -Xlp:codecache:pagesize=<size>,pageable\n

For more information about the <size> parameter, see Using -X command-line options.

"},{"location":"xlpcodecache/#default-values","title":"Default values","text":""},{"location":"xlpcodecache/#aix","title":"AIX","text":"

The code cache page size is controlled by the DATAPSIZE setting of the LDR_CNTRL environment variable. The page size cannot be controlled by the -Xlp:codecache:pagesize=<size> option. Specifying any other page size results in a warning that the page size is not available. The -verbose:sizes output reflects the current operating system setting.

For more information about the LDR_CNTRL environment variable, see Configuring large page memory allocation: AIX systems.

"},{"location":"xlpcodecache/#linux","title":"Linux","text":"

The default size for the code cache depends on the architecture:

"},{"location":"xlpcodecache/#macos","title":"macOS","text":"The default size for the code cache is 4 KB large pages."},{"location":"xlpcodecache/#zos","title":"z/OS","text":"

1 MB pageable pages, when available, are the default size for the code cache.

The -Xlp:codecache:pagesize=<size>,pageable option supports only a large page size of 1 MB pageable large pages. The use of 1 MB pageable large pages for the JIT code cache can improve the runtime performance of some Java\u2122 applications. A page size of 4 KB can also be used.

"},{"location":"xlpcodecache/#see-also","title":"See also","text":""},{"location":"xlpobjectheap/","title":"-Xlp:objectheap","text":""},{"location":"xlpobjectheap/#-xlpobjectheap","title":"-Xlp:objectheap","text":"

Requests the Eclipse OpenJ9\u2122 VM to allocate the Java\u2122 object heap by using large page sizes.

To find out the large page sizes available and the current setting, use the -verbose:sizes option. Note that the current settings are the requested sizes and not the sizes obtained. For object heap size information, check the -verbose:gc output.

"},{"location":"xlpobjectheap/#syntax","title":"Syntax","text":"

AIX\u00ae, Linux\u00ae, macOS\u00ae, and Windows\u2122:

    -Xlp:objectheap:pagesize=<size>[,strict|warn]\n

z/OS\u00ae:

    -Xlp:objectheap:pagesize=<size>[,strict|warn][,pageable|nonpageable]\n

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xlpobjectheap/#parameters","title":"Parameters","text":""},{"location":"xlpobjectheap/#pagesize","title":"pagesize","text":"
    -Xlp:objectheap:pagesize=<size>\n

The large page size that you require.

If the operating system does not have sufficient resources to satisfy the request, the page size you requested might not be available when the VM starts up. By default, the VM starts and the Java object heap is allocated by using a different platform-defined page size. Alternatively, you can use the strict or warn suboptions to customize behavior.

"},{"location":"xlpobjectheap/#default-page-sizes","title":"Default page sizes","text":"

On Linux systems, the default size for the object heap depends on the architecture:

On macOS, the default page size is 4 KB.

On z/OS systems, the default page size is 1 MB pageable large pages. For more information, see pageable|nonpageable.

"},{"location":"xlpobjectheap/#strict-warn","title":"strict | warn","text":"
    -Xlp:objectheap:strict\n    -Xlp:objectheap:warn\n

Note: If both strict and warn are specified, strict takes precedence.

"},{"location":"xlpobjectheap/#pageablenonpageable","title":"pageable|nonpageable","text":"
    -Xlp:objectheap:pageable\n    -Xlp:objectheap:nonpageable\n

On z/OS systems, defines the type of memory to allocate for the Java object heap.

1 MB pageable large pages, when available, are the default size for the object heap.

64-bit VMs support large page sizes of 1 MB nonpageable and 2 GB nonpageable with the following requirements:

31-bit VMs support a large page size of only 1 MB pageable.

A page size of 4 KB can also be used.

"},{"location":"xlpobjectheap/#examples","title":"Examples","text":"
  1. z/OS: To allocate 1 GB of real memory by using 1 MB nonpageable pages when the VM starts, set the following options:
-Xmx1023m -Xms512m -Xlp:objectheap:pagesize=1M,nonpageable\n
  1. z/OS: To allocate 1 GB of real memory by using 2 GB nonpageable pages, set the following options:
-Xmx1023m -Xms512m -Xlp:objectheap:pagesize=2G,nonpageable\n

In this example the heap is allocated on a 2 GB large page. Even though the object heap is only 1 GB, 2 GB of memory are consumed and the large page is never paged out while the VM is running.

"},{"location":"xlpobjectheap/#see-also","title":"See also","text":""},{"location":"xmca/","title":"-Xmca","text":""},{"location":"xmca/#-xmca-xmco","title":"-Xmca / -Xmco","text":"

Sets the expansion step for the memory allocated to store the RAM (-Xmca) and ROM (-Xmco) portions of loaded classes.

Each time more memory is required to store classes in RAM or ROM, the allocated memory is increased by the amount set.

If the expansion step size you choose is too large, OutOfMemoryError is reported. The exact value of a \"too large\" expansion step size varies according to the platform and the specific machine configuration.

You can use the -verbose:sizes option to find out the value that is being used by the VM.

"},{"location":"xmca/#syntax","title":"Syntax","text":"Setting Effect Default -Xmca<size> Set expansion step for RAM 32 KB -Xmco<size> Set expansion step for ROM 128 KB

See Using -X command-line options for more information about the <size> parameter.

This option cannot be used with the metronome GC policy (-Xgcpolicy:metronome) because the heap is always fully expanded.

"},{"location":"xmca/#see-also","title":"See also","text":""},{"location":"xmcrs/","title":"-Xmcrs","text":""},{"location":"xmcrs/#-xmcrs","title":"-Xmcrs","text":"

Sets an initial size for an area in memory that is reserved for any native classes, monitors, and threads that are used by compressed references within the lowest 4 GB memory area.

You can use the -verbose:sizes option to find out the value that is being used by the VM.

Notes:

"},{"location":"xmcrs/#syntax","title":"Syntax","text":"
    -Xmcrs<size>\n

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xmine/","title":"-Xmaxe","text":""},{"location":"xmine/#-xmine-xmaxe","title":"-Xmine / -Xmaxe","text":"

Set the minimum and maximum amounts by which the garbage collector expands the heap.

"},{"location":"xmine/#syntax","title":"Syntax","text":"Setting Default -Xmine<size> 1 MB -Xmaxe<size> 0 (unlimited expansion)

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xmine/#explanation","title":"Explanation","text":"

Typically, the garbage collector expands the heap by the amount required to restore the free space to 30% (or the amount specified by -Xminf).

If heap expansion is required:

For the gencon GC policy, the values apply only to the tenure part of the heap. For the balanced, optthruput, and optavgpause GC policies, these values apply to the whole heap. This option cannot be used with the metronome GC policy (-Xgcpolicy:metronome) because the heap is always fully expanded.

"},{"location":"xmine/#see-also","title":"See also","text":""},{"location":"xminf/","title":"-Xmaxf","text":""},{"location":"xminf/#-xminf-xmaxf","title":"-Xminf / -Xmaxf","text":"

Specifies the minimum and maximum proportion of the heap that must remain free after a global garbage collection (GC) cycle.

If the free space is above or below these limits, the Eclipse OpenJ9\u2122 VM attempts to adjust the heap size so that: -Xminf \u2264 free space \u2264 -Xmaxf.

"},{"location":"xminf/#syntax","title":"Syntax","text":"Setting Effect Default -Xminf<value> Set minimum free space 0.3 -Xmaxf<value> Set maximum free space 0.6

The value range is 0.0 - 1.0.

"},{"location":"xminf/#see-also","title":"See also","text":""},{"location":"xmint/","title":"-Xmaxt","text":""},{"location":"xmint/#-xmint-xmaxt","title":"-Xmint / -Xmaxt","text":"

Sets the minimum and maximum proportion of time to spend in the garbage collection (GC) process as a percentage of the overall running time that included the last three GC runs. Therefore, the time spent in the GC process includes time spent in global mark phase and global GC operations but excludes partial garbage collection pauses because the latter apply only to the eden space.

Restrictions:

"},{"location":"xmint/#syntax","title":"Syntax","text":"Setting Effect Default for balanced policy Default for other policies -Xmint<value> Set minimum time in GC 0.02 0.05 -Xmaxt<value> Set maximum time in GC 0.05 0.13 "},{"location":"xmint/#see-also","title":"See also","text":""},{"location":"xmn/","title":"-Xmn","text":""},{"location":"xmn/#-xmn-xmns-xmnx","title":"-Xmn / -Xmns / -Xmnx","text":"

Sets the initial and maximum size of the nursery area when using the gencon garbage collection (GC) policy (-Xgcpolicy:gencon), and sets the size of eden when using the balanced garbage collection (GC) policy (-Xgcpolicy:balanced). These options are ignored if they are used with any other GC policy.

You can use the -verbose:sizes option to find out the value that is being used by the VM.

"},{"location":"xmn/#syntax","title":"Syntax","text":"Setting Effect Default -Xmn<size> Equivalent to setting both -Xmns and -Xmnx Not set -Xmns<size> Set initial size 25% of -Xms when using gencon and balanced policies -Xmnx<size> Set maximum size 25% of -Xmx when using gencon, and 75% of -Xmx when using balanced

See Using -X command-line options for more information about the <size> parameter.

Restriction: If you try to set -Xmn with either -Xmns or -Xmnx, the VM does not start, returning an error.

Notes:

To set the size of the tenure area of the heap when using gencon GC policy, see -Xmo/-Xmos/-Xmox.

"},{"location":"xmn/#see-also","title":"See also","text":""},{"location":"xmo/","title":"-Xmo","text":""},{"location":"xmo/#-xmo-xmos-xmox","title":"-Xmo / -Xmos / -Xmox","text":"

Sets the size of the tenure area of the heap for the gencon garbage collection (GC) policy.

You can use the -verbose:sizes option to find out the values that the VM is currently using.

"},{"location":"xmo/#syntax","title":"Syntax","text":"Setting Effect Default -Xmo<size> Equivalent to setting both -Xmos and -Xmox not set -Xmos<size> Set initial size of the tenure area of the heap 75% of -Xms -Xmox<size> Set maximum size of the tenure area of the heap -Xmx minus -Xmns

where -Xmx refers to the maximum heap size and -Xmns refers to the minimum size of the nursery area of the heap.

Although the tenure and nursery areas of the heap have independent maximum sizes, -Xmox and -Xmnx, the sum of their current sizes cannot be larger than -Xmx.

To set the size of the nursery area of the heap, see -Xmn/-Xmns/-Xmnx.

For more information about the <size> parameter, see Using -X command-line options.

Restriction: If you try to set -Xmo with either -Xmos or -Xmox, the VM does not start, returning an error.

"},{"location":"xmo/#see-also","title":"See also","text":""},{"location":"xmoi/","title":"-Xmoi","text":""},{"location":"xmoi/#-xmoi","title":"-Xmoi","text":"

Sets the heap expansion allocation increment.

You can use the -verbose:sizes option to find out the values that the VM is currently using.

"},{"location":"xmoi/#syntax","title":"Syntax","text":"Setting Effect Default -Xmoi<size> Sets the heap expansion allocation increment See Notes

Notes:

This option is not supported for the metronome GC policy, because the heap is always fully expanded.

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xmoi/#see-also","title":"See also","text":""},{"location":"xmr/","title":"-Xmr","text":""},{"location":"xmr/#-xmr-xmrx","title":"-Xmr / \u00a0 -Xmrx","text":"

Sets the initial and maximum size of the the garbage collection (GC) remembered set in the gencon GC policy. The remembered set is a list of objects in the tenure area of the heap that have references to objects in the new area.

"},{"location":"xmr/#syntax","title":"Syntax","text":"Setting Effect Default -Xmr<size> Set initial size 16 K -Xmrx<size> Set maximium size

See Using -X command-line options for more information about the <size> parameter.

This option applies only to the gencon GC policy.

"},{"location":"xms/","title":"-Xms","text":""},{"location":"xms/#-xms-xmx","title":"-Xms / -Xmx","text":"

These Oracle\u00ae HotSpot\u2122 options set the initial/minimum Java\u2122 heap size, and the maximum heap size respectively. These options are recognized by the Eclipse OpenJ9\u2122 VM.

Notes:

For the gencon GC policy, you can also use the -Xmo option:

"},{"location":"xms/#syntax","title":"Syntax","text":"Setting Effect Default -Xms<size> Set initial heap size 8 MB -Xmx<size> Set maximum heap size 25% of available memory (25 GB maximum)

See Using -X command-line options for more information about the <size> parameter. See Default settings for the OpenJ9 VM for more about default values.

The -Xmx option can be used with all OpenJ9 GC policies. However, the -Xms option can be used with all GC policies except for the metronome GC policy because the heap is always fully expanded.

"},{"location":"xms/#examples","title":"Examples","text":"-Xms2m -Xmx64m Heap starts at 2 MB and grows to a maximum of 64 MB. -Xms100m -Xmx100m Heap starts at 100 MB and never grows. -Xms50m Heap starts at 50 MB and grows to the default maximum. -Xmx256m Heap starts at default initial value and grows to a maximum of 256 MB."},{"location":"xms/#see-also","title":"See also","text":""},{"location":"xmso/","title":"-Xmso","text":""},{"location":"xmso/#-xmso","title":"-Xmso","text":"

Sets the native stack size for operating system threads.

You can use the -verbose:sizes option to find out the values that the VM is currently using.

When a native method makes a call into the VM, the VM calculates whether the memory required for the call will exceed the -Xmso value. If so, a java/lang/StackOverflowError error is thrown.

Note: Java methods and native methods run on two different stacks and the VM handles switching between them for JNI calls. Each stack is sized using separate options; this option applies to the native stack only. For the Java stack option, see the link in the See also section.

"},{"location":"xmso/#syntax","title":"Syntax","text":"
    -Xmso<size>\n

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xmso/#default-setting","title":"Default setting","text":"

Default values vary by platform. See Default settings for the Eclipse OpenJ9\u2122 VM.

Note: On 64-bit z/OS, the default size is the minimum that can be allocated by the operating system. So if you set a value that is smaller, that value is ignored by the VM.

"},{"location":"xmso/#see-also","title":"See also","text":""},{"location":"xnumanone/","title":"-Xnuma:none","text":""},{"location":"xnumanone/#-xnumanone","title":"-Xnuma:none","text":"

(AIX\u00ae, Linux\u00ae, and Windows\u2122 only)

Use this option to turn off non-uniform memory architecture (NUMA) awareness when using the balanced garbage collection policy.

For workloads that do most of their work in one thread, or workloads that maintain a full heap, turning off NUMA awareness can improve performance.

"},{"location":"xnumanone/#syntax","title":"Syntax","text":"
    -Xnuma:none\n
"},{"location":"xnumanone/#default-behavior","title":"Default behavior","text":"

NUMA awareness is enabled by default.

"},{"location":"xoptionsfile/","title":"-Xoptionsfile","text":""},{"location":"xoptionsfile/#-xoptionsfile","title":"-Xoptionsfile","text":"

Specifies a file that contains VM options and definitions.

The contents of the options file are recorded in the ENVINFO section of a Java\u2122 dump.

"},{"location":"xoptionsfile/#syntax","title":"Syntax","text":"
    -Xoptionsfile=<file_name>\n
where <file_name> specifies a file that contains options that are processed as if they had been entered directly as command-line options."},{"location":"xoptionsfile/#explanation","title":"Explanation","text":"

At startup, the VM automatically adds -Xoptionsfile=<path>/options.default at the beginning of the command line, where <path> is the path to the VM directory.

<path> is the VM directory, as shown in Directory conventions. <path> is the <java_home>/lib directory, where <java_home> is the directory for your runtime environment.

The file options.default can be updated with any options that you want to specify at run time.

The options file does not support these options:

Although you cannot use -Xoptionsfile recursively within an options file, you can use -Xoptionsfile multiple times on the same command line to load more than one options files.

Some options use quoted strings as parameters. Do not split quoted strings over multiple lines using the forward slash line continuation character (\\). The Yen symbol (\u00a5) is not supported as a line continuation character. For example, the following example is not valid in an options file:

-Xevents=vmstop,exec=\"cmd /c \\\necho %pid has finished.\"\n

The following example is valid in an options file:

-Xevents=vmstop, \\\nexec=\"cmd /c echo %pid has finished.\"\n
"},{"location":"xoptionsfile/#example","title":"Example","text":"

Here is an example of an options file:

#My options file\n-X<option1>\n-X<option2>=\\\n<value1>,\\\n<value2>\n-D<sysprop1>=<value1>\n
"},{"location":"xoptionsfile/#see-also","title":"See also","text":""},{"location":"xquickstart/","title":"-Xquickstart","text":""},{"location":"xquickstart/#-xquickstart","title":"-Xquickstart","text":"

This option causes the JIT compiler to run with a subset of optimizations, which can improve the performance of short-running applications.

Note: For compatibility with other Java\u2122 virtual machines, you can also specify the -client option, which results in identical behavior to -Xquickstart.

"},{"location":"xquickstart/#syntax","title":"Syntax","text":"
    -Xquickstart\n
"},{"location":"xquickstart/#default-behavior","title":"Default behavior","text":"

By default, -Xquickstart is disabled.

"},{"location":"xquickstart/#explanation","title":"Explanation","text":"

The JIT compiler is tuned for long-running applications typically used on a server. When you specify this option, the compiler uses a subset of optimizations, which results in faster compilation times that improve startup time. However, longer running applications might run more slowly, especially applications that contain hot methods and other methods using a large amount of processing resource.

When the AOT compiler is active (both shared classes and AOT compilation enabled), -Xquickstart causes all methods to be AOT compiled. The AOT compilation improves the startup time of subsequent runs, but might reduce performance for longer running applications, especially those that contain hot methods.

Note: The implementation of -Xquickstart is subject to change in future releases.

"},{"location":"xrs/","title":"-Xrs","text":""},{"location":"xrs/#-xrs","title":"-Xrs","text":"

Prevents the Eclipse OpenJ9\u2122 runtime environment from handling any internally or externally generated signals such as SIGSEGV and SIGABRT. Any signals that are raised are handled by the default operating system handlers, which you might want if you are using a debugger such as GDB or WinDbg to diagnose problems in JNI code.

Disabling signal handling in the OpenJ9 VM reduces performance by approximately 2-4%, depending on the application.

Note: Setting this option prevents dumps being generated by the OpenJ9 VM for signals such as SIGSEGV and SIGABRT, because the VM is no longer intercepting these signals. Do not use the -Xrs option with the following options:

An error is thrown if either of the options is enabled together with the -Xrs option. To resolve this error, one of the options should be disabled.

"},{"location":"xrs/#syntax","title":"Syntax","text":"
    -Xrs\n    -Xrs:sync\n
"},{"location":"xrs/#parameters","title":"Parameters","text":"

If you specify the sync parameter:

Linux and macOS systems always use the SIGUSR1 signal.

"},{"location":"xrs/#see-also","title":"See also","text":""},{"location":"xrsonrestoresynconrestore/","title":"-Xrs:onRestore / -Xrs:syncOnRestore","text":""},{"location":"xrsonrestoresynconrestore/#-xrsonrestore-xrssynconrestore","title":"-Xrs:onRestore / -Xrs:syncOnRestore","text":"

(Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), Linux on AArch64, and Linux on IBM Z\u00ae only)

The -Xrs option is an existing option for disabling signal handling in the VM. CRIU support adds new suboptions onRestore and syncOnRestore for disabling signal handling when you restore a VM.

If the VM was started with signal handling enabled, then when you restore the VM, the signal handling is enabled by default. It is possible that there are frames with attached signal handlers already on the stack. These frames remain unchanged and their signal handlers remain active. Likewise, some global handlers might not be removed as well. The new options prevent the addition of new signal handlers and force recompilation of Java\u2122 methods that make use of the existing signal handlers.

Restrictions: This option takes effect only when the -XX:+EnableCRIUSupport option is enabled. This option can be used only on restore.

"},{"location":"xrsonrestoresynconrestore/#parameters","title":"Parameters","text":""},{"location":"xrsonrestoresynconrestore/#onrestore","title":"onRestore","text":"
    -Xrs:onRestore\n

The -Xrs:onRestore option is similar to the -Xrs option.

"},{"location":"xrsonrestoresynconrestore/#synconrestore","title":"syncOnRestore","text":"
    -Xrs:syncOnRestore\n

The -Xrs:syncOnRestore option is similar to the -Xrs:sync option.

Although there are similarities between the existing options and the new CRIU related options, there are behavioural differences that limits what can be disabled with the existing options at the restore time.

"},{"location":"xrsonrestoresynconrestore/#see-also","title":"See also","text":""},{"location":"xsamplingexpirationtime/","title":"-XsamplingExpirationTime","text":""},{"location":"xsamplingexpirationtime/#-xsamplingexpirationtime","title":"-XsamplingExpirationTime","text":"

Disables JIT sampling after a specified amount of time.

When the JIT sampling thread is disabled, no processor cycles are used by an idle Eclipse OpenJ9\u2122 VM.

Use this option with care; after the sampling thread is disabled, you cannot reactivate it. However, because the profiling frequency is automatically reduced, you should not have to use this option.

Allow the sampling thread to run for long enough to identify important optimizations.

"},{"location":"xsamplingexpirationtime/#syntax","title":"Syntax","text":"
    -XsamplingExpirationTime<time>\n
where <time> is specified in seconds."},{"location":"xsamplingexpirationtime/#explanation","title":"Explanation","text":"

The JIT sampling thread profiles the running Java\u2122 application to discover commonly used methods. The memory and processor usage of the sampling thread is negligible, and the frequency of profiling is automatically reduced when the OpenJ9 VM is idle, to once per second instead of once every 10ms, or once every 100 seconds if the idle state lasts more than 50 seconds.

"},{"location":"xscdmx/","title":"-Xscdmx","text":""},{"location":"xscdmx/#-xscdmx","title":"-Xscdmx","text":"

Use the -Xscdmx option to control the size of the class debug area when you create a shared classes cache.

"},{"location":"xscdmx/#syntax","title":"Syntax","text":"
    -Xscdmx<size>\n

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xscdmx/#explanation","title":"Explanation","text":"

The -Xscdmx option works in a similar way to the -Xscmx option, which is used to control the overall size of the shared classes cache. The size of -Xscdmx must be smaller than the size of -Xscmx. By default, the size of the class debug area is a percentage of the free class data bytes in a newly created or empty cache.

A class debug area is still created if you use the -Xnolinenumbers option with the -Xscdmx option on the command line.

"},{"location":"xscminaot/","title":"-Xscmaxaot","text":""},{"location":"xscminaot/#-xscminaot-xscmaxaot","title":"-Xscminaot / -Xscmaxaot","text":"

When you create a shared classes cache, you can use these options to set the minimum and maximum number of bytes in the class cache to reserve for AOT data.

Setting -Xscmaxaot is useful if you want a certain amount of cache space guaranteed for non-AOT data.

"},{"location":"xscminaot/#syntax","title":"Syntax","text":"Setting Effect Default -Xscminaot<size> Set minimum size for AOT class cache 0 -Xscmaxaot<size> Set maximum size for AOT class cache The amount of free space in the cache

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xscminaot/#-xscminaot","title":"-Xscminaot","text":"

If -Xscminaot is not specified, no space is reserved for AOT data. However, AOT data is still written to the cache until the cache is full or the -Xscmaxaot limit is reached.

The value of -Xscminaot must not exceed the value of -Xscmx or -Xscmaxaot and should be considerably less than the total cache size, because AOT data can be created only for cached classes. If the value of -Xscminaot equals the value of -Xscmx, no class data or AOT data can be stored.

"},{"location":"xscminaot/#-xscmaxaot","title":"-Xscmaxaot","text":"

The value of this option must not be smaller than the value of -Xscminaot and must not be larger than the value of -Xscmx.

When you run an application with the -Xshareclasses:verbose option, the VM writes to the console the amount of AOT data that is not stored due to the current setting of the maximum AOT data space. You can also get this information by using the MemoryMXBean.getSharedClassCacheMaxAotUnstoredBytes() method in the com.ibm.lang.management API. You can increase the maximum AOT data space size accordingly if you want to add the unstored AOT data to the shared cache.

"},{"location":"xscminaot/#see-also","title":"See also","text":""},{"location":"xscminjitdata/","title":"-Xscmaxjitdata","text":""},{"location":"xscminjitdata/#-xscminjitdata-xscmaxjitdata","title":"-Xscminjitdata / -Xscmaxjitdata","text":"

When you create a shared classes cache, you can use these options to set a minimum and maximum number of bytes in the class cache that can be used for JIT data.

When you run an application with the -Xshareclasses:verbose option, the VM writes to the console the amount of JIT data that is not stored due to the current setting of the the maximum JIT data space. You can also get this information by using the MemoryMXBean.getSharedClassCacheMaxJitDataUnstoredBytes() method in the com.ibm.lang.management API.

You can increase the maximum JIT data space size accordingly if you want to add the unstored data to the shared cache. However, the VM that provided the information no longer has the opportunity to store the JIT data. Subsequent VMs can store JIT data in the shared cache.

"},{"location":"xscminjitdata/#syntax","title":"Syntax","text":"Setting Effect Default -Xscminjitdata<size> Set minimum size for JIT data 0 (See Default behavior) -Xscmaxjitdata<size> Set maximum size for JIT data The amount of free space in the cache

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xscminjitdata/#default-behavior","title":"Default behavior","text":"

If -Xscminjitdata is not specified, no space is reserved for JIT data, although JIT data is still written to the cache until the cache is full or the -Xscmaxjitdata limit is reached.

"},{"location":"xscminjitdata/#explanation","title":"Explanation","text":""},{"location":"xscminjitdata/#-xscminjitdata","title":"-Xscminjitdata","text":"

The value of -Xscminjitdata must not exceed the value of -Xscmx or -Xscmaxjitdata. The value of -Xscminjitdata must always be considerably less than the total cache size, because JIT data can be created only for cached classes. If the value of -Xscminjitdata equals the value of -Xscmx, no class data or JIT data can be stored.

"},{"location":"xscminjitdata/#-xscmaxjitdata","title":"-Xscmaxjitdata","text":"

Setting -Xscmaxjitdata is useful if you want a certain amount of cache space guaranteed for non-JIT data. If this option is not specified, the maximum limit for JIT data is the amount of free space in the cache. The value of this option must not be smaller than the value of -Xscminjitdata, and must not be larger than the value of -Xscmx.

"},{"location":"xscminjitdata/#see-also","title":"See also","text":""},{"location":"xscmx/","title":"-Xscmx","text":""},{"location":"xscmx/#-xscmx","title":"-Xscmx","text":"

For a new shared classes cache, specifies either:

This option applies only if a cache is being created and no cache of the same name exists.

When you run an application with the -Xshareclasses:verbose option, the VM writes to the console the number of bytes that are not stored due to the current setting of the soft maximum size. You can also get this information by using the MemoryMXBean.getSharedClassCacheSoftmxUnstoredBytes() method in the com.ibm.lang.management API.

You can increase the soft maximum size accordingly if you want to add the unstored data to the shared cache. However, the VM that provided the information no longer has the opportunity to store that data. Therefore, increasing the soft maximum size does not necessarily cause any more data to be stored in the shared cache by the current VM, but subsequent VMs can add data to the shared cache.

"},{"location":"xscmx/#syntax","title":"Syntax","text":"
    -Xscmx<size>\n

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xscmx/#explanation","title":"Explanation","text":""},{"location":"xscmx/#setting-a-soft-maximum-size","title":"Setting a soft maximum size","text":"

If you specify the -Xscmx option with the -XX:SharedCacheHardLimit option, the -Xscmx option sets the soft maximum size of a new shared classes cache, and the -XX:SharedCacheHardLimit option sets the actual maximum size. The value of the -Xscmx option must therefore not exceed the value of -XX:SharedCacheHardLimit.

When the soft maximum limit is reached, no more data can be added into the shared cache, unless there is reserved AOT or JIT data space. If such reserved space exists, AOT or JIT data can still be added into the reserved space. The reserved AOT and JIT data spaces are counted as used space within the soft maximum size, so the soft maximum size should not be less than the minimum reserved space for AOT and JIT data if you specify the -Xscminaot or -Xscminjitdata options.

You can change the soft maximum size by using the -Xshareclasses:adjustsoftmx=<size> option or the MemoryMXBean.setSharedClassCacheSoftmxBytes() method in the com.ibm.lang.management API. By using this API, Java\u2122 applications can dynamically monitor and adjust the cache soft maximum size as required. This function can be useful in virtualized or cloud environments, for example, where the shared cache size might change dynamically to meet business needs.

For example, you might create a 64 MB shared cache and set a smaller value, such as 16 MB, for the -Xscmx option, to limit the data stored in the cache:

-XX:SharedCacheHardLimit=64m -Xscmx16m\n

You can then use the com.ibm.lang.management API from within a Java application to increase the soft maximum value during run time, as load increases. This change allows the application to use more shared cache space than you specified initially.

You can increase the soft maximum size if it is currently less than the actual cache size. If you attempt to reduce the soft maximum size to a value that is less than the number of bytes already used in the cache, the number of used bytes is set as the new soft maximum size.

"},{"location":"xscmx/#cache-size-limits","title":"Cache size limits","text":"

The theoretical cache size limit is 2 GB. The size of the cache that you can specify is limited by the following factors:

Non-persistent caches are stored in shared memory and are removed when a system is rebooted. On systems other than Windows, non-persistent caches are allocated by using the System V IPC shared memory mechanism. To ensure that sufficient shared memory is available for class data sharing, see Setting shared memory values.

Note: By default, a cache is persistent on all platforms, except z/OS.

"},{"location":"xscmx/#see-also","title":"See also","text":""},{"location":"xshareclasses/","title":"-Xshareclasses","text":""},{"location":"xshareclasses/#-xshareclasses","title":"-Xshareclasses","text":"

Use the -Xshareclasses option to enable, disable, or modify class sharing behavior. Class data sharing is enabled by default for bootstrap classes only (the equivalent of specifying -Xshareclasses:bootClassesOnly,nonFatal,silent), unless your application is running in a container.

This option can take a number of parameters, some of which are cache utilities. Cache utilities carry out specific operations on a specified cache without starting the Java virtual machine (VM). Although you can combine multiple suboptions, which are separated by commas, the cache utilities are mutually exclusive.

Some cache utilities can work with caches from previous Java\u2122 versions or caches that are created by VMs with different bit-widths. These caches are referred to as \"incompatible\" caches.

See also the Class data sharing topic, which includes some best practices for using -Xshareclasses.

"},{"location":"xshareclasses/#syntax","title":"Syntax","text":"
    -Xshareclasses:<parameter>\n

When you specify -Xshareclasses without any parameters and without specifying either the -Xscmx or -XX:SharedCacheHardLimit options, a shared classes cache is created with a default size, as follows:

"},{"location":"xshareclasses/#parameters","title":"Parameters","text":""},{"location":"xshareclasses/#adjustmaxaot-cache-utility","title":"adjustmaxaot (Cache utility)","text":"
    -Xshareclasses:adjustmaxaot=<size>\n
Adjusts the maximum shared classes cache space that is allowed for AOT data. When you use the -Xshareclasses:verbose option, the VM writes to the console the number of bytes that are not stored due to the current setting of the -Xscmaxaot option."},{"location":"xshareclasses/#adjustminaot-cache-utility","title":"adjustminaot (Cache utility)","text":"
    -Xshareclasses:adjustminaot=<size>\n
Adjusts the minimum shared classes cache space that is reserved for AOT data. Use the -Xscminaot option to set the initial minimum size."},{"location":"xshareclasses/#adjustmaxjitdata-cache-utility","title":"adjustmaxjitdata (Cache utility)","text":"
    -Xshareclasses:adjustmaxjitdata=<size>\n
Adjusts the maximum shared classes cache space that is allowed for JIT data. When you use the -Xshareclasses:verbose option, the VM writes to the console the number of bytes that are not stored due to the current setting of the -Xscmaxjitdata option."},{"location":"xshareclasses/#adjustminjitdata-cache-utility","title":"adjustminjitdata (Cache utility)","text":"
    -Xshareclasses:adjustminjitdata=<size>\n
Adjusts the minimum shared classes cache space that is reserved for JIT data. Use the -Xscminjitdata option to set the initial minimum size."},{"location":"xshareclasses/#adjustsoftmx-cache-utility","title":"adjustsoftmx (Cache utility)","text":"
    -Xshareclasses:adjustsoftmx=<size>\n
Adjusts the soft maximum size of the cache. When you use the -Xshareclasses:verbose option, the VM writes to the console the number of bytes that are not stored due to the current setting of the soft maximum size. For more information about the soft maximum size, see -Xscmx."},{"location":"xshareclasses/#allowclasspaths","title":"allowClasspaths","text":"
    -Xshareclasses:allowClasspaths\n
Allows a VM to store classpaths into an existing shared cache that was created by using the restrictClasspaths option."},{"location":"xshareclasses/#bootclassesonly","title":"bootClassesOnly","text":"
    -Xshareclasses:bootClassesOnly\n
Disables caching of classes that are loaded by class loaders other than the bootstrap class loader. If you use this suboption, the nonfatal suboption is also set, so this suboption is the equivalent of specifying -Xshareclasses:bootClassesOnly,nonfatal."},{"location":"xshareclasses/#cachedir","title":"cacheDir","text":"
    -Xshareclasses:cacheDir=<directory>\n

Sets the directory in which cache data is read and written. Do not set the cache directory on an NFS mount or a shared mount across systems or LPARs. The following defaults apply:

On all operating systems, the VM writes persistent cache files directly into the directory specified. Persistent cache files can be safely moved and deleted from the file system.

Non-persistent caches are stored in shared memory and have control files that describe the location of the memory. Control files are stored in a javasharedresources subdirectory of the cacheDir specified. Do not move or delete control files in this directory. The listAllCaches utility, the destroyAll utility, and the expire suboption work only in the scope of a given cacheDir.

On AIX, Linux, and macOS systems, if you specify the cacheDir=<directory> option, persistent caches are created with the following permissions (-rw-r--r--):

Otherwise, persistent caches are created with the same permissions as non-persistent caches. The permissions for non-persistent caches are -rw-r-----, or -rw-rw---- if you also specify -Xshareclasses:groupAccess.

Note: It is good practice to set an application-specific cache directory to avoid sharing the default cache directory with the default cache, or other application caches that don't set a cache directory, and means that your application is therefore unaffected by a user running java -Xshareclasses:destroyAll. See Class data sharing: Best practices for using -Xshareclasses.

"},{"location":"xshareclasses/#cachedirperm","title":"cacheDirPerm","text":"(Not Windows)
-Xshareclasses:cacheDirPerm=<permission>\n

Sets Unix-style permissions when you are creating a cache directory. <permission> must be an octal number in the ranges 0700 - 0777 or 1700 - 1777. If <permission> is not valid, the VM ends with an appropriate error message.

The permissions that are specified by this suboption are used only when you are creating a new cache directory. If the cache directory already exists, this suboption is ignored and the cache directory permissions are not changed.

If you set this suboption to 0000, the default directory permissions are used. If you set this suboption to 1000, the machine default directory permissions are used, but the sticky bit is enabled.

If the cache directory is the platform default directory, this suboption is ignored. The permission is set as specified in the following conditions and permissions table.

If you do not set this suboption, the default permissions are used according to the following conditions:

Condition Permissions The cache directory is /tmp/javasharedresources. If this directory already exists with different permissions, the permissions are changed when the cache is opened.\u2020 0777 The cache directory already exists and is not /tmp/javasharedresources Unchanged The cache directory is a new directory and you also specify the groupAcess suboption 0770 The cache directory is a new directory and you do not specify the groupAccess suboption 0700 \u2020On z/OS systems, permissions for existing cache directories are unchanged, to avoid generating RACF\u00ae errors, which generate log messages. Note: It is good practice to explicitly set permissions for the cache directory when the defaults are not appropriate. See Class data sharing: Best practices for using -Xshareclasses."},{"location":"xshareclasses/#cacheretransformed","title":"cacheRetransformed","text":"
    -Xshareclasses:cacheRetransformed\n
Enables caching of classes that are transformed by using the JVMTI RetransformClasses function. For more information, see Redefined and retransformed classes.

The option enableBCI is enabled by default. However, if you use the cacheRetransformed option, this option forces cache creation into -Xshareclasses:disableBCI mode.

"},{"location":"xshareclasses/#checkurltimestamps","title":"checkURLTimestamps","text":"
    -Xshareclasses:checkURLTimestamps\n
Causes timestamps of jar or zip files to be checked every time a class is loaded. If a timestamp has changed, the class is loaded from the jar or zip file and not from the shared cache. This suboption is not enabled by default and reflects the legacy behavior of the shared classes cache. Note: The timestamp of a bootstrap jar or zip file is checked once when it is used for the first time to load a class."},{"location":"xshareclasses/#createlayer","title":"createLayer","text":"

(64-bit only)

    -Xshareclasses:createLayer\n
Creates layered caches. If there are multiple VMs in a race condition while creating a layered cache, more than one new layered cache can be created. To avoid this situation, use the -Xshareclasses:layer=<number> suboption to create a new layered cache with a specific layer number. See layer for more information about layered caches."},{"location":"xshareclasses/#destroy-cache-utility","title":"destroy (Cache utility)","text":"
    -Xshareclasses:destroy\n
Destroys a cache that is specified by the name, cacheDir, and nonpersistent suboptions. A cache can be destroyed only if all VMs that are using it have ended and the user has sufficient permissions."},{"location":"xshareclasses/#destroyall-cache-utility","title":"destroyAll (Cache utility)","text":"
    -Xshareclasses:destroyAll\n
Tries to destroy all the caches that are specified by the cacheDir and nonpersistent suboptions. On Windows and z/OS systems, a cache can be destroyed only if all VMs that are using it have shut down and the user has sufficient permissions. Note: On z/OS, when the destroyAll option is invoked from a 31-bit VM, 64-bit caches are not destroyed. Similarly, when the destroyAll option is invoked from a 64-bit VM, 31-bit caches are not destroyed. The following message is displayed:
JVMSHRC735I: Use a nn-bit VM to perform the requested operation on the\nnn-bit shared cache \"cachename\" as the nn-bit VM\ncannot verify that the shared memory was created by the VM.\n

On AIX, Linux, and macOS systems:

"},{"location":"xshareclasses/#destroyalllayers-cache-utility","title":"destroyAllLayers (Cache utility)","text":"

(64-bit only)

    -Xshareclasses:destroyAllLayers\n
Destroys all shared cache layers that are specified by the name suboption. For example, -Xshareclasses:name=Cache1,destroyAllLayers destroys all layers of the cache called Cache1. If you use the destroy suboption on a layered cache, for example -Xshareclasses:name=Cache1,destroy, only the top layer of the cache is destroyed. For more information about layered caches, see Creating layer caches."},{"location":"xshareclasses/#destroyallsnapshots-cache-utility","title":"destroyAllSnapshots (Cache utility)","text":"(Not Windows)
-Xshareclasses:destroyAllSnapshots\n

Destroys all shared cache snapshots that are available as a result of the specified cacheDir suboption.

"},{"location":"xshareclasses/#destroysnapshot-cache-utility","title":"destroySnapshot (Cache utility)","text":"(Not Windows)
-Xshareclasses:destroySnapshot\n

Destroys a snapshot that is specified by the name and cacheDir suboptions.

"},{"location":"xshareclasses/#disablebci","title":"disableBCI","text":"
    -Xshareclasses:disableBCI\n
Turns off BCI support. This option can be used to override -XXShareClassesEnableBCI."},{"location":"xshareclasses/#enablebci","title":"enableBCI","text":"
    -Xshareclasses:enableBCI\n
This option is enabled by default. Allows a JVMTI ClassFileLoadHook event to be triggered every time, for classes that are loaded from the cache. This mode also prevents caching of classes that are modified by JVMTI agents. For more information about bytecode modification, see Support for bytecode instrumentation. This option is incompatible with the cacheRetransformed option. Using the two options together causes the VM to end with an error message, unless -Xshareclasses:nonfatal is specified. In this case, the VM continues without using shared classes. A cache that is created without the enableBCI suboption cannot be reused with the enableBCI suboption. Attempting to do so causes the VM to end with an error message, unless -Xshareclasses:nonfatal is specified. In this case, the VM continues without using shared classes. A cache that is created with the enableBCI suboption can be reused without specifying this suboption. In this case, the VM detects that the cache was created with the enableBCI suboption and uses the cache in this mode."},{"location":"xshareclasses/#expire-cache-utility","title":"expire (Cache utility)","text":"
    -Xshareclasses:expire=<time_in_minutes>\n
Destroys all caches that are unused for the time that is specified before loading shared classes. This option is not a utility option because it does not cause the VM to exit. On Windows systems, which have NTFS file systems, the expire option is accurate to the nearest hour."},{"location":"xshareclasses/#fatal","title":"fatal","text":"
    -Xshareclasses:fatal\n
The VM does not start if class data sharing fails, for example because there was an error when accessing the cache directory. An error message is generated. This suboption is specified by default unless you use the bootClassesOnly suboption, which is equivalent to -Xshareclasses:bootClassesOnly,nonfatal. You can override this behavior by specifying -Xshareclasses:bootClassesOnly,fatal. See also nonfatal."},{"location":"xshareclasses/#findaotmethods-cache-utility","title":"findAotMethods (Cache utility)","text":"
    -Xshareclasses:findAotMethods=<method_specification>\n    -Xshareclasses:findAotMethods=help\n
Print the AOT methods in the shared classes cache that match the method specifications. Methods that are already invalidated are indicated in the output. Use this suboption to check which AOT methods in the shared classes cache would be invalidated by using the same method specifications with the invalidateAotMethods suboption. To learn more about the syntax to use for <method_specification>, including how to specify more than one method, see Method specification syntax."},{"location":"xshareclasses/#groupaccess","title":"groupAccess","text":"(Not Windows)
-Xshareclasses:groupAccess\n

Sets operating system permissions on a new cache to allow group access to the cache. Group access can be set only when permitted by the operating system umask setting. The default is user access only.

On AIX, Linux, and macOS systems, if a user creates a cache by specifying the groupAccess suboption, other users in the same group must also specify this suboption to be granted access to the same cache.

When groupAccess is specified, the default directory for a cache is /tmp/javasharedresources. Some systems might clear the content of the /tmp directory on a reboot, removing the shared cache. To avoid that problem, you are therefore recommended to use cacheDir to set a different location for the cache. If necessary, use cacheDirPerm to ensure that the cache directory permissions are set appropriately.

In certain situations, warning messages might be generated when the groupAccess suboption is used.

This message can occur when persistent caches are used:

JVMSHRC756W Failed to set group access permission on the shared cache\nfile as requested by the 'groupAccess' sub-option\n

These messages can occur when non-persistent caches are used:

JVMSHRC759W Failed to set group access permission as requested by the\n'groupAccess' sub-option on the semaphore control file associated\nwith shared classes cache.\n\nJVMSHRC760W Failed to set group access permission as requested by the\n'groupAccess' sub-option on the shared memory control file associated\nwith shared classes cache.\n

This message can occur in combination with the snapshotCache suboption:

JVMSHRC761W Failed to set group access permission as requested by the\n'groupAccess' sub-option on the shared cache snapshot file.\n

All of these warning messages mean that the user's umask setting does not allow either, or both, of the group read and write permission to be set on the file. The typical umask setting restricts only the write permission. To resolve the warning, either change the umask setting or remove the groupAccess suboption.

"},{"location":"xshareclasses/#help","title":"help","text":"
    -Xshareclasses:help\n
Lists all the command-line options."},{"location":"xshareclasses/#invalidateaotmethods-cache-utility","title":"invalidateAotMethods (Cache utility)","text":"
    -Xshareclasses:invalidateAotMethods=<method_specification>\n    -Xshareclasses:invalidateAotMethods=help\n
Modify the existing shared cache to invalidate the AOT methods that match the method specifications. Use this suboption to invalidate AOT methods that cause a failure in the application, without having to destroy the shared cache. Invalidated AOT methods remain in the shared cache, but are then excluded from being loaded. VMs that have not processed the methods, or new VMs that use the cache are not affected by the invalidated methods. The AOT methods are invalidated for the lifetime of the cache, but do not prevent the AOT methods from being compiled again if a new shared cache is created. To prevent AOT method compilation into a new shared cache, use the -Xaot:exclude option. For more information, see -Xaot. To identify AOT problems, see Diagnosing a JIT or AOT problem. To revalidate an AOT method, see the revalidateAotMethods suboption. Use the findAotMethod suboption to determine which AOT methods match the method specifications. To learn more about the syntax to use for <method_specification>, including how to specify more than one method, see Method specification syntax."},{"location":"xshareclasses/#layer","title":"layer","text":"

(64-bit only)

    -Xshareclasses:layer=<number>\n
Creates layered caches. This suboption has the same effect as the createLayer suboption, but with the added ability to specify the layer number. For more information about creating a shared classes cache with layers, see Creating layer caches."},{"location":"xshareclasses/#listallcaches-cache-utility","title":"listAllCaches (Cache utility)","text":"
    -Xshareclasses:listAllCaches\n
Lists all the compatible and incompatible caches, and snapshots that exist in the specified cache directory. If you do not specify cacheDir, the default directory is used. Summary information, such as Java version and current usage, is displayed for each cache. Output includes cache-type (persistent or non-persistent) and feature (compressed references (cr) or non-compressed references (non-cr))."},{"location":"xshareclasses/#mprotect","title":"mprotect","text":"AIX, z/OS 31-bit:
-Xshareclasses:mprotect=[default|all|none]\n

Linux, Windows, macOS:

-Xshareclasses:mprotect=[default|all|partialpagesonstartup|onfind|nopartialpages|none]\n

where:

Note: Specifying all has a negative impact on performance. You should specify all only for problem diagnosis and not for production. Specifying values partialpagesonstartup or onfind can also have a negative impact on performance when the cache is being populated. There is no further impact when the cache is full or no longer being modified.

"},{"location":"xshareclasses/#modified","title":"modified","text":"
    -Xshareclasses:modified=<modified_context>\n
Used when a JVMTI agent is installed that might modify bytecode at run time. If you do not specify this suboption and a bytecode modification agent is installed, classes are safely shared with an extra performance cost. The <modified context> is a descriptor that is chosen by the user; for example, myModification1. This option partitions the cache so that only VMs that are using context myModification1 can share the same classes. So if, for example, you run an application with a modification context and then run it again with a different modification context, all classes are stored twice in the cache. For more information, see Sharing modified bytecode. If you are migrating from IBM\u00ae SDK, Java Technology Edition, Version 7, or earlier releases, you must set -Xshareclasses:disableBCI when you use this option to retain the same behavior."},{"location":"xshareclasses/#name","title":"name","text":"
    -Xshareclasses:name=<name>\n
Connects to a cache of a given name, creating the cache if it does not exist. This option is also used to indicate the cache that is to be modified by cache utilities; for example, destroy. Use the listAllCaches utility to show which named caches are currently available. If you do not specify a name, the default name \"sharedcc_%u\" is used. \"%u\" in the cache name inserts the current user name. On operating systems other than Windows, you can specify \"%g\" in the cache name to insert the current group name. Note: It is good practice to explicitly specify a cache for your application. This avoids the application sharing a cache that is enabled by default or with another application that doesn't set a name, and ensures that the size of your application cache can be set appropriately and that cache space is used exclusively for your application. Note that you cannot change the size of a default cache that already exists by using the -Xscmx option, as that option has no effect on a pre-existing cache. See Class data sharing: Best practices for using -Xshareclasses."},{"location":"xshareclasses/#noaot","title":"noaot","text":"
    -Xshareclasses:noaot\n
Disables caching and loading of AOT code. AOT code already in the shared data cache can be loaded."},{"location":"xshareclasses/#nobootclasspath","title":"noBootclasspath","text":"
    -Xshareclasses:noBootclasspath\n
Disables the storage of classes that are loaded by the bootstrap class loader in the shared classes cache. Often used with the SharedClassURLFilter API to control exactly which classes are cached. For more information about shared class filtering, see The Java shared classes Helper API."},{"location":"xshareclasses/#notimestampchecks","title":"noTimestampChecks","text":"
    -Xshareclasses:noTimestampChecks\n
Turns off timestamp checking when finding classes in the shared cache. Use this option only when you know there are no updates to the classes from the class paths or module paths in your application. Otherwise, obsolete classes might be loaded from the shared cache. If this happens, remove the noTimestampChecks option."},{"location":"xshareclasses/#nocheckurltimestamps","title":"nocheckURLTimestamps","text":"
    -Xshareclasses:nocheckURLTimestamps\n
Timestamps of jar or zip files are checked only when they are added to a class loader and used for the first time to look up a class. This is the default behavior, which can improve the performance of class loading from the shared classes cache, especially on Windows systems. To revert to the behavior of the shared classes cache in earlier releases, use the CheckURLTimeStamps suboption. Restriction: When the nocheckURLTimestamps suboption is used (default), if jar or zip files are updated after a class loader starts loading classes from them, an older version of the class might be loaded from the shared classes cache. If this scenario occurs, use the checkURLTimestamps option."},{"location":"xshareclasses/#nojitdata","title":"nojitdata","text":"
    -Xshareclasses:nojitdata\n
Disables caching of JIT data. JIT data already in the shared data cache can be loaded."},{"location":"xshareclasses/#none","title":"none","text":"
    -Xshareclasses:none\n
Added to the end of a command line, disables class data sharing. This suboption overrides class sharing arguments found earlier on the command line. This suboption disables the shared class utility APIs. To disable class data sharing without disabling the utility APIs, use the utilities suboption. For more information about the shared class utility APIs, see The Java shared classes utility API."},{"location":"xshareclasses/#nonfatal","title":"nonfatal","text":"
    -Xshareclasses:nonfatal\n
Allows the VM to start, in most cases, even if class data sharing fails. Normal behavior for the VM is to refuse to start if class data sharing fails. If you select nonfatal and the shared classes cache fails to initialize, the VM attempts to connect to the cache in read-only mode. If this attempt fails, the VM starts without class data sharing. See also fatal. Note: Unless it is important that your application runs with class data sharing, it is good practice to set this parameter. See Creating a shared classes cache. However, cache corruption as a result of a bug in the operating system, VM, or user code might not be detected when opening the cache. In this situation, the cache is used and the application might crash."},{"location":"xshareclasses/#nonpersistent","title":"nonpersistent","text":"
    -Xshareclasses:nonpersistent\n
Uses a non-persistent cache. The cache is lost when the operating system shuts down. Non-persistent and persistent caches can have the same name. On Linux, macOS, and Windows systems, you must always use the nonpersistent suboption when you run utilities such as destroy on a non-persistent cache. Note: On macOS systems, you must set kern.sysv.shmmax and kern.sysv.shmall when using a non-persistent cache."},{"location":"xshareclasses/#nopersistentdiskspacecheck","title":"noPersistentDiskSpaceCheck","text":"
    -Xshareclasses:noPersistentDiskSpaceCheck\n
Instructs the VM not to check for available storage on the file system before creating a persistent shared classes cache. This option prevents an error on file systems that do not support the checking of free space, where a value of 0 is returned and a shared cache cannot be created. Regardless of whether you choose to set this option, if there isn't enough disk space available when the VM writes to the shared cache memory, a SIGBUS or SIGSEGV signal occurs and the VM ends. If you are using the readonly suboption, the VM does not check the available disk space, so you do not need to set the noPersistentDiskSpaceCheck suboption."},{"location":"xshareclasses/#persistent","title":"persistent","text":"
    -Xshareclasses:persistent\n
Uses a persistent cache. The cache is created on disk, which persists beyond operating system restarts. Non-persistent and persistent caches can have the same name. On z/OS, you must always use the persistent suboption when you run utilities such as destroy on a persistent cache. Notes: "},{"location":"xshareclasses/#printallstats-cache-utility","title":"printAllStats (Cache utility)","text":"
    -Xshareclasses:printAllStats\n
Displays detailed information about the contents of the cache that is specified in the name suboption. If the name is not specified, statistics are displayed about the default cache. For layered caches, information is shown for all layers (to see information for the top layer cache only, use printTopLayerStats=all). Every class is listed in chronological order with a reference to the location from which it was loaded. For more information, see Shared classes cache diagnostic utilities."},{"location":"xshareclasses/#printstats-cache-utility","title":"printStats (Cache utility)","text":"
    -Xshareclasses:printStats=<data_type>[+<data_type>]\n
Displays summary information for the cache that is specified by the name, cacheDir, and nonpersistent suboptions. For layered caches, information is shown for all layers (to see information for the top layer cache only, use printTopLayerStats). The most useful information that is displayed is how full the cache is and how many classes it contains. Stale classes are classes that are updated on the file system and which the cache has therefore marked as \"stale\". Stale classes are not purged from the cache and can be reused. Use the printStats=stale option to list all the stale entries and stale bytes. Specify one or more data types, which are separated by a plus symbol (+), to see more detailed information about the cache content. Data types include AOT data, class paths, and ROMMethods. For more information and for a full list of data types, see Shared classes cache diagnostic utilities."},{"location":"xshareclasses/#printtoplayerstats-cache-utility","title":"printTopLayerStats (Cache utility)","text":"
    -Xshareclasses:printTopLayerStats=<data_type>[+<data_type>]\n
Equivalent to printStats but for the top layer cache only. For more information about layered caches, see Creating a layer cache."},{"location":"xshareclasses/#readonly","title":"readonly","text":"
    -Xshareclasses:readonly\n
By default, a shared classes cache is created with read/write access. Use the readonly suboption to open an existing cache with read-only permissions. Opening a cache read-only prevents the VM from making any updates to the cache. If you specify this suboption, the VM can connect to caches that were created by other users or groups without requiring write access. On AIX, Linux, and macOS systems, this access is permitted only if the cache was created by using the -Xshareclasses:cacheDir option to specify a directory with appropriate permissions. If you do not use the -Xshareclasses:cacheDir option, the cache is created with default permissions, which do not permit access by other users or groups. By default, this suboption is not specified. The -Xshareclasses:readonly option is ignored under the following conditions:

If a persistent shared classes cache is started under the mentioned conditions, the cache startup creates a temporary new (writable) top layer. The JITServer AOT cache uses the new top layer to store a small amount of metadata that the cache needs to function. With this top layer, the JITServer AOT cache can be used without modifying the existing layers.

"},{"location":"xshareclasses/#reset","title":"reset","text":"
    -Xshareclasses:reset\n
Causes a cache to be destroyed and then re-created when the VM starts up. This option can be added to the end of a command line as -Xshareclasses:reset."},{"location":"xshareclasses/#restorefromsnapshot-cache-utility","title":"restoreFromSnapshot (Cache utility)","text":"(Not Windows)
-Xshareclasses:restoreFromSnapshot\n

Restores a new non-persistent shared cache from a snapshot file. The snapshot and shared cache have the same name and location, as specified by the name and cacheDir suboptions. The non-persistent cache cannot already exist when the snapshot is restored. Restoring a snapshot does not remove the snapshot file; it can be restored multiple times. On platforms that support persistent caches, the nonpersistent suboption must be specified in order to restore a snapshot.

"},{"location":"xshareclasses/#restrictclasspaths","title":"restrictClasspaths","text":"
    -Xshareclasses:restrictClasspaths\n
Allows only the first VM that is initializing a shared cache to store classpaths in the cache. Subsequent VMs are not allowed to store classpaths in the cache unless the allowClasspaths option is specified. Use the restrictClasspaths option only if the application is designed to create class loaders of type java.net.URLClassloader or its subclass, such that their classpaths are unique to the instance of the application, but the classes that are loaded from these classpaths are the same. In such cases application classpaths that are stored by one VM cannot be used by another VM.

For example, consider two VMs, VM1 and VM2, that are using class paths CP1 and CP2 respectively, where:

These class paths differ only by one entry, which is the tempurl. The url1, url2, url3, url4, and url5 entries never change from run to run, whereas the tempurl entry is always different. This difference means that a class that is loaded from url4 or url5, and stored into the shared cache by VM1, cannot be located by VM2. Therefore, an attempt by VM2 to load a class from url4 or url5 would cause it to store its own classpath CP2 into the shared cache, and also add new metadata for classes that are loaded from url4 or url5. Addition of such unique class paths into the shared cache is not useful. Moreover, the additional metadata might adversely affect the performance of other VMs that connect to the shared cache. Because classes loaded from url4 or url5 are not loaded from the shared cache when the tempurl differs from the original, it is good practice to put the tempurl as the last entry in the class path.

In situations such as that described in the example, the restrictClasspaths option can be used to restrict the addition of classpaths by ensuring that the first VM initializes the shared cache, and then prevents the addition of unique classpaths by subsequent VMs that attach to the shared cache. Note that use of the restrictClasspaths option in any other scenario is likely to negatively impact a VM's performance when it is using an existing cache.

"},{"location":"xshareclasses/#revalidateaotmethods-cache-utility","title":"revalidateAotMethods (Cache utility)","text":"
    -Xshareclasses:revalidateAotMethods=<method_specification>\n    -Xshareclasses:revalidateAotMethods=help\n
Modify the shared cache to revalidate the AOT methods that match the method specifications. Use this suboption to revalidate AOT methods that were invalidated by using the invalidateAotMethods suboption. Revalidated AOT methods are then eligible for loading into a VM, but do not affect VMs where the methods have already been processed. To learn more about the syntax to use for <method_specification>, including how to specify more than one method, see Method specification syntax."},{"location":"xshareclasses/#silent","title":"silent","text":"
    -Xshareclasses:silent\n
Disables all shared class messages, including error messages. Unrecoverable error messages, which prevent the VM from initializing, are displayed."},{"location":"xshareclasses/#snapshotcache-cache-utility","title":"snapshotCache (Cache utility)","text":"(Not Windows)
-Xshareclasses:snapshotCache\n

Creates a snapshot file of an existing non-persistent shared cache. The snapshot has the same name and location as the shared cache, as specified by the name and cacheDir suboptions. The shared cache can be in use when the snapshot is taken, but VMs are blocked when they try to write to the shared cache, while the cache data is copied to the file.

Typically, after a system is reinitialized, the snapshot file is used to restore the copy of the non-persistent cache into shared memory, via the restoreFromSnapshot suboption. Since this process removes all non-persistent caches from shared memory, restoring the cache from the snapshot file can result in better VM startup performance, because the contents of the shared cache, including classes and AOT code, do not have to be re-created.

A snapshot can be created only if the user has sufficient permissions to create the destination snapshot file. If a snapshot of the same name exists already, it is overwritten. On platforms that support persistent caches, the nonpersistent suboption must be specified in order to create a snapshot. For information about removing snapshot files, see the destroySnapshot and destroyAllSnapshots suboptions.

"},{"location":"xshareclasses/#utilities","title":"utilities","text":"
    -Xshareclasses:utilities\n
Can be added to the end of a command line to disable class data sharing. This suboption overrides class sharing arguments found earlier on the command line. This suboption is like none, but does not disable the shared class utility APIs. For more information, see The Java shared classes utility API."},{"location":"xshareclasses/#verbose","title":"verbose","text":"
    -Xshareclasses:verbose\n
Gives detailed output on the cache I/O activity, listing information about classes that are stored and found. Each class loader is given a unique ID (the bootstrap loader is always 0) and the output shows the class loader hierarchy at work, where class loaders ask their parents for a class if they can't find it themselves. It is typical to see many failed requests; this behavior is expected for the class loader hierarchy. The standard option -verbose:class also enables class sharing verbose output if class sharing is enabled."},{"location":"xshareclasses/#verboseaot","title":"verboseAOT","text":"
    -Xshareclasses:verboseAOT\n
Enables verbose output when compiled AOT code is being found or stored in the cache. AOT code is generated heuristically. You might not see any AOT code that is generated at all for a small application. You can disable AOT caching by using the noaot suboption. See the VM Messages Guide for a list of the messages produced."},{"location":"xshareclasses/#verbosehelper","title":"verboseHelper","text":"
    -Xshareclasses:verboseHelper\n
Enables verbose output for the Java Helper API. This output shows you how the Helper API is used by your class loader."},{"location":"xshareclasses/#verboseio","title":"verboseIO","text":"
    -Xshareclasses:verboseIO\n
Gives detailed output on the cache I/O activity, listing information about classes that are stored and found. Each class loader is given a unique ID (the bootstrap loader is always 0) and the output shows the class loader hierarchy at work, where class loaders must ask their parents for a class before they can load it themselves. It is typical to see many failed requests; this behavior is expected for the class loader hierarchy."},{"location":"xshareclasses/#method-specification-syntax","title":"Method specification syntax","text":"

The following examples show how to specify more than one method specification when you are using the findAotMethods, invalidateAotMethods, or revalidateAotMethods suboptions.

Each method specification is defined as follows:

<packagename>/<classname>[.<methodname>[(<parameters>)]]\n

If you want to include more than one method specification in a single option, separate the specifications with a comma and enclose all the specifications in {braces}. For example:

{<packagename/classname>}[.{<methodname>}[({<parameters>})]]\n

If you want to specify parameters to distinguish between methods, you can use -Xshareclasses:findAotMethods=* (with a wildcard) to list all the parameter variations. Copy the signature for the method that you want from the output. For example, the signature for the parameters

(byte[] bytes, int offset, int length, Charset charset)\n

is

([BIILjava/nio/charset/Charset;)\n

Here are some examples:

Method signature Matches... * All AOT methods. java/lang/Object All AOT methods in the java.lang.Object class java/util/* All AOT classes and methods in the java.util package java/util/HashMap.putVal All putVal methods in the java.util.HashMap class java/util/HashMap.hash(Ljava/lang/Object;) The private java.util.HashMap.hash(java.lang.Object) method *.equals All equals methods in all classes {java/lang/Object,!java/lang/Object.clone} All methods in java.lang.Object except clone {java/util/*.*(),java/lang/Object.*(*)} All classes or methods with no input parameter in the java.util package, and all methods in java.lang.Object {java/util/*.*(),!java/util/*.*()} Nothing. "},{"location":"xshareclassesdisableonrestore/","title":"-Xshareclasses:disableOnRestore","text":""},{"location":"xshareclassesdisableonrestore/#-xshareclassesdisableonrestore","title":"-Xshareclasses:disableOnRestore","text":"

(Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), Linux on AArch64, and Linux on IBM Z\u00ae only)

The -Xshareclasses option is an existing option and disableOnRestore is its new parameter that can be used if the CRIU feature is available. This option is disabled by default.

Restrictions:

"},{"location":"xshareclassesdisableonrestore/#parameters","title":"Parameters","text":""},{"location":"xshareclassesdisableonrestore/#disableonrestore","title":"disableOnRestore","text":"
    -Xshareclasses:disableOnRestore\n

The -Xshareclasses:disableOnRestore option disables further use of the shared classes cache (SCC) on restore. You can still use the shared classes utility APIs, for example, to obtain metrics about the shared cache.

The -Xshareclasses:disableOnRestore option is similar to the existing -Xshareclasses:none option but with the following differences:

"},{"location":"xshareclassesdisableonrestore/#see-also","title":"See also","text":""},{"location":"xsigcatch/","title":"-Xnosigcatch","text":""},{"location":"xsigcatch/#-xsigcatch-xnosigcatch","title":"-Xsigcatch / -Xnosigcatch","text":"

These options enable or disable VM signal handling code.

"},{"location":"xsigcatch/#syntax","title":"Syntax","text":"Setting Effect Default -Xsigcatch Enable yes -Xnosigcatch Disable"},{"location":"xsigcatch/#see-also","title":"See also","text":""},{"location":"xsigchain/","title":"-Xnosigchain","text":""},{"location":"xsigchain/#-xsigchain-xnosigchain","title":"-Xsigchain / -Xnosigchain","text":"

These options enable or disable signal handler chaining.

"},{"location":"xsigchain/#syntax","title":"Syntax","text":"Setting Effect Default -Xsigchain Enable yes (except on z/OS\u00ae) -Xnosigchain Disable"},{"location":"xsigchain/#see-also","title":"See also","text":""},{"location":"xsignal/","title":"-Xsignal","text":""},{"location":"xsignal/#-xsignal","title":"-Xsignal","text":"

(z/OS\u00ae only)

This option controls the behavior of Eclipse OpenJ9\u2122 VM signal handlers.

"},{"location":"xsignal/#syntax","title":"Syntax","text":"
    -Xsignal:<parameter>=<value>\n
"},{"location":"xsignal/#parameters","title":"Parameters","text":"

Restriction: You cannot use these parameters together.

"},{"location":"xsignal/#posixsignalhandler","title":"posixSignalHandler","text":"
    -Xsignal:posixSignalHandler=cooperativeShutdown\n

When the VM signal handlers for SIGSEGV, SIGILL, SIGBUS, SIGFPE, SIGTRAP, and SIGABRT end a process, they call exit(), by default. In this case, the z/OS\u2122 Language Environment\u00ae is not aware that the VM ended abnormally.

With -Xsignal:posixSignalHandler=cooperativeShutdown, the VM no longer uses exit() to end the process from the signal handlers. Instead, the VM behaves in one of the following ways:

Language Environment detects that the VM is ending abnormally and initiates Resource Recovery Services.

"},{"location":"xsignal/#userconditionhandler","title":"userConditionHandler","text":"(31-bit z/OS only)
-Xsignal:userConditionHandler=percolate\n

This option results in similar behavior to the -XCEEHDLR option: the VM registers user condition handlers to handle the z/OS exceptions that would otherwise be handled by the VM POSIX signal handlers for the SIGBUS, SIGFPE, SIGILL, SIGSEGV, and SIGTRAP signals.

As with the -XCEEHDLR option, the VM does not install POSIX signal handlers for these signals.

This option differs from the -XCEEHDLR option in that the VM percolates all Language Environment\u00ae conditions that were not triggered and expected by the VM during normal running, including conditions that are severity 2 or greater. The VM generates its own diagnostic information before percolating severity 2 or greater conditions.

The VM is in an undefined state after percolating a severity 2 or greater condition. Applications cannot resume running then call back into, or return to, the VM.

"},{"location":"xsignal/#see-also","title":"See also","text":""},{"location":"xsoftmx/","title":"-Xsoftmx","text":""},{"location":"xsoftmx/#-xsoftmx","title":"-Xsoftmx","text":"

This option sets a \"soft\" maximum limit for the Java\u2122 heap.

"},{"location":"xsoftmx/#syntax","title":"Syntax","text":"
    -Xsoftmx<size>\n
"},{"location":"xsoftmx/#explanation","title":"Explanation","text":"

Use the -Xmx option to set a \"hard\" limit for the maximum size of the heap. By default, -Xsoftmx is set to the same value as -Xmx. The value of -Xms must be less than, or equal to, the value of -Xsoftmx.

See Using -X command-line options for more information about the <size> parameter.

You can set this option on the command line, then modify it at run time by using the MemoryMXBean.setMaxHeapSize() method in the com.ibm.lang.management API. By using this API, Java applications can dynamically monitor and adjust the heap size as required. This function can be useful in virtualized or cloud environments, for example, where the available memory might change dynamically to meet business needs. When you use the API, you must specify the value in bytes, such as 2147483648 instead of 2g.

For example, you might set the initial heap size to 1 GB and the maximum heap size to 8 GB. You might set a smaller value, such as 2 GB, for -Xsoftmx, to limit the heap size that is used initially:

-Xms1g -Xsoftmx2g -Xmx8g\n

You can then use the com.ibm.lang.management API from within a Java application to increase the -Xsoftmx value during run time, as load increases. This change allows the application to use more memory than you specified initially.

If you reduce the -Xsoftmx value, the garbage collector attempts to respect the new limit. However, the ability to shrink the heap depends on a number of factors. There is no guarantee that a decrease in the heap size will occur. If or when the heap shrinks to less than the new limit, the heap will not grow beyond that limit.

When the heap shrinks, the garbage collector might release memory. The ability of the operating system to reclaim and use this memory varies based on the capabilities of the operating system.

Notes:

"},{"location":"xsoftrefthreshold/","title":"-Xsoftrefthreshold","text":""},{"location":"xsoftrefthreshold/#-xsoftrefthreshold","title":"-Xsoftrefthreshold","text":"

Sets the value used by the garbage collector to determine the number of garbage collection (GC) cycles after which a soft reference is cleared if its referent has not been marked.

"},{"location":"xsoftrefthreshold/#syntax","title":"Syntax","text":"
    -Xsoftrefthreshold<value>\n
"},{"location":"xsoftrefthreshold/#default-behavior","title":"Default behavior","text":"

The default value is 32.

This option can be used with all Eclipse OpenJ9\u2122 GC policies.

"},{"location":"xsoftrefthreshold/#explanation","title":"Explanation","text":"

A soft reference (where its referent is not marked) is cleared after a number of GC cycles, which is calculated as: <value> * (proportion of free heap space)

For example, if -Xsoftrefthreshold is set to 32, and the heap is 25% free, soft references are cleared after 8 GC cycles.

"},{"location":"xss/","title":"-Xiss","text":""},{"location":"xss/#-xiss-xss-xssi","title":"-Xiss / -Xss / -Xssi","text":"

Sets the stack size and increment for Java\u2122 threads.

If you exceed the maximum Java thread stack size, a java/lang/OutOfMemoryError message is reported.

You can use the -verbose:sizes option to find out the values that the VM is currently using.

Note: Java methods and native methods run on two different stacks and the VM handles switching between them for JNI calls. Each stack is sized using separate options; these options apply to the Java stack only. For the native stack option, see the link in the See also section.

"},{"location":"xss/#syntax","title":"Syntax","text":"Setting Effect Default -Xiss<size> Set initial Java thread stack size 2 KB -Xss<size> Set maximum Java thread stack size 320 KB (31/32-bit); 1024 KB (64-bit) -Xssi<size> Set Java thread stack size increment 16 KB

See Using -X command-line options for more information about the <size> parameter.

See Default settings for the Eclipse OpenJ9\u2122 VM for more about default values.

"},{"location":"xss/#see-also","title":"See also","text":""},{"location":"xsyslog/","title":"-Xsyslog","text":""},{"location":"xsyslog/#-xsyslog","title":"-Xsyslog","text":"

Enables operating system message logging.

Notes:

"},{"location":"xsyslog/#syntax","title":"Syntax","text":"
    -Xsyslog:<parameter>{,<parameter>}\n
"},{"location":"xsyslog/#parameters","title":"Parameters","text":"

Restriction: The parameters all, none and help must be used on their own and cannot be combined. However, the other parameters can be grouped. For example, to include error, vital and warning messages use -Xsyslog:error,vital,warn.

For message details see OpenJ9 VM messages.

"},{"location":"xsyslog/#help","title":"help","text":"
    -Xsyslog:help\n
Gives details the available parameters. (This parameter cannot be combined with others.)"},{"location":"xsyslog/#error","title":"error","text":"
    -Xsyslog:error\n
Turns on logging for all OpenJ9 VM error messages (default)."},{"location":"xsyslog/#vital","title":"vital","text":"
    -Xsyslog:vital\n
Turns on logging for selected information messages JVMDUMP006I, JVMDUMP032I, and JVMDUMP033I, which provide valuable additional information about dumps produced by the OpenJ9 VM (default)."},{"location":"xsyslog/#info","title":"info","text":"
    -Xsyslog:info\n
Turns on logging for all OpenJ9 VM information messages."},{"location":"xsyslog/#warn","title":"warn","text":"
    -Xsyslog:warn\n
Turns on logging for all OpenJ9 VM warning messages."},{"location":"xsyslog/#config","title":"config","text":"
    -Xsyslog:config\n
Turns on logging for all OpenJ9 VM configuration messages."},{"location":"xsyslog/#all","title":"all","text":"
    -Xsyslog:all\n
Turns on logging for all OpenJ9 VM messages. (This parameter cannot be combined with others.)"},{"location":"xsyslog/#none","title":"none","text":"
    -Xsyslog:none\n
Turns off logging for all OpenJ9 VM messages. (This parameter cannot be combined with others.)"},{"location":"xtgc/","title":"-Xtgc","text":""},{"location":"xtgc/#-xtgc","title":"-Xtgc","text":"

Provides garbage collection tracing options.

"},{"location":"xtgc/#syntax","title":"Syntax","text":"
    -Xtgc:<parameter>{,<parameter>}\n
"},{"location":"xtgc/#parameters","title":"Parameters","text":"Specify one one or more of the following parameters in a comma-separated list:"},{"location":"xtgc/#backtrace","title":"backtrace","text":"
    -Xtgc:backtrace\n
Before a garbage collection, a single line is printed containing the name of the main thread for garbage collection, as well as the value of the osThread slot in the J9VMThread structure."},{"location":"xtgc/#compaction","title":"compaction","text":"
    -Xtgc:compaction\n
Prints extra information showing the relative time spent by threads in the \"move\" and \"fixup\" phases of compaction"},{"location":"xtgc/#concurrent","title":"concurrent","text":"
    -Xtgc:concurrent\n
Prints extra information showing the activity of the concurrent mark background thread"},{"location":"xtgc/#dump","title":"dump","text":"
    -Xtgc:dump\n
Prints a line of output for every free chunk of memory in the system, including \"dark matter\" (free chunks that are not on the free list for some reason, typically because they are too small). Each line contains the base address and the size in bytes of the chunk. If the chunk is followed in the heap by an object, the size and class name of the object is also printed. This argument has a similar effect to the terse argument."},{"location":"xtgc/#file","title":"file","text":"
    -Xtgc:file=<filename>\n
Directs the logs to a file. Otherwise they are directed to stderr."},{"location":"xtgc/#freelist","title":"freeList","text":"
    -Xtgc:freeList\n
Before a garbage collection, prints information about the free list and allocation statistics since the last garbage collection. Prints the number of items on the free list, including \"deferred\" entries (with the scavenger, the unused space is a deferred free list entry). For TLH and non-TLH allocations, prints the total number of allocations, the average allocation size, and the total number of bytes discarded during allocation. For non-TLH allocations, also included is the average number of entries that were searched before a sufficiently large entry was found."},{"location":"xtgc/#parallel","title":"parallel","text":"
    -Xtgc:parallel\n
Produces statistics on the activity of the parallel threads during each operation (mark, sweep, scavenge etc.) of a GC cycle."},{"location":"xtgc/#rootscantime","title":"rootscantime","text":"
    -Xtgc:rootscantime\n
Prints duration of strong and weak roots scanning of a GC cycle."},{"location":"xtgc/#scavenger","title":"scavenger","text":"
    -Xtgc:scavenger\n
Prints extra information after each scavenger collection. A histogram is produced showing the number of instances of each class, and their relative ages, present in the survivor space. The information is obtained by performing a linear walk-through of the space."},{"location":"xtgc/#terse","title":"terse","text":"
    -Xtgc:terse\n
Dumps the contents of the entire heap before and after a garbage collection. For each object or free chunk in the heap, a line of trace output is produced. Each line contains the base address, \"a\" if it is an allocated object, and \"f\" if it is a free chunk, the size of the chunk in bytes, and, if it is an object, its class name."},{"location":"xthr/","title":"-Xthr","text":""},{"location":"xthr/#-xthr","title":"-Xthr","text":""},{"location":"xthr/#syntax","title":"Syntax","text":"
    -Xthr:<parameter>\n
"},{"location":"xthr/#parameters","title":"Parameters","text":""},{"location":"xthr/#adaptspin-noadaptspin","title":"AdaptSpin | noAdaptSpin","text":"
    -Xthr:AdaptSpin\n    -Xthr:noAdaptSpin\n
This tuning option is available to test whether performance optimizations are negatively impacting an application."},{"location":"xthr/#fastnotify-nofastnotify","title":"fastNotify | noFastNotify","text":"
    -Xthr:fastNotify\n    -Xthr:noFastNotify\n
When a large number of threads try to acquire a Java\u2122 monitor, throughput of an application can be reduced. This issue is known as high contention. If high contention occurs when the Java wait and notify features are regularly used, you can use -Xthr:fastNotify to increase throughput. However, -Xthr:noFastNotify is the default setting, because it is faster in all other scenarios."},{"location":"xthr/#cfsyield-nocfsyield-linux-only","title":"cfsYield | noCfsYield (Linux\u00ae only)","text":"
    -Xthr:cfsYield\n    -Xthr:noCfsYield\n
The default value, cfsYield, enables threading optimizations for running on Linux with the Completely Fair Scheduler (CFS) in the default mode (sched_compat_yield=0). The noCfsYield value disables these threading optimizations. You might want to use the noCfsYield value if your application uses the Thread.yield() method extensively, because otherwise you might see a performance decrease in cases where yielding is not beneficial."},{"location":"xthr/#minimizeusercpu","title":"minimizeUserCPU","text":"
    -Xthr:minimizeUserCPU\n
Minimizes user-mode CPU usage in thread synchronization where possible. The reduction in CPU usage might be a trade-off in exchange for decreased performance."},{"location":"xthr/#secondaryspinforobjectmonitors-nosecondaryspinforobjectmonitors","title":"secondarySpinForObjectMonitors | noSecondarySpinForObjectMonitors","text":"
    -Xthr:secondarySpinForObjectMonitors\n    -Xthr:noSecondarySpinForObjectMonitors\n
This tuning option is available to test whether performance optimizations are negatively impacting an application."},{"location":"xtlhprefetch/","title":"-XtlhPrefetch","text":""},{"location":"xtlhprefetch/#-xtlhprefetch","title":"-XtlhPrefetch","text":"

(AIX\u00ae, Windows\u2122 only)

Speculatively prefetches bytes in the thread local heap (TLH) ahead of the current allocation pointer during object allocation. This option helps reduce the performance cost of subsequent allocations.

"},{"location":"xtlhprefetch/#syntax","title":"Syntax","text":"
    -XtlhPrefetch\n

This option can be used with all Eclipse OpenJ9\u2122 GC policies.

"},{"location":"xtrace/","title":"-Xtrace","text":""},{"location":"xtrace/#-xtrace","title":"-Xtrace","text":"

Eclipse OpenJ9\u2122 VM tracing is a powerful feature to help you diagnose problems with minimal effect on performance. Tracing is enabled by default, together with a small set of trace points going to memory buffers. You can enable tracepoints at run time by using levels, components, group names, or individual tracepoint identifiers to trace VM internal operations and instrumented Java\u2122 applications. You can also trace Java methods. See the About trace section that follows for more detail.

Trace data can be output in human-readable or in compressed binary formats. The VM provides a tool to process and convert the compressed binary data into a readable format. See Trace formatter.

Note: You can also control trace by using the com.ibm.jvm.Trace API or by using JVMTI from an external agent.

"},{"location":"xtrace/#xtrace-option-builder","title":"Xtrace Option Builder","text":"

Use the Xtrace Option Builder tool to help you specify the correct options and avoid incompatibilities.

"},{"location":"xtrace/#syntax","title":"Syntax","text":"
-Xtrace:<parameter>\n

You can get help with -Xtraceby using the following options:

"},{"location":"xtrace/#configuring-trace","title":"Configuring trace","text":"

The following parameters can be used to configure trace. (Follow links for more information about individual options.)

Command Result -Xtrace:properties[=<filename>] Configures trace options based on a file -Xtrace:buffers=<size>[dynamic\\|nodynamic] Modifies the size of buffers that are used to store trace data -Xtrace:exception.output=<filename>[,<size>] Redirects exceptions trace data to a file. -Xtrace:methods=<method_specification> Traces methods -Xtrace:output=<filename>[,<size>[,<generations>]] Sends trace data to a file, optionally of a specific size and number of generations. -Xtrace:resume Resumes tracing globally. -Xtrace:resumecount=<count> Enables tracing at a thread level after a specified count. -Xtrace:sleeptime=<time> Pauses trace operations for a specified length of time. -Xtrace:stackdepth=<n> Limits the maximum number of stack frames reported by the jstacktrace trace trigger action. -Xtrace:suspend Suspends tracing globally. -Xtrace:suspendcount=<count> Suspends tracing at a thread level after a specified count. -Xtrace:trigger=<clause> Determines when various triggered trace actions occur, including turning trace on or off.

Note: If an option value contains commas, it must be enclosed in braces. For example: methods={java/lang/*,com/ibm/*}

"},{"location":"xtrace/#controlling-tracepoint-activation","title":"Controlling tracepoint activation","text":"

The following parameters can be used to control tracepoint activation. (Follow links for more information about individual options.)

Command Result -Xtrace:maximal=<tracepoint_specification> Records all associated data. -Xtrace:minimal=<tracepoint_specification> Records only the time stamp and tracepoint identifier. -Xtrace:count=<tracepoint_specification> Counts the tracepoints that are used in a trace configuration. -Xtrace:print=<tracepoint_specification> Prints the specified tracepoints to stderr in real time. -Xtrace:iprint=<tracepoint_specification> Prints the specified tracepoints to stderr in real time with indentation. -Xtrace:exception=<tracepoint_specification> Enables exception tracing. -Xtrace:external<tracepoint_specification> Routes trace data to trace listeners, which are registered by using the JVMTI APIs. -Xtrace:none[=<tracepoint_specification>] Prevents the trace engine from loading if it is the only trace option specified.

Note: These options control which individual tracepoints are activated at run time and the implicit destination of the trace data. All these properties are independent of each other and can be mixed and matched in any way that you choose. For more information, see Tracepoint activation.

"},{"location":"xtrace/#about-trace","title":"About trace","text":"

With the OpenJ9 trace feature, you can trace VM internal operations, Java applications, and Java methods, or any combination of these.

VM internal operations The OpenJ9 virtual machine (VM) is extensively instrumented with tracepoints for tracing operations. Interpreting this trace data requires detailed knowledge of the VM, and is intended to diagnose VM problems. No guarantee is given that tracepoints will not vary from release to release and from platform to platform. Applications VM trace contains an application trace facility that allows tracepoints to be placed in Java code, enabling you to combine trace data with the other forms of trace. This capability is supported by the com.ibm.jvm.Trace API. Note that an instrumented Java application runs only on an OpenJ9 VM. For more information, see Application trace. Java methods Use method trace to debug and trace application code and the system classes provided with the VM. You can trace entry to and exit from Java methods run by the VM. You can select method trace by classname, method name, or both. You can also use wildcards to create complex method selections. For more information about command syntax, see methods.

Trace can produce large amounts of data in a very short time. Before running trace, think carefully about what information you need in order to solve the problem. Here are some considerations:

You must also think carefully about which components need to be traced and what level of tracing is required. For example, if you are tracing a suspected shared classes problem, it might be enough to trace all components at level 1, and j9shr at level 9, while maximal can be used to show parameters and other information for the failing component. Tracepoint components and trace levels are described in the following sections: Tracepoint specification and Trace levels.

There are two types of tracepoints inside the VM:

Trace data can be written to one of the following locations:

"},{"location":"xtrace/#default-tracing","title":"Default tracing","text":"

By default, the equivalent of the following trace command line is always available in the VM:

-Xtrace:maximal=all{level1},exception=j9mm{gclogger}\n

When startup is complete, the equivalent of the following command line is added to enable level 2 trace points:

-Xtrace:maximal=all{level2}\n

Level 2 is used for default tracing that would produce too much data during the startup of the VM. If you set other trace options on the command line, or before the VM finishes startup (through use of JVMTI or the com.ibm.jvm.Trace API), the level 2 trace points are enabled just before your trace options are processed. This behavior ensures that the default level 2 trace points do not override any changes that you specify.

The data generated by the tracepoints is continuously captured in wrapping memory buffers for each thread.

You can find tracepoint information in the following diagnostics data:

"},{"location":"xtrace/#default-memory-management-tracing","title":"Default memory management tracing","text":"

The default trace options are designed to ensure that Javadumps always contain a record of the most recent memory management history, regardless of how much work the VM has performed since the garbage collection cycle was last called.

The exception=j9mm{gclogger} clause of the default trace set specifies that a history of garbage collection cycles that have occurred in the VM is continuously recorded. The gclogger group of tracepoints in the j9mm component constitutes a set of tracepoints that record a snapshot of each garbage collection cycle. These tracepoints are recorded in their own separate buffer, called the exception buffer. The effect is that the tracepoints are not overwritten by the higher frequency tracepoints of the VM.

The GC History section of the Javadump is based on the information in the exception buffer. If a garbage collection cycle has occurred in a traced VM, the Java dump probably contains a GC History section.

"},{"location":"xtrace/#default-assertion-tracing","title":"Default assertion tracing","text":"

The VM includes assertions, implemented as special trace points. By default, internal assertions are detected and diagnostics logs are produced to help assess the error.

Assertion failures often indicate a serious problem, and the VM usually stops immediately. In these circumstances, raise an issue, including the standard error output and any diagnostic files that are produced.

When an assertion trace point is reached, a message like the following output is produced on the standard error stream:

16:43:48.671 0x10a4800    j9vm.209    *   ** ASSERTION FAILED ** at jniinv.c:251:\n((javaVM == ((void *)0)))\n

This error stream is followed with information about the diagnostic logs produced:

JVMDUMP007I JVM Requesting System Dump using 'core.20060426.124348.976.dmp'\nJVMDUMP010I System Dump written to core.20060426.124348.976.dmp\nJVMDUMP007I JVM Requesting Snap Dump using 'Snap0001.20060426.124648.976.trc'\nJVMDUMP010I Snap Dump written to Snap0001.20060426.124648.976.trc\n

Assertions are special trace points. They can be enabled or disabled by using the standard trace command-line options.

Assertion failures might occur early during VM startup, before trace is enabled. In this case, the assert message has a different format, and is not prefixed by a timestamp or thread ID. For example:

** ASSERTION FAILED ** j9vmutil.15 at thrinfo.c:371 Assert_VMUtil_true((\n  publicFlags & 0x200))\n

Assertion failures that occur early during startup cannot be disabled. These failures do not produce diagnostic dumps, and do not cause the VM to stop.

"},{"location":"xtrace/#tracepoint-activation","title":"Tracepoint activation","text":"

The options that control which individual tracepoints are activated at run time and the implicit destination of the trace data are listed under Syntax: Controlling tracepoint activation

In some cases, you must use them with other options. For example, if you specify maximal or minimal tracepoints, the trace data is put into memory buffers. If you are going to send the data to a file, you must use an output option to specify the destination file name.

With the exception of none, all options require at least one <tracepoint_specification>, which is described in the following section. Multiple statements of each type of trace are allowed and their effect is cumulative. If you want to use multiple trace options of the same name, use a properties file. (See properties.)

"},{"location":"xtrace/#tracepoint-specification","title":"Tracepoint specification","text":"

Tracepoints are enabled by specifying component and tracepoint.

If no qualifier parameters are entered, all tracepoints are enabled, except for <exception.output> trace, where the default is all {exception}.

The <tracepoint_specification> syntax can be further broken down as follows:

[!]<component>[{<group>}] or [!]<component>[{<type>}] or [!]<tracepoint_id>[,<tracepoint_id>]\n

Where:

Some tracepoints can be both an exit and an exception; that is, the function ended with an error. If you specify either exit or exception, these tracepoints are included.

Lists of Java components and tracepoint groups can be found in the tables that follow.

The following table lists the possible Java components (<component>). To include all Java components, specify all.

Component name Description avl VM AVL tree support io Class library java.io native code j9bcu VM byte code utilities j9bcverify VM byte code verification j9codertvm VM byte code run time j9dmp VM dump j9jcl VM class libraries j9jit VM JIT interface j9jni VM JNI support j9jvmti VM JVMTI support j9mm VM memory management j9prt VM port library j9scar VM class library interface j9shr VM shared classes j9trc VM trace j9util VM utilities j9vm VM general j9vmutil VM utilities j9vrb VM verbose stack walker map VM mapped memory support mt Java methods (see Note) net Class library TCP/IP networking native code pool VM storage pool support rpc VM RPC support simplepool VM storage pool support sunvmi VM class library interface

Note: When specifying the mt component you must also specify the methods option.

The following table lists all the tracepoint groups (<group>). Each group is associated with one or more Java components:

Component name or names Group name Description j9mm gclogger A set of tracepoints that record each garbage collection cycle. Equivalent to -verbose:gc output j9prt nlsmessage A set of tracepoints that record each NLS message that is issued by the VM. j9jcl, j9vm verboseclass A set of tracepoints that record each class as it is loaded. Equivalent to -verbose:class output. j9jni, j9vm checkjni A set of tracepoints that record JNI function checks. Equivalent to -Xcheck:jni output. j9vm checkmemory A set of tracepoints that record memory checks. Equivalent to -Xcheck:memory output. j9vm checkvm A set of tracepoints that record VM checks. Equivalent to -Xcheck:vm output. j9jit verbose A set of tracepoints that record JIT compiler configuration and method compilation. Equivalent to -Xjit:verbose output. mt compiledMethods A set of tracepoints that record compiled Java methods. mt nativeMethods A set of tracepoints that record Java native methods. mt staticMethods A set of tracepoints that record Java static methods.

Here are some examples:

To trace all tracepoints, specify the following command:

-Xtrace:maximal=all\n
To trace all tracepoints except **j9vrb** and **j9trc**, specify the following command:\n\n    -Xtrace:minimal={all},minimal={!j9vrb,j9trc}\n

To trace all entry and exit tracepoints in j9bcu, specify the following command:

-Xtrace:maximal={j9bcu{entry},j9bcu{exit}}\n
To trace all tracepoints in **j9mm** except tracepoints 20-30, specify the following command:\n\n    -Xtrace:maximal=j9mm,maximal=!j9mm.20-30\n

To trace tracepoints j9prt.5 through j9prt.15, specify the following command:

-Xtrace:print=j9prt.5-15\n
To trace all **j9trc** tracepoints, specify the following command:\n\n    -Xtrace:count=j9trc\n

To trace all entry and exit tracepoints, specify the following command:

-Xtrace:external={all{entry},all{exit}}\n
"},{"location":"xtrace/#trace-levels","title":"Trace levels","text":"

Tracepoints have been assigned levels 0 through 9 that are based on the importance of the tracepoint.

A level 0 tracepoint is the most important. It is reserved for extraordinary events and errors. A level 9 tracepoint is in-depth component detail. To specify a given level of tracing, the level0 through level9 keywords are used. You can abbreviate these keywords to l0 through l9. For example, if level5 is selected, all tracepoints that have levels 0 through 5 are included. Level specifications do not apply to explicit tracepoint specifications that use the TPNID keyword.

The level is provided as a modifier to a component specification, for example:

-Xtrace:maximal={all{level5}}\n

or

-Xtrace:maximal={j9mm{L2},j9trc,j9bcu{level9},all{level1}}\n

In the first example, tracepoints that have a level of 5 or less are enabled for all components. In the second example, all level 1 tracepoints are enabled. All level 2 tracepoints in j9mm are enabled. All tracepoints up to level 9 are enabled in j9bcu.

Note: The level applies only to the current component. If multiple trace selection components are found in a trace properties file, the level is reset to the default for each new component. Level specifications do not apply to explicit tracepoint specifications that use the TPNID keyword.

When the not operator is specified, the level is inverted; that is, !j9mm{level5} disables all tracepoints of level 6 or greater for the j9mm component. The following example enables trace for all components at level 9 (the default), but disables level 6 and higher for the locking component, and level 7 and higher for the storage component:

-Xtrace:print={all},print={!j9trc{l5},j9mm{l6}}\n

Here are some examples:

To count the level zero and level one tracepoints matched, specify the following command:

-Xtrace:count=all{L1}\n

To produce maximal trace of all components at level 5 and j9mm at level 9, specify the following command:

-Xtrace:maximal={all{level5},j9mm{L9}}\n

To trace all components at level 6, but do not trace j9vrb at all, and do not trace the entry and exit tracepoints in the j9trc component, specify the following command:

-Xtrace:minimal={all{l6}},minimal={!j9vrb,j9trc{entry},j9trc{exit}}\n
"},{"location":"xtrace/#parameters","title":"Parameters","text":"

Parameters to use with the -Xtrace option:

"},{"location":"xtrace/#buffers","title":"buffers","text":"

You can modify the size of the buffers to change how much diagnostic output is provided in a snap dump. This buffer is allocated for each thread that makes trace entries. The following table shows how this parameter can be set:

Command Effect -Xtrace:buffers=<size> Creates buffers of the specified <size> in k (KB) or m (MB), allocated as needed to match the rate of trace data generation to the output media. -Xtrace:buffers=<size>dynamic Creates buffers of the specified <size>, allocated as needed to match the rate of trace data generation to the output media. -Xtrace:buffers=<size>nodynamic Creates buffers of the specified <size>, with a maximum allocation of two buffers per thread.

If external trace is enabled, the number of buffers is doubled; that is, each thread allocates two or more buffers. The same buffer size is used for state and exception tracing, but, in this case, buffers are allocated globally. The default is 8 KB per thread.

The dynamic and nodynamic suboptions have meaning only when tracing to an output file.

Note: If nodynamic is specified, you might lose trace data if the volume of trace data exceeds the bandwidth of the trace output file. Message UTE115 is issued when the first trace entry is lost, and message UTE018 is issued when the VM ends.

Here are some command line examples:

To set a buffer size of 2 MB per thread, with dynamic buffering, use:

-Xtrace:buffers=2m\n

To limit each thread to 2 trace buffers, each of 128 KB:

-Xtrace:buffers={128k,nodynamic}\n
"},{"location":"xtrace/#count-tracepoint","title":"count (tracepoint)","text":"
-Xtrace:count=<tracepoint_specification>\n

For further information about <tracepoint_specification> syntax, see Tracepoint specification.

The count option requests that only a count of the selected tracepoints is kept. When the VM ends, all nonzero totals of tracepoints (sorted by tracepoint id) are written to a file, called utTrcCounters, in the current directory. This information is useful if you want to determine the overhead of particular tracepoints, but do not want to produce a large amount (GB) of trace data.

For example, to count the tracepoints that are used in the default trace configuration, use the following command:

-Xtrace:count=all{level1},count=j9mm{gclogger}\n
"},{"location":"xtrace/#exception-tracepoint","title":"exception (tracepoint)","text":"
-Xtrace:exception=<tracepoint_specification>\n

For further information about <tracepoint_specification> syntax, see Tracepoint specification.

When exception trace is enabled, the trace data is collected in internal buffers that are separate from the normal buffers. These internal buffers can then be written to a snap file or written to the file that is specified in an exception.output option.

The exception option allows low-volume tracing in buffers and files that are distinct from the higher-volume information that minimal and maximal tracing have provided. In most cases, this information is exception-type data, but you can use this option to capture any trace data that you want.

This form of tracing is channeled through a single set of buffers, as opposed to the buffer-per-thread approach for normal trace. Buffer contention might occur if high volumes of trace data are collected. A difference exists in the <tracepoint_specification> defaults for exception tracing; see Tracepoint specification.

Notes:

"},{"location":"xtrace/#exceptionoutput","title":"exception.output","text":"

Use exception output to redirect exceptions trace data to a file.

-Xtrace:exception.output=<filename>[,<size>]\n

Where:

Here are some examples:

Exception trace output goes to file /u/traces/exception.trc with no size limit:

-Xtrace:exception.output=/u/traces/exception.trc,maximal\n

Exception trace output goes to file except and wraps at 2 MB:

-Xtrace:exception.output={except,2m},maximal\n

Exception trace output goes to a file whose filename contains today's date in * yyyymmdd* format (for example, traceout.20181025.trc):

-Xtrace:exception.output=traceout.%d.trc,maximal\n

Exception trace output goes to a file whose filename contains the number of the process (the PID number) that generated it (for example, tracefrompid2112.trc):

-Xtrace:exception.output=tracefrompid%p.trc,maximal\n

Exception trace output goes to a file whose filename contains the time in hhmmss format (for example, traceout.080312.trc):

-Xtrace:exception.output=traceout.%t.trc,maximal\n
"},{"location":"xtrace/#external-tracepoint","title":"external (tracepoint)","text":"
-Xtrace:external<tracepoint_specification>\n

For further information about <tracepoint_specification> syntax, see Tracepoint specification.

The external option routes trace data to trace listeners, which are registered by using the JVMTI RegisterTracePointSubscriber() and DeregisterTracePointSubscriber() APIs.

"},{"location":"xtrace/#help","title":"help","text":"
-Xtrace:help\n

Displays general trace help

"},{"location":"xtrace/#iprint-tracepoint","title":"iprint (tracepoint)","text":"
-Xtrace:iprint=<tracepoint_specification>\n

For further information about <tracepoint_specification> syntax, see Tracepoint specification.

The iprint option is the same as the print option, but uses indenting to format the trace.

"},{"location":"xtrace/#maximal-tracepoint","title":"maximal (tracepoint)","text":"
-Xtrace:maximal=<tracepoint_specification>\n

For further information about <tracepoint_specification> syntax, see Tracepoint specification.

When specified, trace data is placed into internal trace buffers that can then be written to a snap file or written to the files that are specified in an output trace option. All associated data is traced.

minimal and maximal traces are independent from any types that follow them. For example, if the maximal option is specified, it does not affect a later option such as print.

"},{"location":"xtrace/#methods","title":"methods","text":"

Using method trace provides a complete and potentially large diagnosis of code paths inside your application and the system classes. Use wild cards and filtering to control method trace so that you can focus on the sections of code that interest you. Note that method trace is powerful but it also has a cost. Application throughput is affected by method trace.

To specify one or more method specifications, use the following syntax:

-Xtrace:methods=<method_specification>[,<method_specification>]\n

The syntax for <method_specification> can be further broken down to the following suboptions:

-Xtrace:methods={[!][*][<package>/]<class>[*],[[*]<method>[*]|[()]]}\n

Where:

To output all method trace information to stderr, use either the print or iprint suboptions:

-Xtrace:print=mt,methods=*.*\n-Xtrace:iprint=mt,methods=*.*\n

The iprint suboption prints to stderr with indentation. To output method trace information in binary format, see the output option

Internal Native Library (INL) native methods inside the VM cannot be traced because they are not implemented by using JNI. The list of methods that are not traceable is subject to change without notice.

Here are some examples:

Tracing entry and exit of all methods in a given class: To trace all method entry and exit of the ReaderMain class in the default package and the java.lang.String class, specify the following command:

-Xtrace:methods={ReaderMain.*,java/lang/String.*},print=mt\n

Tracing entry, exit and input parameters of all methods in a class: To trace all method entry, exit, and input of the ReaderMain class in the default package, specify the following command:

-Xtrace:methods=ReaderMain.*(),print=mt\n

Tracing all methods in a given package: To trace all method entry, exit, and input of all classes in the package com.ibm.socket, specify the following command:

-Xtrace:methods=com/ibm/socket/*.*(),print=mt\n

Multiple method trace: To trace all method entry, exit, and input in the Widget class in the default package and all method entry and exit in the common package, specify the following command:

-Xtrace:methods={Widget.*(),common/*},print=mt\n

Using the ! operator: To trace all methods in the ArticleUI class in the default package except those beginning with \"get\", specify the following command:

-Xtrace:methods={ArticleUI.*,!ArticleUI.get*},print=mt\n

Tracing a specific method in a class: This example traces entry and exit of the substring method of the java.lang.String class. If there is more than one method with the same name, they are all traced. You cannot filter method trace by the signature of the method.

-Xtrace:print=mt,methods={java/lang/String.substring}\n

Tracing the constructor of a class: This example traces entry and exit of the constructors of the java.lang.String class.

-Xtrace:print=mt,methods={java/lang/String.<init>}\n

Here is some example output:

java \"-Xtrace:methods={java/lang*.*},iprint=mt\" HW\n10:02:42.281*0x9e900      mt.4         > java/lang/J9VMInternals.initialize(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.4          > java/lang/J9VMInternals.verify(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.4           > java/lang/J9VMInternals.verify(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.4            > java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.10           < java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.10          < java/lang/J9VMInternals.verify(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.4           > java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.10          < java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.10         < java/lang/J9VMInternals.verify(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.4          > java/lang/J9VMInternals.initialize(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.4           > java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.296 0x9e900      mt.10          < java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.296 0x9e900      mt.10         < java/lang/J9VMInternals.initialize(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.296 0x9e900      mt.4          > java/lang/String.<clinit>()V Compiled static method\n10:02:42.296 0x9e900      mt.4           > java/lang/J9VMInternals.initialize(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.296 0x9e900      mt.4            > java/lang/J9VMInternals.verify(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.296 0x9e900      mt.4             > java/lang/J9VMInternals.verify(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.296 0x9e900      mt.10            < java/lang/J9VMInternals.verify(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.296 0x9e900      mt.4             > java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.328 0x9e900      mt.10            < java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.328 0x9e900      mt.10           < java/lang/J9VMInternals.verify(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.328 0x9e900      mt.4            > java/lang/J9VMInternals.initialize(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.328 0x9e900      mt.10           < java/lang/J9VMInternals.initialize(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.328 0x9e900      mt.4            > java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.328 0x9e900      mt.10           < java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.328 0x9e900      mt.10          < java/lang/J9VMInternals.initialize(Ljava/lang/Class;)\n                              V Compiled static method\n

The output lines comprise of:

"},{"location":"xtrace/#minimal-tracepoint","title":"minimal (tracepoint)","text":"
-Xtrace:minimal=<tracepoint_specification>\n

For further information about <tracepoint_specification> syntax, see Tracepoint specification.

When specified, trace data is placed into internal trace buffers that can then be written to a snap file or written to the files that are specified in an output trace option. Only the time stamp and tracepoint identifier are recorded. When the trace is formatted, missing trace data is replaced with the characters \"???\" in the output file.

minimal and maximal traces are independent from any types that follow them. For example, if the minimal option is specified, it does not affect a later option such as print.

"},{"location":"xtrace/#none-tracepoint","title":"none (tracepoint)","text":"
-Xtrace:none[=<tracepoint_specification>]\n

For further information about <tracepoint_specification> syntax, see Tracepoint specification.

-Xtrace:none prevents the trace engine from loading if it is the only trace option specified. However, if other -Xtrace options are on the command line, it is treated as the equivalent of -Xtrace:none=all and the trace engine still loads.

If you specify other tracepoints without specifying -Xtrace:none, the tracepoints are added to the default set.

"},{"location":"xtrace/#output","title":"output","text":"

Sends trace data to a file, optionally of a specific size and number of generations.

-Xtrace:output=<filename>[,<size>[,<generations>]]`\n

Where:

Note: When tracing to a file, buffers for each thread are written when the buffer is full or when the VM ends. If a thread has been inactive for a period of time before the VM ends, what seems to be 'old' trace data is written to the file. When formatted, it then seems that trace data is missing from the other threads, but this is an unavoidable side-effect of the buffer-per-thread design. This effect becomes especially noticeable when you use the generation facility, and format individual earlier generations.

Here are some examples:

Trace output goes to file /u/traces/gc.problem with no size limit:

-Xtrace:output=/u/traces/gc.problem,maximal=j9gc\n

Trace output goes to file trace, which will wrap at 2 MB:

-Xtrace:output={trace,2m},maximal=j9gc\n

Trace output goes to files gc0.trc, gc1.trc, and gc2.trc, each 10 MB in size:

-Xtrace:output={gc#.trc,10m,3},maximal=j9gc\n

Trace output goes to a file, where the filename contains today's date in * yyyymmdd* format (for example, traceout.20181025.trc):

-Xtrace:output=traceout.%d.trc,maximal=j9gc\n

Trace output goes to a file whose name contains the number of the process (the PID number) that generated it (for example, tracefrompid2112.trc):

-Xtrace:output=tracefrompid%p.trc,maximal=j9gc\n

Trace output goes to a file whose name contains the time in hhmmss format (for example, traceout.080312.trc):

-Xtrace:output=traceout.%t.trc,maximal=j9gc\n
"},{"location":"xtrace/#print-tracepoint","title":"print (tracepoint)","text":"
-Xtrace:print=<tracepoint_specification>\n

For further information about <tracepoint_specification> syntax, see Tracepoint specification.

The print option causes the specified tracepoints to be routed to stderr in real time. The VM tracepoints are formatted by using J9TraceFormat.dat. The class library tracepoints are formatted by J9TraceFormat.dat and TraceFormat.dat.

"},{"location":"xtrace/#properties","title":"properties","text":"

You can use properties files to control trace. A properties file saves typing and allows you to create a library of files that are tailored to solving problems in a particular area.

-Xtrace:properties[=<filename>]\n

If <filename> is not specified, the VM searches for a default name of IBMTRACE.properties in the current directory.

All the options that are in the file are processed in the sequence in which they are stored in the file, before the next option that is obtained through the normal mechanism is processed. Therefore, a command-line property always overrides a property that is in the file.

Here is an example of a properties file:

minimal=all\n// maximal=j9mm\nmaximal=j9shr\nbuffers=128k,nodynamic\noutput=c:\\traces\\classloader.trc\nprint=tpnid(j9vm.23-25)\n

The following restrictions apply to the file:

If any error is found when the file is accessed, VM initialization fails with an explanatory error message and return code.

To use a file trace.props stored in the c:\\trc\\gc directory, specify the following command:

-Xtrace:properties=c:\\trc\\gc\\trace.props\n
"},{"location":"xtrace/#resume","title":"resume","text":"

The resume option resumes tracing globally.

-Xtrace:resume\n

The suspend and resume options are not recursive. That is, two suspends that are followed by a single resume cause trace to be resumed.

"},{"location":"xtrace/#resumecount","title":"resumecount","text":"

This trace option determines whether tracing is enabled for each thread.

-Xtrace:resumecount=<count>\n

If <count> is greater than zero, each thread initially has its tracing disabled and must receive <count> resumethis actions before it starts tracing. This option is used with the trigger option.

Note: You cannot use resumecount and suspendcount together because they use the same internal counter.

The following example starts with all tracing turned off. Each thread starts tracing when it has had three resumethis actions performed on it:

-Xtrace:resumecount=3\n
"},{"location":"xtrace/#sleeptime","title":"sleeptime","text":"

You can specify how long the sleep lasts when using the sleep trigger action.

-Xtrace:sleeptime=nnn|aaams|bbbs\n

Where:

The default length of time is 30 seconds. If no units are specified, the default time unit is milliseconds.

"},{"location":"xtrace/#stackdepth","title":"stackdepth","text":"

Use this option to limit the maximum number of stack frames reported by the jstacktrace trace trigger action.

-Xtrace:stackdepth=<n>\n

Where <n> is the maximum number of stack frames reported.

"},{"location":"xtrace/#suspend","title":"suspend","text":"
-Xtrace:suspend\n

Suspends tracing globally for all threads and all forms of tracing but leaves tracepoints activated.

"},{"location":"xtrace/#suspendcount","title":"suspendcount","text":"

This trace option determines whether tracing is enabled for each thread.

-Xtrace:suspendcount=<count>\n

If <count> is greater than zero, each thread initially has its tracing enabled and must receive <count> suspendthis actions before it stops tracing.

You cannot use resumecount and suspendcount together because they both set the same internal counter.

This trace option is for use with the trigger option.

The following example starts with tracing turned on. Each thread stops tracing when it has had three suspendthis actions performed on it:

-Xtrace:suspendcount=3\n
"},{"location":"xtrace/#trigger","title":"trigger","text":"

The trigger parameter determines when various triggered trace actions occur. Supported actions include turning tracing on and off for all threads, turning tracing on or off for the current thread, or producing various dumps.

-Xtrace:trigger=<clause>[,<clause>]\n

This trace option does not control what is traced. It controls only whether the information that has been selected by the other trace options is produced as normal or is blocked.

"},{"location":"xtrace/#types","title":"Types","text":"

Each clause of the trigger parameter can be one of the following types:

You can specify multiple clauses of the same type if required, but you do not need to specify all types.

method
 -Xtrace:trigger=method{<methodspec>[,<entryAction>[,<exitAction>[,<delayCount>[,<matchcount>]]]]}\n

On entering a method that matches <methodspec>, the specified <entryAction> is run. On leaving a method that matches <methodspec>, the specified <exitAction> is run. If you specify a <delayCount>, the actions are performed only after a matching <methodspec> has been entered that many times. If you specify a <matchCount>, <entryAction> and <exitAction> are performed at most that many times.

<methodspec> is the specification of a Java method, consisting of a class and a method name separated by a dot. For example, specify HelloWorld.main. If the class is in a package, the package name must be included, separated by slashes. For example, specify java/lang/String.getBytes.

A wildcard \"*\" can be used at the start or end of the class and method names, or both. For example, you can specify */String.get*. To specify a constructor method, use <init> as the method name. Method signatures cannot be specified, so a method specification applies to all overloaded methods.

tracepoint ID
 -Xtrace:trigger=tpnid{<tpnid>|<tpnidRange>,<action>[,<delayCount>[,<matchcount>]]}\n

On finding the specified active tracepoint ID (<tpnid>) or a tracepoint ID) that falls inside the specified <tpnidRange>, the specified action is run. If you specify a <delayCount>, the action is performed only after the VM finds such an active <tpnid> that many times. If you specify a <matchCount>, <action> is performed at most that many times.

group
 -Xtrace:trigger=group{<groupname>,<action>[,<delayCount>[,<matchcount>]]}\n

On finding any active tracepoint that is defined as being in trace group <groupname>, for example Entry or Exit, the specified action is run. If you specify a <delayCount>, the action is performed only after that many active tracepoints from group <groupname> have been found. If you specify a <matchCount>, <action> is performed at most that many times.

"},{"location":"xtrace/#actions","title":"Actions","text":"

Wherever an action (<action>, <entryAction>, or <exitAction>) must be specified in one of the trigger parameter clauses, you must select from these options:

<action> Effect abort Halt the VM. ceedump This action is applicable to z/OS\u00ae only. For more information, see z/OS LE CEEDUMPs. coredump Produce a system dump. See Dump agents (-Xdump:system) heapdump Produce a heap dump. See Heap dump. javadump Produce a Java dump. See Java dump. jstacktrace Examine the Java stack of the current thread and generate auxiliary tracepoints for each stack frame. The auxiliary tracepoints are written to the same destination as the tracepoint or method trace that triggered the action. You can control the number of stack frames examined with the stackdepth=n option. See the stackdepth option. resume Resume all tracing (except for threads that are suspended by the action of the resumecount property and Trace.suspendThis() calls). resumethis Decrement the suspend count for this thread. If the suspend count is zero or less, resume tracing for this thread. segv Cause a segmentation violation. (Intended for use in debugging.) sleep Delay the current thread for a length of time controlled by the sleeptime option. The default is 30 seconds. See sleeptime option. snap Snap all active trace buffers to a file in the current working directory. The file name has the format: Snapnnnn.yyyymmdd.hhmmssth.ppppp.trc, where nnnn is the sequence number of the snap file since VM startup, yyyymmdd is the date, hhmmssth is the time, and ppppp is the process ID in decimal with leading zeros removed. suspend Suspend all tracing (except for special trace points). suspendthis Increment the suspend count for this thread. If the suspend-count is greater than zero, prevent all tracing for this thread. sysdump (or coredump) Produce a system dump. See Dump agents(-Xdump:system).

Here are some examples of using the trigger option:

To produce a Java dump when a method is entered, specify the following command:

-Xtrace:trigger=method{java/lang/String.getBytes,javadump}\n

To produce a system dump when a method is entered, specify the following command:

-Xtrace:trigger=method{java/lang/String.getBytes,sysdump}\n

To produce a Java dump when a class constructor is called, specify the following command:

\"-Xtrace:trigger=method{java/lang/Thread.<init>,javadump}\"\n

Note: This trace option is enclosed in quotation marks to avoid unwanted shell expansion of some of the characters.

To produce a Java dump when a class static initializer is called, specify the following command:

\"-Xtrace:trigger=method{java/lang/Thread.<clinit>,javadump}\"\n

Note: This trace option is enclosed in quotation marks to avoid unwanted shell expansion of some of the characters.

To produce a Java dump when a method is entered 1000 times and 1001 times, specify the following command:

-Xtrace:trigger=method{java/lang/String.getBytes,javadump,,1000,2}\n

To start tracing this thread when it enters any method in java/lang/String, and to stop tracing the thread after exiting the method, specify the following command:

-Xtrace:resumecount=1\n

-Xtrace:trigger=method{java/lang/String.*,resumethis,suspendthis}

To resume all tracing when any thread enters a method in any class that starts with error, specify the following command:

-Xtrace:trigger=method{*.error*,resume}\n

To trace (all threads) while the application is active; that is, not starting or shut down. (The application name is HelloWorld), specify the following command:

-Xtrace:suspend,trigger=method{HelloWorld.main,resume,suspend}\n

To print a Java stack trace to the console when the mycomponent.1 tracepoint is reached, specify the following command:

-Xtrace:print=mycomponent.1,trigger=tpnid{mycomponent.1,jstacktrace}\n

To write a Java stack trace to the trace output file when the Sample.code() method is called, specify the following command:

-Xtrace:maximal=mt,output=trc.out,methods={mycompany/mypackage/Sample.code},trigger=method{mycompany/mypackage/Sample.code,jstacktrace}\n
"},{"location":"xtrace/#what","title":"what","text":"
-Xtrace:what\n

Shows the current trace settings

"},{"location":"xtrace/#see-also","title":"See also","text":""},{"location":"xtunevirtualized/","title":"-Xtune:virtualized","text":""},{"location":"xtunevirtualized/#-xtunevirtualized","title":"-Xtune:virtualized","text":"

Optimizes Eclipse OpenJ9\u2122 VM function for virtualized environments, such as a cloud, by reducing OpenJ9 VM CPU consumption when idle.

Note: Performance is optimized if there is a large shared classes cache (SCC) and AOT space in the SCC is not capped.

"},{"location":"xtunevirtualized/#syntax","title":"Syntax","text":"
    -Xtune:virtualized\n

This option is recommended for CPU-constrained environments, such as those found in cloud deployments that use containers. Internally, the option makes the JIT compiler more conservative with inlining and recompilation decisions, which saves CPU resources. The Garbage Collector also reduces the rate of heap expansion, which reduces the memory footprint. These changes to reduce the amount of CPU that is consumed are at the expense of a small loss in throughput.

When -Xtune:virtualized is used in conjunction with the -Xshareclasses option, the JIT compiler is more aggressive with its use of AOT-compiled code compared to setting only -Xshareclasses. This action provides additional CPU savings during application start-up and ramp-up, but comes at the expense of an additional small loss in throughput.

"},{"location":"xtunevirtualized/#see-also","title":"See also","text":""},{"location":"xverbosegclog/","title":"-Xverbosegclog","text":""},{"location":"xverbosegclog/#-xverbosegclog","title":"-Xverbosegclog","text":"

Causes garbage collection (GC) output from the -verbose:gc option to be written to a specified file.

"},{"location":"xverbosegclog/#syntax","title":"Syntax","text":"
    -Xverbosegclog[:<filename>[,<x>,<y>]]\n

where <filename> is the name of the file to which output is written. Dump agent tokens can be used in the filename.

If the file cannot be found, the file is created, and output is written to the new file.

If the file cannot be created (for example, if an invalid filename is specified), output is redirected to stderr.

If you do not specify a file name, verbosegc.%Y%m%d.%H%M%S.%pid.txt is used (for example, verbosegc.20180124.093210.1234.txt).

If you specify <x> and <y>, output is redirected to x files, each containing y GC cycles.

"},{"location":"xverbosegclog/#default-behavior","title":"Default behavior","text":"

By default, no verbose GC logging occurs.

"},{"location":"xverbosegclog/#see-also","title":"See also","text":""},{"location":"xverify/","title":"-Xverify","text":""},{"location":"xverify/#-xverify","title":"-Xverify","text":"

As described in the Oracle documentation, this HotSpot option enables or disables the verifier. For compatibility, this option is also supported by the Eclipse OpenJ9\u2122 VM.

"},{"location":"xverify/#syntax","title":"Syntax","text":"Setting Effect Default -Xverify Enables verification for all non-bootstrap classes. -Xfuture verification is not enabled. yes -Xverify:all Enables verification for all classes and enables -Xfuture verification. \u00a0 You cannot use this setting in conjunction with -XX:+ClassRelationshipVerifier. \u00a0 Note: This setting might have an impact on performance. -Xverify:remote For compatibility, this parameter is accepted, but is equivalent to the default -Xverify. -Xverify:none Disables the verifier. \u00a0 Note: This is not a supported configuration and, as noted, was deprecated from Java 13. If you encounter problems with the verifier turned off, remove this option and try to reproduce the problem.

Note: The option -Xverify:none (and its equivalent -noverify) was deprecated in Java 13. Both options might be removed in a future release. OpenJ9 issues a warning if these options are used in Java 13 and later versions.

"},{"location":"xx_jvm_commands/","title":"Using -XX options","text":""},{"location":"xx_jvm_commands/#using-xx-command-line-options","title":"Using -XX command-line options","text":"

Java\u2122 VM command-line options that are specified with -XX: are not checked for validity. If the VM does not recognize the option, the option is ignored. These options can therefore be used across different VM versions without ensuring a particular level of the VM. If you want to turn off this behavior to test whether your -XX options are valid, use the -XX:-IgnoreUnrecognizedXXColonOptions option.

For options that take a <size> parameter, add a suffix to the size value: \"k\" or \"K\" to indicate kilobytes, \"m\" or \"M\" to indicate megabytes, \"g\" or \"G\" to indicate gigabytes, or \"t\" or \"T\" to indicate terabytes.

For example, to set the -XX:MaxDirectMemorySize value to 16 MB, you can specify -XX:MaxDirectMemorySize16M, -XX:MaxDirectMemorySize16m, -XX:MaxDirectMemorySize16384K, or XX:MaxDirectMemorySize16384k on the command line.

"},{"location":"xxactiveprocessorcount/","title":"-XXActiveProcessorCount","text":""},{"location":"xxactiveprocessorcount/#-xxactiveprocessorcount","title":"-XX:ActiveProcessorCount","text":"

This HotSpot option is recognized by Eclipse OpenJ9\u2122 for compatibility. Use this option to override the number of CPUs that the VM automatically detects and uses when creating threads for various subsystems.

"},{"location":"xxactiveprocessorcount/#syntax","title":"Syntax","text":"
    -XX:ActiveProcessorCount=<n>\n

Where <n> is the number of CPUs.

Setting Value Default <n> 1 or greater There is no default value. This option is not enabled by default. If set to 0, there is no effect.

When you set this option the following line in a Java dump file is updated to indicate the number of CPUs specified:

2CIACTIVECPU Active CPUs\n

If this option is not set, the value for this line is 0 Active CPUs.

"},{"location":"xxadaptivegcthreading/","title":"-XX:[+|-]AdaptiveGCThreading","text":""},{"location":"xxadaptivegcthreading/#-xx-adaptivegcthreading","title":"-XX:[+|-]AdaptiveGCThreading","text":"

Restriction: Currently, this feature is available only with the gencon GC policy.

When this option is enabled, the active GC thread count is adjusted for each garbage collection (GC) cycle based on heuristics. That is, when a GC cycle successfully completes, the collector evaluates parallelism using aggregated thread statistics gathered during the completed cycle and projects a new thread count for the next cycle. For example, the thread count might be reduced if it is determined that an unnecessary overhead was incurred as a result of synchronization, lack of work sharing, or CPU availability. Similarly, the thread count may be increased if there's an opportunity to gain benefits from increased parallelism.

Notes:

"},{"location":"xxadaptivegcthreading/#syntax","title":"Syntax","text":"
    -XX:[+|-]AdaptiveGCThreading\n
Setting Effect Default -XX:+AdaptiveGCThreading Enable yes -XX:-AdaptiveGCThreading Disable

This optimization aims to automatically tune the GC thread count. Manually tuning and setting a thread count can be suboptimal because workloads typically change over the lifetime of an application.

You can check the active thread count value that is used by the garbage collector to complete the cycle by inspecting verbose GC output. The following example shows active thread count being reduced from 8 to 3:

<gc-end id=\"8\" type=\"scavenge\" contextid=\"4\" durationms=\"2.248\" usertimems=\"3.694\" systemtimems=\"1.345\" stalltimems=\"11.003\" timestamp=\"2021-03-12T01:35:10.768\" activeThreads=\"8\">\n<gc-end id=\"20\" type=\"scavenge\" contextid=\"16\" durationms=\"7.045\" usertimems=\"6.360\" systemtimems=\"0.955\" stalltimems=\"31.964\" timestamp=\"2021-03-12T01:35:10.777\" activeThreads=\"6\">\n<gc-end id=\"32\" type=\"scavenge\" contextid=\"28\" durationms=\"1.943\" usertimems=\"7.112\" systemtimems=\"0.454\" stalltimems=\"6.076\" timestamp=\"2021-03-12T01:35:10.781\" activeThreads=\"5\">\n<gc-end id=\"44\" type=\"scavenge\" contextid=\"40\" durationms=\"1.253\" usertimems=\"2.910\" systemtimems=\"0.297\" stalltimems=\"2.416\" timestamp=\"2021-03-12T01:35:10.788\" activeThreads=\"4\">\n<gc-end id=\"56\" type=\"scavenge\" contextid=\"52\" durationms=\"1.487\" usertimems=\"3.991\" systemtimems=\"0.447\" stalltimems=\"2.918\" timestamp=\"2021-03-12T01:35:10.790\" activeThreads=\"4\">\n<gc-end id=\"68\" type=\"scavenge\" contextid=\"64\" durationms=\"0.400\" usertimems=\"1.002\" systemtimems=\"0.178\" stalltimems=\"0.658\" timestamp=\"2021-03-12T01:35:10.791\" activeThreads=\"4\">\n<gc-end id=\"80\" type=\"scavenge\" contextid=\"76\" durationms=\"0.187\" usertimems=\"1.099\" systemtimems=\"0.127\" stalltimems=\"0.112\" timestamp=\"2021-03-12T01:35:10.792\" activeThreads=\"3\">\n<gc-end id=\"92\" type=\"scavenge\" contextid=\"88\" durationms=\"0.195\" usertimems=\"0.940\" systemtimems=\"0.114\" stalltimems=\"0.067\" timestamp=\"2021-03-12T01:35:10.796\" activeThreads=\"3\">\n<gc-end id=\"104\" type=\"scavenge\" contextid=\"100\" durationms=\"0.277\" usertimems=\"0.899\" systemtimems=\"0.118\" stalltimems=\"0.139\" timestamp=\"2021-03-12T01:35:10.797\" activeThreads=\"3\">\n
"},{"location":"xxallowvmshutdown/","title":"-XXallowvmshutdown","text":""},{"location":"xxallowvmshutdown/#-xxallowvmshutdown","title":"-XXallowvmshutdown","text":"

This option is provided as a workaround for applications that cannot shut down cleanly, as described in APAR IZ59734.

"},{"location":"xxallowvmshutdown/#syntax","title":"Syntax","text":"
    -XX:allowvmshutdown:[false|true]\n
Setting Effect Default false Disable true Enable yes"},{"location":"xxalwayspretouch/","title":"-XX:[+|-]AlwaysPreTouch","text":""},{"location":"xxalwayspretouch/#-xx-alwayspretouch","title":"-XX:[+|-]AlwaysPreTouch","text":"

This Oracle HotSpot option enables or disables the committing of memory during initial heap inflation or heap expansion.

"},{"location":"xxalwayspretouch/#syntax","title":"Syntax","text":"
    -XX:[+|-]AlwaysPreTouch\n
Setting Effect Default -XX:+AlwaysPreTouch Enable -XX:-AlwaysPreTouch Disable yes"},{"location":"xxcheckpointgcthread/","title":"-XX:CheckpointGCThreads","text":""},{"location":"xxcheckpointgcthread/#-xxcheckpointgcthreads","title":"-XX:CheckpointGCThreads","text":"

(Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), Linux on AArch64, and Linux on IBM Z\u00ae only)

At the VM startup, you can set the number of threads that the garbage collector uses for parallel operations (-Xgcthreads). At the time of taking the checkpoint, the -XX:CheckpointGCThreads option reduces the number of garbage collection (GC) threads that was set at startup.

Restrictions: This option takes effect only when -XX:+EnableCRIUSupport is enabled.

"},{"location":"xxcheckpointgcthread/#syntax","title":"Syntax","text":"
    -XX:CheckpointGCThreads=<number>\n
Setting Value Default <number> Greater than 0 and less than or equal to the number of GC threads at the VM startup 4

If the <number> is greater than the number of GC threads at startup, the VM ignores this option.

"},{"location":"xxcheckpointgcthread/#explanation","title":"Explanation","text":"

When taking a checkpoint, the VM reduces the number of GC threads that was specified at the startup and makes it equal to the thread count specified in the -XX:CheckpointGCThreads option. Since restoring threads adds latency to the overall VM restore time, you can minimize the restore time by reducing the GC thread count. After restoring from the checkpoint, the VM increases the GC thread count. The VM checks the following settings to determine the new GC thread count at the time of restore:

If you have specified the GC thread count at restore in the -Xgcthreads option and the count is greater than the checkpoint GC threads, the VM increases the thread count to the GC thread count set at restore.

If you have not specified the GC thread count in the -Xgcthreads option or if the thread count is less than the checkpoint GC threads, then the VM determines the default thread count (as explained in the -Xgcthreads topic) at restore. If the default thread count is greater than the checkpoint thread count, then the VM increases the thread count to the default thread count.

If the default thread count is lesser than the checkpoint thread count, then the thread count at restore time is same as the checkpoint thread count.

"},{"location":"xxcheckpointgcthread/#see-also","title":"See also","text":""},{"location":"xxclassrelationshipverifier/","title":"-XX:[+|-]ClassRelationshipVerifier","text":""},{"location":"xxclassrelationshipverifier/#-xx-classrelationshipverifier","title":"-XX:[+|-]ClassRelationshipVerifier","text":"

This option enables or disables the recording of class relationships in the verifier to delay validation until triggered by class loading.

Note: You cannot use this setting in conjunction with -Xfuture or -Xverify:all, which itself enables -Xfuture.

"},{"location":"xxclassrelationshipverifier/#syntax","title":"Syntax","text":"
    -XX:[+|-]ClassRelationshipVerifier\n
Setting Effect Default -XX:+ClassRelationshipVerifier Enable -XX:-ClassRelationshipVerifier Disable yes"},{"location":"xxclassrelationshipverifier/#explanation","title":"Explanation","text":"

When enabled, this option delays validating the relationships between classes until the classes are required to be loaded during program execution. In this way, classes that are not required, are never loaded thus reducing VM startup time.

A verify error is thrown if validation fails.

"},{"location":"xxcodecachetotal/","title":"-XX:codecachetotal","text":""},{"location":"xxcodecachetotal/#-xxcodecachetotal","title":"-XX:codecachetotal","text":"

This option is an alias for the -Xcodecachetotal option.

"},{"location":"xxcodecachetotal/#syntax","title":"Syntax","text":"
    -XX:codecachetotal=<size>\n
See Using -X command-line options for more information about specifying the <size> parameter."},{"location":"xxcodecachetotal/#see-also","title":"See also","text":""},{"location":"xxcodecachetotalmaxrampercentage/","title":"-XX:codecachetotalMaxRAMPercentage","text":""},{"location":"xxcodecachetotalmaxrampercentage/#-xxcodecachetotalmaxrampercentage","title":"-XX:codecachetotalMaxRAMPercentage","text":"

This option sets the maximum limit for the total JIT code cache size based on the amount of physical memory available to the VM.

"},{"location":"xxcodecachetotalmaxrampercentage/#syntax","title":"Syntax","text":"
    -XX:codecachetotalMaxRAMPercentage=<number>\n
Setting Value Default <number> Between 1 and 100 (fractional numbers are allowed) 25

Where <number> is the maximum limit that is expressed as a percentage of the available physical memory.

For example, if you specify -XX:codecachetotalMaxRAMPercentage=30, the VM is not allowed to use more than 30% of the available physical memory for the internal JIT code caches.

"},{"location":"xxcodecachetotalmaxrampercentage/#explanation","title":"Explanation","text":"

The default total size of the JIT code cache is computed as the minimum of the following two limits:

In memory constrained environments, the percentage limit is relevant because the code cache size is then based on the available physical memory. The percentage limit prevents the VM from using too much memory for its code caches and thus, leaving too little memory for other VM or JIT data structures.

For example, on a 64-bit system, the platform-specific code cache limit is 256 MB. If the VM is constrained to less than 1024 MB, say 512 MB, then the code cache limit becomes 128 MB (25% of 512 MB) because the percentage limit is less than the platform limit.

To fine-tune the code cache size limit for your specific application as a percentage of the available physical memory, you can use the -XX:codecachetotalMaxRAMPercentage option.

As an alternative, you can use the -XX:codecachetotal or the -Xcodecachetotal options to set the code cache size limit as an absolute value (platform-based limit). The absolute value that is specified with these options takes precedence over the percentage that is specified with the -XX:codecachetotalMaxRAMPercentage option.

Restrictions:

"},{"location":"xxcompactstrings/","title":"-XX:[+|-]CompactStrings","text":""},{"location":"xxcompactstrings/#-xx-compactstrings","title":"-XX:[+|-]CompactStrings","text":"

This HotSpot option is reimplemented by Eclipse OpenJ9\u2122 and when enabled causes an ISO8859-1 (also known as Latin-1) character representation to be used internally for String objects, while preserving full API compatibility.

This feature provides heap space savings by using an 8-bit character set internally. Most benefit is gained when the majority of the String objects that your application uses can be encoded using the ISO8859-1 character encoding.

If the option is not enabled, the JIT compiler is nevertheless optimized so that although there is no saving in heap space, there is also no performance penalty.

Further details are available at JEP 254: Compact Strings.

Note: With OpenJ9, this option is supported on OpenJDK version 8 and later versions, whereas HotSpot supports it only from Java version 9.

"},{"location":"xxcompactstrings/#syntax","title":"Syntax","text":"Setting Effect Default -XX:+CompactStrings Enable String compression yes -XX:-CompactStrings Disable String compression yes"},{"location":"xxcompatibility/","title":"-XX:Compatibility","text":""},{"location":"xxcompatibility/#-xxcompatibility","title":"-XX:Compatibility","text":"

This option enables a compatibility mode that OpenJ9 can run in to support applications that require specific capabilities. For example, support for applications that rely on vendor-specific command line arguments or to make available unspecified APIs.

"},{"location":"xxcompatibility/#syntax","title":"Syntax","text":"
    -XX:Compatibility=<mode>\n

Where, <mode> is the application for which the compatibility mode is provided. The <mode> is case-insensitive.

In release 0.43.0, the compatibility mode is provided for the Elasticsearch application only.

    -XX:Compatibility=Elasticsearch\n

If the -XX:Compatibility option is specified more than once, or with a mode other than \"Elasticsearch\" (not case-sensitive), the VM fails to start.

Although this option is available in all OpenJDK versions, the Elasticsearch application requires OpenJDK version 17 or later.

"},{"location":"xxcompatibility/#explanation","title":"Explanation","text":"

The Elasticsearch application was facing incompatibility issues when it was running on OpenJ9 and required many workarounds. With the Elasticsearch compatibility mode, OpenJ9 accepts and supports HotSpot-specific options or APIs that enhance compatibility to run the Elasticsearch application.

"},{"location":"xxconcgcthreads/","title":"-XX:ConcGCThreads","text":""},{"location":"xxconcgcthreads/#-xxconcgcthreads","title":"-XX:ConcGCThreads","text":"

This Oracle HotSpot option affects the number of threads used by the concurrent garbage collector. This option is recognized by Eclipse OpenJ9\u2122 and provided for compatibility.

"},{"location":"xxconcgcthreads/#syntax","title":"Syntax","text":"
    -XX:ConcGCThreads=<number>\n

Where <number> is the number of low-priority background threads that are attached to assist the mutator threads in concurrent mark.

Within OpenJ9 this option is directly mapped to -Xconcurrentbackground.

"},{"location":"xxcontinuationcache/","title":"-XX:ContinuationCache","text":""},{"location":"xxcontinuationcache/#-xxcontinuationcache","title":"-XX:ContinuationCache","text":"

This option sets the continuation tier 1 and 2 cache size to optimize virtual thread performance.

"},{"location":"xxcontinuationcache/#syntax","title":"Syntax","text":"
    -XX:ContinuationCache:t1=<size>,t2=<size>\n
Setting Value Default t1=<size> 0 to 232 - 1 (4,294,967,295) 1 t2=<size> 0 to 232 - 1 (4,294,967,295) Number of processors x 2

Where t1 is the tier 1 cache and t2 is the tier 2 cache.

The tier 1 cache holds data that is not shareable between threads.

The tier 2 cache holds data that can be shared globally between threads.

"},{"location":"xxcontinuationcache/#explanation","title":"Explanation","text":"

When a virtual thread is created, it is associated with a continuation, which holds the target task of the virtual thread. When a virtual thread starts, the VM saves the current thread (carrier thread) state in an internal data structure that is linked with the continuation. When the associated continuation starts, the VM allocates the memory for the internal data structure and stores its reference in the continuation. When the continuation finishes, the VM stores the internal data structure in a cache instead of freeing the associated memory. New continuations can reuse the cached structure instead of allocating new memory for it. The VM can resume thread execution from the saved state later, typically on a different thread.

If the virtual thread stops, the VM loads the state of the previous thread from the continuation and runs that thread. When the virtual thread does not complete running, the last state of the virtual thread is stored in the continuation during the stop operation. At a later point, the scheduler runs the incomplete virtual thread using the thread state stored in the continuation.

Reusing the cached structure improves the performance of creating virtual threads. The performance benefits are more evident in applications that scale to millions of virtual threads.

The continuation cache is implemented in two tiers, tier 1 and tier 2. You can set the maximum size for the two tiers with the -XX:ContinuationCache option. If an application uses more than 10000 virtual threads, setting a larger cache size might improve performance.

When the size of the cache increases, the number of allocations reduces but the cache lookup time might also increase. Evaluate both the number of allocations and the optimal lookup time to set the appropriate cache size.

"},{"location":"xxcontinuationcache/#see-also","title":"See also","text":""},{"location":"xxcpuloadcompatibility/","title":"-XX:[+|-]CpuLoadCompatibility","text":""},{"location":"xxcpuloadcompatibility/#-xx-cpuloadcompatibility","title":"-XX:[+|-]CpuLoadCompatibility","text":"

This option enables or disables the OpenJDK behavior of the getProcessCpuLoad() and getSystemCpuLoad() methods in OpenJ9.

"},{"location":"xxcpuloadcompatibility/#syntax","title":"Syntax","text":"
    -XX:[+|-]CpuLoadCompatibility\n
Setting Effect Default -XX:+CpuLoadCompatibility Enable -XX:-CpuLoadCompatibility Disable yes"},{"location":"xxcpuloadcompatibility/#explanation","title":"Explanation","text":"

The getProcessCpuLoad() method in the com.sun.management.OperatingSystemMXBean class returns the recent CPU usage value for the Java virtual machine process, while the getSystemCpuLoad() method returns the recent CPU usage value for the whole system. When these methods were called in OpenJ9 for the first time, these methods were returning -1 to indicate that the recent CPU usage is not available. It was difficult to identify whether the reason for the -1 value was an error or because the call was the first call and therefore, no recent CPU usage was available.

In OpenJDK, these methods return 0 value in the case of the first call, which makes it easier to differentiate between the first call behavior and an error that needs further investigation.

The -XX:+CpuLoadCompatibility option is used to enable the OpenJDK behavior of the getProcessCpuLoad() and getSystemCpuLoad() methods in OpenJ9.

"},{"location":"xxcriurestorenonportablemode/","title":"-XX:[+|-]CRIURestoreNonPortableMode","text":""},{"location":"xxcriurestorenonportablemode/#-xx-criurestorenonportablemode","title":"-XX:[+|-]CRIURestoreNonPortableMode","text":"

(Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), Linux on AArch64, and Linux on IBM Z\u00ae only)

This option specifies whether the JIT and AOT compilers generate nonportable compiled code on restore.

Restrictions:

"},{"location":"xxcriurestorenonportablemode/#syntax","title":"Syntax","text":"
    -XX:[+|-]CRIURestoreNonPortableMode\n
Setting Effect Default -XX:+CRIURestoreNonPortableMode Enable yes -XX:-CRIURestoreNonPortableMode Disable"},{"location":"xxcriurestorenonportablemode/#explanation","title":"Explanation","text":"

The JIT compiler can use hardware features of the system on which it is running to generate compiled code. That code might therefore fail if it is included in a checkpoint image that you later restore on a different system. For example, the compiled code might try to use a hardware feature that doesn't exist on the new machine, then fail. To avoid this problem, the JIT compiler by default generates code that uses only basic hardware features, therefore portable to different systems.

The -XX:+CRIURestoreNonPortableMode option is set by default so that on restore the JIT compiler can start generating nonportable compiled code. Likewise, the VM can also load nonportable AOT code post-restore. Generating nonportable compiled code also means that no further checkpoints are permitted. Only a single checkpoint can be taken in the VM's lifetime.

If you require multiple checkpoints, you can use the -XX:-CRIURestoreNonPortableMode option to generate portable JIT compiled code after restore.

"},{"location":"xxcriurestorenonportablemode/#see-also","title":"See also","text":""},{"location":"xxcriusecprovider/","title":"-XX:[+|-]CRIUSecProvider","text":""},{"location":"xxcriusecprovider/#-xx-criusecprovider","title":"-XX:[+|-]CRIUSecProvider","text":"

(Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), Linux on AArch64, and Linux on IBM Z\u00ae only)

This option enables or disables the use of the CRIUSECProvider during the checkpoint phase.

"},{"location":"xxcriusecprovider/#syntax","title":"Syntax","text":"
    -XX:[+|-]CRIUSecProvider\n
Setting Effect Default -XX:+CRIUSecProvider Enable yes -XX:-CRIUSecProvider Disable"},{"location":"xxcriusecprovider/#explanation","title":"Explanation","text":"

When you enable CRIU support (with the -XX:+EnableCRIUSupport option), all the existing security providers are removed from the security provider list during the checkpoint phase and CRIUSECProvider is added. CRIUSECProvider supports only a limited number of cryptography services and therefore, you can use only those security algorithms that are available in CRIUSECProvider.

You can now choose to disable the use of CRIUSECProvider with the -XX:-CRIUSecProvider option and continue to use all the existing security providers during the checkpoint and restore phase. When you use the security algorithms of other security providers, you must have alternative approaches to protect your files, such as initialization before you take checkpoints with nonsensitive data.

"},{"location":"xxcriusecprovider/#see-also","title":"See also","text":""},{"location":"xxdiagnosesynconvaluebasedclasses/","title":"-XX:DiagnoseSyncOnValueBasedClasses","text":""},{"location":"xxdiagnosesynconvaluebasedclasses/#-xxdiagnosesynconvaluebasedclasses","title":"-XX:DiagnoseSyncOnValueBasedClasses","text":"

This HotSpot option provides warnings about improper attempts to synchronize on instances of a value-based class. The option is recognized by Eclipse OpenJ9\u2122 for compatibility.

"},{"location":"xxdiagnosesynconvaluebasedclasses/#syntax","title":"Syntax","text":"
    -XX:DiagnoseSyncOnValueBasedClasses=<number>\n
<number> value Effect 1 Generate VirtualMachineError error 2 Print a warning message"},{"location":"xxdisableexplicitgc/","title":"-XX:[+|-]DisableExplicitGC","text":""},{"location":"xxdisableexplicitgc/#-xx-disableexplicitgc","title":"-XX:[+|-]DisableExplicitGC","text":"

This HotSpot option is recognized by Eclipse OpenJ9\u2122 for compatibility. See \u2011Xenableexplicitgc.md / \u2011Xdisableexplicitgc for details.

"},{"location":"xxdisableexplicitgc/#syntax","title":"Syntax","text":"Setting Effect Default -XX:+DisableExplicitGC Enable GC yes -XX:-DisableExplicitGC Disable GC"},{"location":"xxdisclaimjitscratch/","title":"-XX:[+|-]DisclaimJitScratch","text":""},{"location":"xxdisclaimjitscratch/#-xx-disclaimjitscratch","title":"-XX:[+|-]DisclaimJitScratch","text":"

Restriction: This option is deprecated; the option is accepted but ignored.

(Linux\u00ae only)

The -XX:+DisclaimJitScratch option signals to the operating system to discard temporary physical memory that is consumed by the JIT compilation threads.

"},{"location":"xxdisclaimjitscratch/#syntax","title":"Syntax","text":"
    -XX:[+|-]DisclaimJitScratch\n
Setting Effect Default -XX:+DisclaimJitScratch Enable -XX:-DisclaimJitScratch Disable yes"},{"location":"xxdisclaimjitscratch/#explanation","title":"Explanation","text":"

Discarding temporary physical memory can reduce the physical memory reported in use by the Java\u2122 application. The physical memory that is released is available to other processes without the operating system needing to search for the least recently used frames.

The -XX:-DisclaimJitScratch option turns off a previously enabled -XX:+DisclaimJitScratch option.

"},{"location":"xxenable3164interoperability/","title":"-XX:[+|-]Enable3164Interoperability","text":""},{"location":"xxenable3164interoperability/#-xx-enable3164interoperability","title":"-XX:[+|-]Enable3164Interoperability","text":"

(z/OS\u00ae only)

Enables support for using 31-bit native applications with the 64-bit Java\u2122 virtual machine, where that support is available. For more information, see Using 31-bit native code with the 64-bit Java VM.

"},{"location":"xxenablecpumonitor/","title":"-XX:[+|-]EnableCPUMonitor","text":""},{"location":"xxenablecpumonitor/#-xx-enablecpumonitor","title":"-XX:[+|-]EnableCPUMonitor","text":"

This option relates to the information about the CPU usage of thread categories that is available with the com.ibm.lang.management.JvmCpuMonitorMXBean application programming interface.

Restriction: This option might not be supported in subsequent releases.

"},{"location":"xxenablecpumonitor/#syntax","title":"Syntax","text":"
    -XX:[+|-]EnableCPUMonitor\n
Setting Effect Default -XX:+EnableCPUMonitor Enable yes -XX:-EnableCPUMonitor Disable"},{"location":"xxenablecpumonitor/#explanation","title":"Explanation","text":"

The -XX:+EnableCPUMonitor option enables CPU monitoring, which allows a JMX bean to track CPU usage on a per thread basis and attributes the usage against different categories. For more information, see the JvmCpuMonitorMXBean interface in the com.ibm.lang.management API documentation.

To turn off CPU monitoring, set the -XX:-EnableCPUMonitor option on the command line.

"},{"location":"xxenablecpumonitor/#see-also","title":"See also","text":""},{"location":"xxenablecriusupport/","title":"-XX:[+|-]EnableCRIUSupport","text":""},{"location":"xxenablecriusupport/#-xx-enablecriusupport","title":"-XX:[+|-]EnableCRIUSupport","text":"

(Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), Linux on AArch64, and Linux on IBM Z\u00ae only)

This option enables or disables support for Checkpoint/Restore In Userspace (CRIU).

Restrictions: If CRIU support is enabled,

Nonportable mode (default) Pre-checkpoint Nonportable mode (default) Post restore Portable mode Pre-checkpoint Portable mode Post restore Pre-checkpoint: No options Post restore: No options no no no no Pre-checkpoint: No options Post restore: -XX:+UseJITServer no yes no yes Pre-checkpoint: -XX:+UseJITServerPost restore: No options no yes yes yes Pre-checkpoint: -XX:+UseJITServerPost restore: -XX:-UseJITServer no no yes no Pre-checkpoint: -XX:-UseJITServerPost restore: -XX:+UseJITServer no no no no "},{"location":"xxenablecriusupport/#syntax","title":"Syntax","text":"
    -XX:[+|-]EnableCRIUSupport\n
Setting Effect Default -XX:+EnableCRIUSupport Enable -XX:-EnableCRIUSupport Disable yes"},{"location":"xxenablecriusupport/#explanation","title":"Explanation","text":"

When you enable the option, the VM starts with the support for checkpoint and restore processes. The VM starts the JIT, GC, Security, and other internal components that make the checkpoint and restore points feasible. The option enables the use of org.eclipse.openj9.criu.CRIUSupport APIs. With CRIU support, you can take a checkpoint of the VM and restore the checkpoint image. When you specify the -XX:+EnableCRIUSupport option, the VM generates only those compiled codes that are portable (see -XX:[+|-]PortableSharedCache) to facilitate restoring of the checkpoint image in multiple environments. VM does not load any code from the shared classes cache that is nonportable pre-checkpoint.

Taking a checkpoint and restoring the checkpoint image generally happens on different environments with different behaviors. OpenJ9 makes compensations for such differences to ensure successful restore. For example, the VM compensates for the downtime between checkpoint and restore for elapsed time sensitive APIs such as System.nanotime() and java.util.Timer.

For more information about the OpenJ9 compensations and Time APIs, see the Compensation section in the OpenJ9 CRIU Support: A look under the hood\u202f(part II) blog post.

"},{"location":"xxenablecriusupport/#see-also","title":"See also","text":""},{"location":"xxenabledynamicagentloading/","title":"-XX:[+|-]EnableDynamicAgentLoading","text":""},{"location":"xxenabledynamicagentloading/#-xx-enabledynamicagentloading","title":"-XX:[+|-]EnableDynamicAgentLoading","text":"

This option enables or disables the dynamic loading of agents into a running VM.

"},{"location":"xxenabledynamicagentloading/#syntax","title":"Syntax","text":"
    -XX:[+|-]EnableDynamicAgentLoading\n
Setting Effect Default -XX:+EnableDynamicAgentLoading Enable yes -XX:-EnableDynamicAgentLoading Disable"},{"location":"xxenabledynamicagentloading/#explanation","title":"Explanation","text":"

With the Attach API, your application can connect to a running VM and load an agent dynamically into that VM to run tasks. Some libraries misuse the Attach API to dynamically load an agent to run tasks without the approval of the application owner.

You can disable the dynamic loading of the agents into a VM after startup with the -XX:-EnableDynamicAgentLoading option.

For Java\u2122 21 and later, the following warnings are issued when the agents are loaded dynamically into a running VM after startup without specifying the -XX:+EnableDynamicAgentLoading option. These warnings are not issued if the same agents were loaded before either by using the command-line options or an earlier dynamic loading.

WARNING: A {Java,JVM TI} agent has been loaded dynamically (file:/u/bob/agent.jar)\nWARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning\nWARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information\nWARNING: Dynamic loading of agents will be disallowed by default in a future release\n

These warnings are issued only once for the same agent when the -XX:+EnableDynamicAgentLoading option is not specified.

If the -XX:+EnableDynamicAgentLoading option is set, all agents that are dynamically loaded are considered as approved by the application owner, and therefore, no warnings are issued.

Eclipse OpenJ9\u2122 supported operating systems have APIs to determine whether the same agent was loaded before or not, even if an agent is loaded with a platform-independent name or an absolute path to the platform-dependent library.

From 0.44.0 release onwards, AIX systems also can detect whether an agent was previously loaded or not if the agent was loaded through a platform-independent name or an absolute path to the platform-dependent library. Therefore, like other platforms, on AIX systems also, the warnings are issued only once for the same agent when the -XX:+EnableDynamicAgentLoading option is not specified.

"},{"location":"xxenabledynamicagentloading/#see-also","title":"See also","text":""},{"location":"xxenableextendedhcr/","title":"-XX:[+|-]EnableExtendedHCR","text":""},{"location":"xxenableextendedhcr/#-xx-enableextendedhcr","title":"-XX:[+|-]EnableExtendedHCR","text":"

This option enables or disables the extended Hot Code Replace (HCR) capability in the VM.

"},{"location":"xxenableextendedhcr/#syntax","title":"Syntax","text":"
    -XX:[+|-]EnableExtendedHCR\n
Setting Effect Default -XX:+EnableExtendedHCR Enable -XX:-EnableExtendedHCR Disable yes"},{"location":"xxenableextendedhcr/#explanation","title":"Explanation","text":"

Supporting extended HCR has a maintenance cost and because only few users use this capability, the extended HCR feature is deprecated and will be removed in a future release. From OpenJDK 25 onwards, extended HCR will not be supported. Following that, the extended HCR support will be removed from other earlier OpenJDK versions also.

If the extended HCR support is disabled (-XX:-EnableExtendedHCR), it might result in a JVMTI failure. In case of such a failure, the following warning message is displayed:

Warning: Extended HCR is disabled, enable with -XX:+EnableExtendedHCR. This feature is deprecated. In the future, the extended HCR capability, and the option to enable it, will be completely removed from all versions.\n
"},{"location":"xxenableextendedhcr/#see-also","title":"See also","text":""},{"location":"xxensurehashed/","title":"-XX:[+|-]EnsureHashed","text":""},{"location":"xxensurehashed/#-xx-ensurehashed","title":"-XX:[+|-]EnsureHashed","text":"

This option specifies classes to be pre-hashed. Objects that are created from these classes are hashed and extended with a slot to store the assigned hash value when the object is created or first moved during the garbage collection process. This option might improve performance for applications that frequently hash objects of a certain type.

"},{"location":"xxensurehashed/#syntax","title":"Syntax","text":"
    -XX:+EnsureHashed:<classes>\n    -XX:-EnsureHashed:<classes>\n
Setting Effect -XX:+EnsureHashed:<classes> Specify classes -XX:-EnsureHashed:<classes> Ignore classes

Where <classes> is a comma-separated list of fully qualified class names, for example, java/lang/String.

"},{"location":"xxensurehashed/#explanation","title":"Explanation","text":"

The -XX:+EnsureHashed:<classes> option specifies the classes and the -XX:-EnsureHashed:<classes> option ignores classes that were previously specified. These options are parsed left to right.

For example, -XX:+EnsureHashed:Class1,Class2,Class3 -XX:-EnsureHashed:Class2 -XX:+EnsureHashed:Class2,Class4 -XX:-EnsureHashed:Class1,Class3 results in the set of EnsureHashed classes {Class2, Class4}.

Objects that are created from classes Thread and Class are allocated in the tenure region directly and therefore, do not get moved by the garbage collector often. It takes time for such pre-tenured objects to get hashed and extended with a slot. To pre-hash those objects from the start and hence, improve the performance,-XX:+EnsureHashed:java/lang/Class,java/lang/Thread is added to the list of default options in the options.default file.

"},{"location":"xxensurehashed/#see-also","title":"See also","text":""},{"location":"xxexitonoutofmemoryerror/","title":"-XX:[+|-]ExitOnOutOfMemoryError","text":""},{"location":"xxexitonoutofmemoryerror/#-xx-exitonoutofmemoryerror","title":"-XX:[+|-]ExitOnOutOfMemoryError","text":"

This HotSpot option is recognized by Eclipse OpenJ9\u2122. You can use the option to trigger a shut down on VM out-of-memory conditions.

Note: Java\u2122, heap, snap, and system dumps are enabled by default but can be disabled by including -XX:-HeapDumpOnOutOfMemoryError.

"},{"location":"xxexitonoutofmemoryerror/#syntax","title":"Syntax","text":"
    -XX:[+|-]ExitOnOutOfMemoryError\n
Setting Effect Default -XX:+ExitOnOutOfMemoryError Enable -XX:-ExitOnOutOfMemoryError Disable yes"},{"location":"xxgloballockreservation/","title":"-XX:[+|-]GlobalLockReservation","text":""},{"location":"xxgloballockreservation/#-xx-globallockreservation","title":"-XX:[+|-]GlobalLockReservation","text":"

(AIX\u00ae and Linux on Power Systems\u2122 only)

The -XX:+GlobalLockReservation option enables an optimization targeted towards more efficient handling of locking and unlocking Java\u2122 objects. The -XX:-GlobalLockReservation option is used to disable this optimization. The optimization is enabled by default.

"},{"location":"xxgloballockreservation/#syntax","title":"Syntax","text":"
    -XX:[+|-]GlobalLockReservation\n    -XX:+GlobalLockReservation:<parameter>\n
Setting Effect Default -XX:+GlobalLockReservation Enable yes -XX:-GlobalLockReservation Disable

This optimization is targeted towards applications with lots of uncontended locked objects that are being locked just to be safe. When enabled, heuristics are used to try and determine when an object will be exclusively locked by a single thread so that faster, more specialized code can be used for locking the object. If the heuristics incorrectly identify an object as a target for the optimization, performance might be adversely affected.

The -XX:-GlobalLockReservation option turns off global lock reservation.

The -XX:+GlobalLockReservation option can be used to enable global lock reservation if it was disabled by an option that occurs earlier in command line processing or to modify some of the global lock reservation related suboptions that are described later in this document.

"},{"location":"xxgloballockreservation/#parameters","title":"Parameters","text":"

Advanced tuning parameters are shown in the following table:

Parameter Effect reservedTransitionThreshold Changes amount of time spent analyzing an object. reservedAbsoluteThreshold Changes amount of time spent analyzing a class for compatibility. minimumReservedRatio Changes aggression level for marking a class as highly compatible. cancelAbsoluteThreshold Changes amount of time spent analyzing a class for incompatibility. minimumLearningRatio Changes aggression level for marking a class as highly incompatible."},{"location":"xxgloballockreservation/#reservedtransitionthreshold","title":"reservedTransitionThreshold","text":"
    -XX:+GlobalLockReservation:reservedTransitionThreshold=<value>\n
Setting Value Default <value> number 1

Number of times an object is locked by the same thread before it is considered reserved minus a value of 2. So, with a default value of 1, an object can be reserved the third time it is locked. <value> can be 0-3 inclusive. Values of 4 or higher are treated as infinity.

"},{"location":"xxgloballockreservation/#reservedabsolutethreshold","title":"reservedAbsoluteThreshold","text":"
    -XX:+GlobalLockReservation:reservedAbsoluteThreshold=<value>\n
Setting Value Default <value> number 10

Minimum number of objects of a class that get reserved before the class can be considered highly compatible. Objects of that class are reserved the first time they are locked. Values of 65536 or higher are treated as infinity.

"},{"location":"xxgloballockreservation/#minimumreservedratio","title":"minimumReservedRatio","text":"
    -XX:+GlobalLockReservation:minimumReservedRatio=<value>\n
Setting Value Default <value> number 1024

Minimum ratio of reserved objects to flat objects before a class can be considered highly compatible. Values of 65536 or higher are treated as infinity.

"},{"location":"xxgloballockreservation/#cancelabsolutethreshold","title":"cancelAbsoluteThreshold","text":"
    -XX:+GlobalLockReservation:cancelAbsoluteThreshold=<value>\n
Setting Value Default <value> number 10

Minimum number of objects of a class that get converted to flat before the class can be considered highly incompatible. Objects of that class are never reserved. Values of 65536 or higher are treated as infinity.

"},{"location":"xxgloballockreservation/#minimumlearningratio","title":"minimumLearningRatio","text":"
    -XX:+GlobalLockReservation:minimumLearningRatio=<value>\n
Setting Value Default <value> number 256

Minimum ratio of reserved objects to flat objects to prevent class from being considered highly incompatible. Values of 65536 or higher are treated as infinity.

"},{"location":"xxhandlesigabrt/","title":"-XX:[+|-]HandleSIGABRT","text":""},{"location":"xxhandlesigabrt/#-xx-handlesigabrt","title":"-XX:[+|-]HandleSIGABRT","text":"

This option affects the handling of the operating system signal SIGABRT. This signal represents abnormal termination, and it can either be generated by the abort function or the kill command.

"},{"location":"xxhandlesigabrt/#syntax","title":"Syntax","text":"
    -XX:[+|-]HandleSIGABRT\n
Setting Effect Default -XX:+HandleSIGABRT Enable yes -XX:-HandleSIGABRT Disable"},{"location":"xxhandlesigabrt/#explanation","title":"Explanation","text":"

When enabled, the VM handles the signal SIGABRT and generates the various dump files.

When the option is disabled, the VM does not handle the signal SIGABRT. Generally, this signal is handled by the default operating system handler.

Note: Do not use the -XX:+HandleSIGABRT and -Xrs options together. An error is thrown if both options are enabled. To resolve this error, one of the options should be disabled.

"},{"location":"xxhandlesigusr2/","title":"-XX:[+|-]HandleSIGUSR2","text":""},{"location":"xxhandlesigusr2/#-xx-handlesigusr2","title":"-XX:[+|-]HandleSIGUSR2","text":"

(AIX\u00ae, Linux\u00ae, macOS\u00ae, and z/OS\u00ae only)

This option affects the handling of the SIGUSR2 signal. This signal is user-defined and triggers the user2 event, which is commonly used for taking system dump files with exclusive access. The operating system installs a default signal handler for handling SIGUSR2. If there is no VM or application signal handler, then the operating system's signal handler is used.

"},{"location":"xxhandlesigusr2/#syntax","title":"Syntax","text":"
    -XX:[+|-]HandleSIGAUSR2\n
Setting Effect Default -XX:+HandleSIGUSR2 Enable yes -XX:-HandleSIGUSR2 Disable"},{"location":"xxhandlesigusr2/#explanation","title":"Explanation","text":"

When enabled, the VM handles the SIGUSR2 signal and generates the user2 event, which can be configured with the -Xdump option to trigger a dump agent.

When the option is disabled, the VM does not handle the SIGUSR2 signal and therefore, the VM signal handler is not installed. Generally, the default operating system handler that is installed for the SIGUSR2 signal takes over the handling of the signal.

For more information about the signals and signal handling, see Signal handling.

Note: Do not use the -XX:+HandleSIGUSR2 and -Xrs options together. An error is thrown if both options are enabled. To resolve this error, one of the options should be disabled.

"},{"location":"xxhandlesigusr2/#see-also","title":"See also","text":""},{"location":"xxhandlesigxfsz/","title":"-XX:[+|-]HandleSIGXFSZ","text":""},{"location":"xxhandlesigxfsz/#-xx-handlesigxfsz","title":"-XX:[+|-]HandleSIGXFSZ","text":"

(AIX\u00ae, Linux\u00ae, macOS\u00ae, and z/OS\u00ae only)

This option affects the handling of the operating system signal SIGXFSZ. This signal is generated when a process attempts to write to a file that causes the maximum file size ulimit to be exceeded.

"},{"location":"xxhandlesigxfsz/#syntax","title":"Syntax","text":"
    -XX:[+|-]HandleSIGXFSZ\n
Setting Effect Default -XX:+HandleSIGXFSZ Enable yes -XX:-HandleSIGXFSZ Disable"},{"location":"xxhandlesigxfsz/#explanation","title":"Explanation","text":"

When enabled, the VM handles the signal SIGXFSZ and continues, without ending. When a file is written from a Java\u2122 API class that exceeds the maximum file size ulimit, an exception is raised. Log files that are created by the VM are silently truncated when they reach the maximum file size ulimit.

When the option is disabled, the VM does not handle the signal SIGXFSZ. In this situation, if the maximum file size ulimit for any file is reached, the operating system ends the process with a core dump.

"},{"location":"xxheapdumponoutofmemory/","title":"-XX:[+|-]HeapDumpOnOutOfMemory","text":""},{"location":"xxheapdumponoutofmemory/#-xx-heapdumponoutofmemory","title":"-XX:[+|-]HeapDumpOnOutOfMemory","text":"

This HotSpot option is recognized by Eclipse OpenJ9\u2122. You can use the option to to disable Java\u2122, heap, snap, and system dumps on out-of-memory conditions, which are enabled by default.

"},{"location":"xxheapdumponoutofmemory/#syntax","title":"Syntax","text":"
    -XX:[+|-]HeapDumpOnOutOfMemory\n
Setting Effect Default -XX:+HeapDumpOnOutOfMemory Enable yes -XX:-HeapDumpOnOutOfMemory Disable"},{"location":"xxheapdumppath/","title":"-XX:HeapDumpPath","text":""},{"location":"xxheapdumppath/#-xxheapdumppath","title":"-XX:HeapDumpPath","text":"

This HotSpot option is recognized by Eclipse OpenJ9\u2122 for compatibility, and you can use it as an alias for -Xdump:directory=<path>.

This option sets the directory for all VM dumps including heap dumps, Java\u2122 dumps, and system dumps.

"},{"location":"xxheapdumppath/#syntax","title":"Syntax","text":"
    -XX:HeapDumpPath=<path>\n

where <path> is the directory to which all dump types are written. This directory path is prefixed to the path of all non-absolute dump file names, including the file names for the default dump agents.

"},{"location":"xxheapmanagementmxbeancompatibility/","title":"-XX:[+|-]HeapManagementMXBeanCompatibility","text":""},{"location":"xxheapmanagementmxbeancompatibility/#-xx-heapmanagementmxbeancompatibility","title":"-XX:[+|-]HeapManagementMXBeanCompatibility","text":"

The MXBean interface now reports more detailed information about memory pools and garbage collectors for a garbage collection policy. In addition, the names of memory pools and garbage collectors are changed to match the naming convention that is used for verbose garbage collection logging. This option provides compatibility with earlier versions of the VM.

"},{"location":"xxheapmanagementmxbeancompatibility/#syntax","title":"Syntax","text":"
    -XX:[+|-]HeapManagementMXBeanCompatibility\n
Setting Effect Default -XX:+HeapManagementMXBeanCompatibility Enable -XX:-HeapManagementMXBeanCompatibility Disable yes

Setting -XX:+HeapManagementMXBeanCompatibility on the command line turns on compatibility with earlier versions of the VM. Information about memory pools and garbage collectors are reported in the older format.

When compatibility is turned off, the VM reports more detailed information and matches the naming of memory pools and garbage collectors to the naming convention that is used for verbose garbage collection logging.

"},{"location":"xxheapmanagementmxbeancompatibility/#explanation","title":"Explanation","text":"

The additional information that is available from the MXBean interface for later versions is shown in the following table:

Garbage collection policy MemoryPool names GarbageCollector names gencon nursery-allocate, nursery-survivor, tenured-LOA, tenured-SOA, tenured scavenge, global optthruput or optavgpause tenured-LOA, tenured-SOA, tenured global balanced balanced-reserved, balanced-eden, balanced-survivor, balanced-old partial gc, global garbage collect metronome JavaHeap global

The MemoryPoolMXBean API reports values for 4 detailed memory pools instead of a single value for the overall Java\u2122 heap. In some cases the total sum of the 4 pools is more than the maximum heap size. This irregularity can be caused if data for each pool is collected between garbage collection cycles, where objects have been moved or reclaimed. If you want to collect memory usage data that is synchronized across the memory pools, use the GarbageCollectionNotificationInfo or GarbageCollectorMXBean.getLastGcInfo extensions.

Earlier releases included only the following names:

"},{"location":"xxheapmanagementmxbeancompatibility/#see-also","title":"See also","text":"

For more information about IBM\u00ae MXBeans, see the com.ibm.lang.management API documentation.

"},{"location":"xxidletuningcompactonidle/","title":"-XX:[+|-]IdleTuningCompactOnIdle","text":""},{"location":"xxidletuningcompactonidle/#-xx-idletuningcompactonidle","title":"-XX:[+|-]IdleTuningCompactOnIdle","text":"

(Linux\u00ae only)

Warning: From Eclipse OpenJ9\u2122 version 0.23.0 this option has no effect.

In versions of OpenJ9 before 0.23.0, this option controls garbage collection processing with compaction when the state of the OpenJ9 VM is set to idle.

Restrictions:

  1. This option was deprecated in release 0.15.0 due to operational changes. A compaction is now triggered by internal heuristics that look into the number of fragmented pages. Typically there is no need to force a compaction. This option will be removed in the future.
  2. This option applies only to Linux architectures when the Generational Concurrent (gencon) garbage collection policy is in use.
  3. This option is not effective if the object heap is configured to use large pages.
  4. This option is not effective if -XX:+IdleTuningGcOnIdle is not specified.
"},{"location":"xxidletuningcompactonidle/#syntax","title":"Syntax","text":"
    -XX:[+|-]IdleTuningCompactOnIdle\n
Setting Effect Default Default when running in a docker container -XX:+IdleTuningCompactOnIdle Enable yes -XX:-IdleTuningCompactOnIdle Disable yes

The default depends on whether or not the OpenJ9 VM is running in a container. As indicated in the table, when the VM is running in a container and the state is set to idle, the VM attempts to compact the object heap following a garbage collection cycle. The garbage collection cycle is controlled by the -XX:+IdleTuningGcOnIdle option, which is also enabled by default when the OpenJ9 VM is running inside a container.

If your application is not running in a container and you want compaction to be attempted every time idle GC happens as part of the idle-tuning process, set the -XX:+IdleTuningCompactOnIdle option on the command line when you start your application.

The -XX:+IdleTuningCompactOnIdle option can be used with the -XX:+IdleTuningMinIdleWaitTime, which controls the amount of time that the VM must be idle before an idle state is set. If a value for the -XX:+IdleTuningMinIdleWaitTime option is not explicitly specified, the VM sets a default value of 180 seconds.

"},{"location":"xxidletuningcompactonidle/#see-also","title":"See also","text":""},{"location":"xxidletuninggconidle/","title":"-XX:[+|-]IdleTuningGcOnIdle","text":""},{"location":"xxidletuninggconidle/#-xx-idletuninggconidle","title":"-XX:[+|-]IdleTuningGcOnIdle","text":"

(Linux\u00ae only)

This option controls whether a garbage collection cycle takes place when the state of the Eclipse OpenJ9\u2122 VM is set to idle. Compaction of the heap is also attempted during the idle GC when certain triggers are met.

Restrictions: This option applies only to Linux architectures when the Generational Concurrent (gencon) garbage collection policy is in use. This option is not effective if the object heap is configured to use large pages.

"},{"location":"xxidletuninggconidle/#syntax","title":"Syntax","text":"
    -XX:[+|-]IdleTuningGcOnIdle\n
Setting Effect Default Default when running in a docker container -XX:+IdleTuningGcOnIdle Enable yes -XX:-IdleTuningGcOnIdle Disable yes

The default depends on whether or not the OpenJ9 VM is running in a docker container. As indicated in the table, when the VM is running in a container and the state is set to idle, this option causes the VM to release free memory pages in the object heap without resizing the Java\u2122 heap and attempts to compact the heap after the garbage collection cycle if certain heuristics are triggered. The pages are reclaimed by the operating system, which reduces the physical memory footprint of the VM.

If your application is not running in a container and you want to enable idle-tuning, set the -XX:+IdleTuningGcOnIdle option on the command line when you start your application.

When enabled, the -XX:+IdleTuningGcOnIdle option is used with the -XX:IdleTuningMinIdleWaitTime and -XX:IdleTuningMinFreeHeapOnIdle options. If values for these options are not explicitly specified, the VM sets the following defaults:

"},{"location":"xxidletuninggconidle/#see-also","title":"See also","text":""},{"location":"xxidletuningminfreeheaponidle/","title":"-XX:IdleTuningMinFreeHeapOnIdle","text":""},{"location":"xxidletuningminfreeheaponidle/#-xxidletuningminfreeheaponidle","title":"-XX:IdleTuningMinFreeHeapOnIdle","text":"

(Linux\u00ae only)

This option controls the percentage of free memory pages in the object heap that can be released when the Eclipse OpenJ9\u2122 VM is in an idle state.

Restrictions: This option applies only to Linux architectures when the Generational Concurrent (gencon) garbage collection policy is in use. This option is not effective if the object heap is configured to use large pages.

"},{"location":"xxidletuningminfreeheaponidle/#syntax","title":"Syntax","text":"
    -XX:IdleTuningMinFreeHeapOnIdle=<percentage>\n
Setting Value Default <percentage> [0 - 100] 0

When used with -XX:+IdleTuningGcOnIdle, this option can be used to place an upper bound on the percentage of free memory pages in the object heap that can be released when the VM is in an idle state. If -XX:IdleTuningMinFreeHeapOnIdle is not specified, the VM uses a default value of 0.

"},{"location":"xxidletuningminfreeheaponidle/#example","title":"Example","text":"

If you set -XX:IdleTuningMinFreeHeapOnIdle=10, no more than 90% of the free memory pages in the object heap can be released by the VM when it is in an idle state.

"},{"location":"xxidletuningminfreeheaponidle/#see-also","title":"See also","text":""},{"location":"xxidletuningminidlewaittime/","title":"-XX:IdleTuningMinIdleWaitTime","text":""},{"location":"xxidletuningminidlewaittime/#-xxidletuningminidlewaittime","title":"-XX:IdleTuningMinIdleWaitTime","text":"

** (Linux\u00ae only) **

When the Eclipse OpenJ9\u2122 VM is idle, this option controls the minimum length of time that the VM must be idle before the state of the VM is set to idle. When the state changes to idle, a garbage collection cycle runs, the object heap is compacted, and free memory pages are released back to the operating system, which reduces the footprint of the VM. Garbage collection and compaction are controlled by the -XX:+IdleTuningGcOnIdle and -XX:+IdleTuningCompactOnIdle options, which are enabled by default when the OpenJ9 VM is running inside a docker container. (Note that from OpenJ9 version 0.23.0 the -XX:+IdleTuningCompactOnIdle option has no effect.)

Restrictions: This option applies only to Linux architectures when the Generational Concurrent (gencon) garbage collection policy is in use. This option is not effective if the object heap is configured to use large pages.

"},{"location":"xxidletuningminidlewaittime/#syntax","title":"Syntax","text":"
    -XX:IdleTuningMinIdleWaitTime=<secs>\n
Setting Value Default Default when running in a docker container <secs> [0 or greater] 0 180

The value used for <secs> specifies the minimum length of time in seconds that the VM is idle before the state is set to idle. Idle tuning is enabled by default when the OpenJ9 VM is running in a docker container and the VM is detected as idle for 180 seconds.

Setting the value to 0 disables this feature, which causes the following idle tuning options to have no effect:

"},{"location":"xxidletuningminidlewaittime/#see-also","title":"See also","text":""},{"location":"xxignoreunrecognizedrestoreoptions/","title":"-XX:[+|-]IgnoreUnrecognizedRestoreOptions","text":""},{"location":"xxignoreunrecognizedrestoreoptions/#-xx-ignoreunrecognizedrestoreoptions","title":"-XX:[+|-]IgnoreUnrecognizedRestoreOptions","text":"

(Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), Linux on AArch64, and Linux on IBM Z\u00ae only)

This option specifies whether the VM ignores any unrecognized options at the time of restore.

Restrictions: This option takes effect only when -XX:+EnableCRIUSupport is enabled. This option can be used only on restore.

"},{"location":"xxignoreunrecognizedrestoreoptions/#syntax","title":"Syntax","text":"
    -XX:[+|-]IgnoreUnrecognizedRestoreOptions\n
Setting Effect Default -XX:+IgnoreUnrecognizedRestoreOptions Enable -XX:-IgnoreUnrecognizedRestoreOptions Disable yes"},{"location":"xxignoreunrecognizedrestoreoptions/#explanation","title":"Explanation","text":"

When you restore a checkpoint image, you can specify additional command-line options by using the CRIUSupport.registerRestoreOptionsFile API. You can also use the OPENJ9_RESTORE_JAVA_OPTIONS environment variable (CRIUSupport.registerRestoreEnvVariables API) to add the VM options on restore. If you specify options that do not exist, or are unsupported, the VM, by default, fails to start and throws a JVMRestoreException error. The -XX:+IgnoreUnrecognizedRestoreOptions option disables the failure and allows the VM to continue even if some options are not used.

"},{"location":"xxignoreunrecognizedrestoreoptions/#see-also","title":"See also","text":""},{"location":"xxignoreunrecognizedvmoptions/","title":"-XX:[+|-]IgnoreUnrecognizedVMOptions","text":""},{"location":"xxignoreunrecognizedvmoptions/#-xx-ignoreunrecognizedvmoptions","title":"-XX:[+|-]IgnoreUnrecognizedVMOptions","text":"

This Oracle option affects the behavior of the HotSpot JVM when it finds an unrecognized top-level option at startup. This option is implemented in the Eclipse OpenJ9\u2122 VM for compatibility.

"},{"location":"xxignoreunrecognizedvmoptions/#syntax","title":"Syntax","text":"
    -XX:[+|-]IgnoreUnrecognizedVMOptions\n
Setting Effect Default -XX:+IgnoreUnrecognizedVMOptions Enable -XX:-IgnoreUnrecognizedVMOptions Disable yes"},{"location":"xxignoreunrecognizedxxcolonoptions/","title":"-XX:[+|-]IgnoreUnrecognizedXXColonOptions","text":""},{"location":"xxignoreunrecognizedxxcolonoptions/#-xx-ignoreunrecognizedxxcolonoptions","title":"-XX:[+|-]IgnoreUnrecognizedXXColonOptions","text":"

By default, any -XX: options that you specify on the command line are ignored if they are not recognized, which prevents an application failing to start. However, if you want to determine whether any of your -XX: options are unrecognized, you can turn off the behavior with this option. You might want to do this, for example, if you are switching to Eclipse OpenJ9\u2122 from an alternative VM implementation where you are using -XX: options to tune the runtime environment.

"},{"location":"xxignoreunrecognizedxxcolonoptions/#syntax","title":"Syntax","text":"
    -XX:[+|-]IgnoreUnrecognizedXXColonOptions\n
Setting Effect Default -XX:+IgnoreUnrecognizedXXColonOptions Enable yes -XX:-IgnoreUnrecognizedXXColonOptions Disable

When you specify -XX:-IgnoreUnrecognizedXXColonOptions, if you also specify a -XX: option that is not recognized, that option is reported and the VM does not start. For example:

JVMJ9VM007E Command-line option unrecognised: -XX:InvalidOption\nError: Could not create the Java Virtual Machine.\nError: A fatal exception has occurred. Program will exit.\n
"},{"location":"xxinitialheapsize/","title":"-XX:InitialHeapSize","text":""},{"location":"xxinitialheapsize/#-xxinitialheapsize-xxmaxheapsize","title":"-XX:InitialHeapSize / -XX:MaxHeapSize","text":"

These HotSpot options for specifying heap size are recognized by Eclipse OpenJ9\u2122 for compatibility. See -Xms / -Xmx for details.

"},{"location":"xxinitialheapsize/#syntax","title":"Syntax","text":"Setting Effect -XX:InitialHeapSize<size> Set initial heap size -XX:MaxHeapSize<size> Set maximum heap size"},{"location":"xxinitialrampercentage/","title":"-XX:InitialRAMPercentage","text":""},{"location":"xxinitialrampercentage/#-xxinitialrampercentage-xxmaxrampercentage","title":"-XX:InitialRAMPercentage / -XX:MaxRAMPercentage","text":"

These Oracle HotSpot options can be used to specify the initial and maximum size of the Java heap as a percentage of the total memory available to the VM. The options are recognized by Eclipse OpenJ9\u2122 and provided for compatibility.

"},{"location":"xxinitialrampercentage/#syntax","title":"Syntax","text":"Setting Effect -XX:InitialRAMPercentage=N Set initial heap size as a percentage of total memory -XX:MaxRAMPercentage=N Set maximum heap size as a percentage of total memory Where N is a value between 0 and 100, which can be of type \"double\". For example, 12.3456.

Note: If you set a value for -Xms, the -XX:InitialRAMPercentage option is ignored. If you set a value for -Xmx, the -XX:MaxRAMPercentage option is ignored.

If your application is running in a container and you have specified -XX:+UseContainerSupport, both the default heap size for containers, the -XX:InitialRAMPercentage option, and the -XX:MaxRAMPercentage option are based on the available container memory.

"},{"location":"xxinterleavememory/","title":"-XX:[+|-]InterleaveMemory","text":""},{"location":"xxinterleavememory/#-xx-interleavememory","title":"-XX:[+|-]InterleaveMemory","text":"

(AIX\u00ae, Linux\u00ae, and Windows\u2122 only, but not Linux on IBM Z\u00ae)

Use the -XX:+InterleaveMemory option to enable the interleaving of allocated memory across NUMA nodes.

"},{"location":"xxinterleavememory/#syntax","title":"Syntax","text":"
    -XX:[+|-]InterleaveMemory\n
Setting Effect Default -XX:+InterleaveMemory Enable -XX:-InterleaveMemory Disable yes"},{"location":"xxiprofileduringstartupphase/","title":"-XX:[+|-]IProfileDuringStartupPhase","text":""},{"location":"xxiprofileduringstartupphase/#-xx-iprofileduringstartupphase","title":"-XX:[+|-]IProfileDuringStartupPhase","text":"

This option enables or disables the data collection by the interpreter profiler during a VM startup.

"},{"location":"xxiprofileduringstartupphase/#syntax","title":"Syntax","text":"
    -XX:[+|-]IProfileDuringStartupPhase\n
Setting Effect -XX:+IProfileDuringStartupPhase Enable -XX:-IProfileDuringStartupPhase Disable"},{"location":"xxiprofileduringstartupphase/#explanation","title":"Explanation","text":"

The VM collects interpreter profiling data that is used to optimize methods at the time of JIT compilation. To reduce the CPU usage of the interpreter profiler during the startup phase, the VM stores such profiling data in the shared classes cache. During startup, the VM uses heuristics to determine when to turn on data collection and when to rely on the data that was collected by a previous VM and stored in the cache. You can overrule the heuristics and control the collection of the profiling information during the startup phase by using the -XX:[+|-]IProfileDuringStartupPhase option.

"},{"location":"xxiprofileduringstartupphase/#see-also","title":"See also","text":""},{"location":"xxjitinlinewatches/","title":"-XX:[+|-]JITInlineWatches","text":""},{"location":"xxjitinlinewatches/#-xx-jitinlinewatches","title":"-XX:[+|-]JITInlineWatches","text":"

This option controls JIT operations that relate to JVMTI watched fields.

"},{"location":"xxjitinlinewatches/#syntax","title":"Syntax","text":"
    -XX:[+|-]JITInlineWatches\n
Setting Effect Default -XX:+JITInlineWatches Enable yes -XX:-JITInlineWatches Disable

This option enables performance improvements relating to JVMTI watched fields.

"},{"location":"xxjitserveraddress/","title":"-XX:JITServerAddress","text":""},{"location":"xxjitserveraddress/#-xxjitserveraddress","title":"-XX:JITServerAddress","text":"

This option specifies the JITServer server name or IP address for a JITServer client to connect to.

"},{"location":"xxjitserveraddress/#syntax","title":"Syntax","text":"
    -XX:JITServerAddress=<address>\n
Setting Effect Default -XX:JITServerAddress Set server's name or IP address localhost"},{"location":"xxjitserveraddress/#explanation","title":"Explanation","text":"

When you enable this option, the JITServer client sends compilation requests to a server with the provided name or address. If there is no server available at that address, the JIT compiler compiles locally.

"},{"location":"xxjitserveraddress/#see-also","title":"See also","text":""},{"location":"xxjitserveraotcachedir/","title":"-XX:JITServerAOTCacheDir","text":""},{"location":"xxjitserveraotcachedir/#-xxjitserveraotcachedir","title":"-XX:JITServerAOTCacheDir","text":"

(Linux\u00ae only)

This option specifies the directory to be used for saving and loading JITServer AOT cache files.

"},{"location":"xxjitserveraotcachedir/#syntax","title":"Syntax","text":"
    -XX:JITServerAOTCacheDir=<directory>\n

If the option is not specified, the cache files are saved in the current working directory of the JITServer server.

"},{"location":"xxjitserveraotcachedir/#explanation","title":"Explanation","text":"

A JITServer instance can have several AOT caches, each with its own name. To enable reusing of the AOT caches by other JITServer instances (such as the instances started later), you can use the -XX:+JITServerAOTCachePersistence option. With this option enabled, JITServer server periodically saves its AOT caches to files. Other JITServer instances can then load these caches the first time a client requests a particular cache.

You can specify the directory for saving the AOT cache files with the -XX:JITServerAOTCacheDir=<directory> option. When the server receives the location of the requested AOT cache file through the -XX:JITServerAOTCacheDir option and a request for a specific cache name, if that cache does not exist in-memory, the server searches the specified cache directory for the file with the matching name and loads it, if available.

This option is not applicable if the JITServer AOT cache persistence feature is not enabled with the -XX:+JITServerAOTCachePersistence option.

"},{"location":"xxjitserveraotcachedir/#see-also","title":"See also","text":""},{"location":"xxjitserveraotcachename/","title":"-XX:JITServerAOTCacheName","text":""},{"location":"xxjitserveraotcachename/#-xxjitserveraotcachename","title":"-XX:JITServerAOTCacheName","text":"

This option, used at the JITServer client JVMs, specifies the name of the AOT cache to be used at the JITServer server.

"},{"location":"xxjitserveraotcachename/#syntax","title":"Syntax","text":"
     -XX:JITServerAOTCacheName=<cache_name>\n
where <cache_name> specifies the name of the server-side AOT cache to be used."},{"location":"xxjitserveraotcachename/#explanation","title":"Explanation","text":"

A single JITServer instance can use multiple AOT caches, which are distinguished by their name. Clients that are running applications with significantly different execution profiles can, therefore, connect to the same JITServer instance. Specify this option at the client JVM. If you do not specify this option, the client uses a cache named default.

Note: You must specify -XX:+JITServerUseAOTCache, otherwise the -XX:JITServerAOTCacheName option is ignored.

"},{"location":"xxjitserveraotcachename/#see-also","title":"See also","text":""},{"location":"xxjitserveraotcachepersistence/","title":"-XX:[+|-]JITServerAOTCachePersistence","text":""},{"location":"xxjitserveraotcachepersistence/#-xx-jitserveraotcachepersistence","title":"-XX:[+|-]JITServerAOTCachePersistence","text":"

(Linux\u00ae only)

This option enables or disables the JITServer server's ability to allow other JITServer instances to reuse AOT caches.

"},{"location":"xxjitserveraotcachepersistence/#syntax","title":"Syntax","text":"
    -XX:[+|-]JITServerAOTCachePersistence\n
Setting Effect Default -XX:+JITServerAOTCachePersistence Enable -XX:-JITServerAOTCachePersistence Disable yes"},{"location":"xxjitserveraotcachepersistence/#explanation","title":"Explanation","text":"

With the -XX:+JITServerAOTCachePersistence option, the JITServer server periodically saves its AOT caches to files. Other JITServer instances can then load these caches from files the first time a client requests a particular named cache. This feature is useful to improve performance, especially in scenarios where JITServer instances are started up and shut down regularly.

This feature depends on the -XX:+JITServerUseAOTCache command-line option, which is used to enable caching of AOT-compiled methods. You must specify this option both at the client JVM and at the server.

Use the -XX:JITServerAOTCacheName=<cache_name> option at the client to request a particular AOT cache. If the requested cache does not exist at the server in-memory, but the AOT cache persistence feature is enabled (-XX:+JITServerAOTCachePersistence), the server checks whether a file for that cache exists. If the AOT cache file exists, it is loaded in the background. If the AOT cache file does not exist or the AOT cache persistence feature is disabled (-XX:-JITServerAOTCachePersistence), the server creates an empty AOT cache and gradually populates it with AOT method bodies it compiles.

You can use the -XX:JITServerAOTCacheDir=<directory> option to specify the directory where the AOT cache must be saved to or loaded from.

The name of an AOT cache file has the following structure:

    JITServerAOTCache.<CACHE_NAME>.J<JAVA_VERSION>\n

Where,

"},{"location":"xxjitserveraotcachepersistence/#see-also","title":"See also","text":""},{"location":"xxjitserveraotmx/","title":"-XX:JITServerAOTmx","text":""},{"location":"xxjitserveraotmx/#-xxjitserveraotmx","title":"-XX:JITServerAOTmx","text":"

(Linux\u00ae only)

This option specifies the maximum amount of memory allocated to the JITServer AOT cache for storing the compiled code and for the associated data structures that are used in the cache's implementation.

"},{"location":"xxjitserveraotmx/#syntax","title":"Syntax","text":"
    -XX:JITServerAOTmx=<size>\n
Setting Effect Default -XX:JITServerAOTmx=<size> Limits the amount of memory used by the JITServer AOT cache 300 MB"},{"location":"xxjitserveraotmx/#explanation","title":"Explanation","text":"

When the JITServer receives an AOT compilation request, it checks its AOT cache for a compatible compiled method body. If one is not found, the server performs the AOT compilation, sends the response to the client JVM, then stores the compiled method in its local AOT cache, for future use. Multiple requests and storing of the compiled methods can use a lot of memory and degrade the system's overall performance.

You can specify the maximum memory limit for the AOT cache by using the -XX:JITServerAOTmx=<size> option, so that when the JITServer reaches that limit, it will not be able to add new AOT methods to its AOT cache. This will limit the amount of memory used for caching the compiled code and prevent memory shortages at JITServer that could lead to poor performance or even native out-of-memory events.

"},{"location":"xxjitserveraotmx/#see-also","title":"See also","text":""},{"location":"xxjitserverlocalsynccompiles/","title":"-XX:[+|-]JITServerLocalSyncCompiles","text":""},{"location":"xxjitserverlocalsynccompiles/#-xx-jitserverlocalsynccompiles","title":"-XX:[+|-]JITServerLocalSyncCompiles","text":"

When you specify this JITServer option, synchronous JIT compilations are downgraded to cold optimization level and compiled locally, with a remote asynchronous recompilation scheduled at a later point.

"},{"location":"xxjitserverlocalsynccompiles/#syntax","title":"Syntax","text":"
    -XX:[+|-]JITServerLocalSyncCompiles\n
Setting Effect Default -XX:+JITServerLocalSyncCompiles Enable yes -XX:-JITServerLocalSyncCompiles Disable

The option -XX:[+|-]JITServerLocalSyncCompiles is enabled by default in most cases. The option remains disabled when you specify -Xjit:count=0 and in a few advanced use cases such as running the JVM in debug mode (as described in the Improved JVM debug mode based on OSR post in the Eclipse OpenJ9\u2122 blog).

"},{"location":"xxjitserverlocalsynccompiles/#explanation","title":"Explanation","text":"

During a synchronous compilation, Java\u2122 application threads have to wait for the compilation to complete. Because remote compilations usually take longer, due to network latency, remote synchronous compilations can result in large pauses in the client application.

If you enable this option, the client performs synchronous compilations locally at cold optimization level and later recompiles asynchronously at a higher level remotely. This behavior can be beneficial for real-time applications.

"},{"location":"xxjitserverlocalsynccompiles/#see-also","title":"See also","text":""},{"location":"xxjitserverlogconnections/","title":"-XX:[+|-]JITServerLogConnections","text":""},{"location":"xxjitserverlogconnections/#-xx-jitserverlogconnections","title":"-XX:[+|-]JITServerLogConnections","text":"

This option enables the logging of connection/disconnection events between the JITServer server and the JITServer client. You can use the option on both the server and the client sides.

"},{"location":"xxjitserverlogconnections/#syntax","title":"Syntax","text":"
    -XX:[+|-]JITServerLogConnections\n
Setting Effect Default -XX:+JITServerLogConnections Enable -XX:-JITServerLogConnections Disable yes"},{"location":"xxjitserverlogconnections/#explanation","title":"Explanation","text":"

This option is useful when you need to know when the server and the client successfully establish or terminate connections but verbose logs provide too much information.

You can also enable the same logging by specifying the -Xjit:verbose={JITServerConns} option.

If you do not specify a vlog log file (-Xjit:vlog=<vlog_filename>), output is written to stderr, otherwise it is written to the vlog file.

"},{"location":"xxjitserverlogconnections/#example","title":"Example","text":"

This is what the typical output looks like:

On the server side:

#JITServer: t=  2318 A new client (clientUID=11937826481210274991) connected. Server allocated a new client session.\n...\n...\n#JITServer: t= 48518 Client (clientUID=4213447851416537492) disconnected. Client session deleted\n

On the client side:

#JITServer: t=     0 Connected to a server (serverUID=10444660844386807777)\n...\n...\n#JITServer: t=   698 Lost connection to the server (serverUID=10444660844386807777)\n
"},{"location":"xxjitserverlogconnections/#see-also","title":"See also","text":""},{"location":"xxjitservermetrics/","title":"-XX:JITServerMetrics","text":""},{"location":"xxjitservermetrics/#-xx-jitservermetrics","title":"-XX:[+|-]JITServerMetrics","text":"

This option enables the provision of JITServer performance metrics to a monitoring agent that follows the OpenMetrics standard.

When you enable this option, the following JITServer metrics are provided:

Note: You can use the -XX:JITServerMetricsSSLKey and -XX:JITServerMetricsSSLCert options for encrypting the data with SSL or TLS.

"},{"location":"xxjitservermetrics/#syntax","title":"Syntax","text":"
    -XX:[+|-]JITServerMetrics\n
Setting Effect Default -XX:+JITServerMetrics Enable -XX:-JITServerMetrics Disable yes"},{"location":"xxjitservermetrics/#explanation","title":"Explanation","text":"

When you enable this option, the JITServer process opens a TCP port, which can be used by monitoring agents (like Prometheus) to collect the custom metrics exported by the JITServer. Monitoring agents must issue HTTP GET requests to a URL of the form: http://<jitserveraddress>:<port>/metrics. The path for the HTTP request must be /metrics.

The default value of <port> is 38500. You can change this value by using the -XX:JITServerMetricsPort command line option.

The format for the metrics returned by the JITServer follows the OpenMetrics protocol.

"},{"location":"xxjitservermetrics/#example","title":"Example","text":"

The following example shows an HTTP request from a Prometheus monitoring agent and the response from the JITServer:

HTTP request:

GET /metrics HTTP/1.1 Host: 127.0.0.1:9403 User-Agent: Prometheus/2.31.1 Accept: application/openmetrics-text; version=0.0.1,text/plain;version=0.0.4;q=0.5,*/*;q=0.1 Accept-Encoding: gzip X-Prometheus-Scrape-Timeout-Seconds: 3

JITServer response:

# HELP jitserver_cpu_utilization Cpu utilization of the JITServer # TYPE jitserver_cpu_utilization gauge jitserver_cpu_utilization 12.000000 # HELP jitserver_available_memory Available memory for JITServer # TYPE jitserver_available_memory gauge jitserver_available_memory 32036204544.000000 # HELP jitserver_connected_clients Number of connected clients # TYPE jitserver_connected_clients gauge jitserver_connected_clients 1.000000 # HELP jitserver_active_threads Number of active compilation threads # TYPE jitserver_active_threads gauge jitserver_active_threads 1.000000

"},{"location":"xxjitservermetrics/#see-also","title":"See also","text":""},{"location":"xxjitservermetricsport/","title":"-XX:JITServerMetricsPort","text":""},{"location":"xxjitservermetricsport/#-xxjitservermetricsport","title":"-XX:JITServerMetricsPort","text":"

This option specifies the port number on which the JITServer metrics are provided to a monitoring agent.

Use this option with the -XX:+JITServerMetrics option, which enables the provision of the JITServer metrics.

"},{"location":"xxjitservermetricsport/#syntax","title":"Syntax","text":"
    -XX:JITServerMetricsPort=<port>\n
Setting Effect Default -XX:JITServerMetricsPort Set JITServer port for metrics 38500"},{"location":"xxjitservermetricsport/#see-also","title":"See also","text":""},{"location":"xxjitservermetricssslkey/","title":"-XX:JITServerMetricsSSLCert","text":""},{"location":"xxjitservermetricssslkey/#-xxjitservermetricssslkey-xxjitservermetricssslcert","title":"-XX:JITServerMetricsSSLKey / -XX:JITServerMetricsSSLCert","text":"

These options specify the names of the files that contain the private TLS or SSL key and certificate that are used for authentication and encryption of the custom metrics.

"},{"location":"xxjitservermetricssslkey/#syntax","title":"Syntax","text":"
    -XX:JITServerMetricsSSLKey=<key_file>\n    -XX:JITServerMetricsSSLCert=<cert_file>\n

Where <key_file> specifies the name of the file that contains the private TLS or SSL key and <cert_file> specifies the name of the file that contains the private TLS or SSL certificate. The files must all be in .pem file format.

Setting Effect Default -XX:JITServerMetricsSSLKey Set metrics SSL key None -XX:JITServerMetricsSSLCert Set metrics SSL certificate None"},{"location":"xxjitservermetricssslkey/#explanation","title":"Explanation","text":"

Custom metrics are exported by the JITServer server and collected by a monitoring agent, such as Prometheus. The exported data is sent in clear text by default. To secure this data with TLS or SSL authentication and encryption, specify the private key (<key>.pem) and the certificate (<cert>.pem) at the server:

    -XX:JITServerMetricsSSLKey=<key>.pem -XX:JITServerMetricsSSLCert=<cert>.pem\n

You must specify both the options for TLS or SSL authentication and encryption.

Note: To enable the export of custom metrics, you must specify the -XX:[+|-]JITServerMetrics option.

"},{"location":"xxjitservermetricssslkey/#see-also","title":"See also","text":""},{"location":"xxjitserverport/","title":"-XX:JITServerPort","text":""},{"location":"xxjitserverport/#-xxjitserverport","title":"-XX:JITServerPort","text":"

This option specifies the port on which the JITServer server listens for compilation requests.

On the JITServer server, this option sets the port that is open for connections.

On the JITServer client, this option specifies to which server port the client should send compilation requests.

"},{"location":"xxjitserverport/#syntax","title":"Syntax","text":"
    -XX:JITServerPort=<port>\n
Setting Effect Default -XX:JITServerPort Set JITServer port 38400"},{"location":"xxjitserverport/#see-also","title":"See also","text":""},{"location":"xxjitservershareromclasses/","title":"-XX:JITServerShareROMClasses","text":""},{"location":"xxjitservershareromclasses/#-xx-jitservershareromclasses","title":"-XX:[+|-]JITServerShareROMClasses","text":"

This option enables or disables the JITServer server to share cached ROM classes between JITServer clients.

"},{"location":"xxjitservershareromclasses/#syntax","title":"Syntax","text":"
    -XX:[+|-]JITServerShareROMClasses\n
Setting Effect Default -XX:+JITServerShareROMClasses Enable yes -XX:-JITServerShareROMClasses Disable

Note: The JITServer AOT caching feature is now enabled at the server by default with the -XX:+JITServerUseAOTCache option. Because the -XX:+JITServerShareROMClasses option is a prerequisite for the -XX:+JITServerUseAOTCache option, therefore the -XX:+JITServerShareROMClasses option is also the default setting. If you disabled the JITServer AOT cache at the server (-XX:-JITServerUseAOTCache), specify the -XX:+JITServerShareROMClasses option explicitly to enable the sharing of the cached ROM classes feature.

"},{"location":"xxjitservershareromclasses/#explanation","title":"Explanation","text":"

Enable this option when multiple clients that are running identical or similar applications connect to a single server.

This option enables a caching optimization that allows the server to use ROM classes that are cached for one client while compiling for a different client. This behavior reduces the memory usage at the server because only a single copy of a particular Java\u2122 class is cached.

"},{"location":"xxjitservershareromclasses/#see-also","title":"See also","text":""},{"location":"xxjitserversslcert/","title":"-XX:JITServerSSLCert","text":""},{"location":"xxjitserversslcert/#-xxjitserversslcert-xxjitserversslkey-xxjitserversslrootcerts","title":"-XX:JITServerSSLCert / -XX:JITServerSSLKey / -XX:JITServerSSLRootCerts","text":"

Options for encrypting network communication between JITServer servers and JITServer client VMs.

"},{"location":"xxjitserversslcert/#syntax","title":"Syntax","text":"
    -XX:JITServerCert=<cert_file>\n    -XX:JITServerKey=<key_file>\n    -XX:JITServerSSLRootCerts=<root_certs_file>\n

The files must all be in .pem file format.

Setting Effect Default -XX:JITServerSSLCert Set server's SSL certificate None -XX:JITServerSSLKey Set server's SSL key None -XX:JITServerSSLRootCerts Set client's SSL root certificate None"},{"location":"xxjitserversslcert/#explanation","title":"Explanation","text":"

You can encrypt network communication by using OpenSSL 1.0.x, 1.1.x, or 3.x. To enable encryption, specify the private key (<key>.pem) and the certificate (<cert>.pem) at the server:

-XX:JITServerSSLKey=<key>.pem -XX:JITServerSSLCert=<cert>.pem\n

and use the certificate at the client:

-XX:JITServerSSLRootCerts=<cert>.pem\n

You must specify all three options for the client to be able to connect to the server. If the client cannot connect, it is forced to perform all compilations locally instead.

For more details and further discussion about security considerations, see the blog post Free your JVM from the JIT with JITServer Technology.

"},{"location":"xxjitserversslcert/#see-also","title":"See also","text":""},{"location":"xxjitservertimeout/","title":"-XX:JITServerTimeout","text":""},{"location":"xxjitservertimeout/#-xxjitservertimeout","title":"-XX:JITServerTimeout","text":"

This option specifies the socket timeout for JITServer communication.

You can specify this option on both the server and the client sides.

"},{"location":"xxjitservertimeout/#syntax","title":"Syntax","text":"
    -XX:JITServerTimeout=<timeout_ms>\n
Setting Effect Default -XX:JITServerTimeout Set the timeout value in milliseconds for socket operations 30000 ms for the JITServer process and 10000 ms when Eclipse OpenJ9\u2122 is launched as a client VM"},{"location":"xxjitservertimeout/#see-also","title":"See also","text":""},{"location":"xxjitserveruseaotcache/","title":"-XX:[+|-]JITServerUseAOTCache","text":""},{"location":"xxjitserveruseaotcache/#-xx-jitserveruseaotcache","title":"-XX:[+|-]JITServerUseAOTCache","text":"

This option enables or disables the caching of AOT-compiled methods in the JITServer server.

"},{"location":"xxjitserveruseaotcache/#syntax","title":"Syntax","text":"
    -XX:[+|-]JITServerUseAOTCache\n
Setting Effect Default -XX:+JITServerUseAOTCache Enable yes -XX:-JITServerUseAOTCache Disable"},{"location":"xxjitserveruseaotcache/#explanation","title":"Explanation","text":"

When you enable this option, the JITServer server caches the AOT-compiled methods. When a JITServer client requests an AOT compilation and the requested method exists in the cache, the server does not have to recompile the method. This feature, therefore, improves the CPU utilization of the JITServer technology and of the cluster.

Note: This option must be enabled both at the client JVM and at the server. Although this option is by default enabled at the server, it is still disabled for the JITServer clients. That means that you don't have to specify the -XX:+JITServerUseAOTCache option at the server to enable the JITServer AOT caching feature, but you must specify this option for each client who wants to use this feature.

The -XX:+JITServerShareROMClasses option is also enabled by default at the server because this option is a prerequisite for the -XX:+JITServerUseAOTCache option.

"},{"location":"xxjitserveruseaotcache/#see-also","title":"See also","text":""},{"location":"xxlazysymbolresolution/","title":"-XX:[+|-]LazySymbolResolution","text":""},{"location":"xxlazysymbolresolution/#-xx-lazysymbolresolution","title":"-XX:[+|-]LazySymbolResolution","text":"

(Linux\u00ae and macOS\u00ae only)

This option affects the timing of symbol resolution for functions in user native libraries.

"},{"location":"xxlazysymbolresolution/#syntax","title":"Syntax","text":"
    -XX:[+|-]LazySymbolResolution\n
Setting Effect Default -XX:+LazySymbolResolution Enable yes -XX:-LazySymbolResolution Disable"},{"location":"xxlazysymbolresolution/#explanation","title":"Explanation","text":"

Enabling this option forces the VM to delay symbol resolution for each function in a user native library, until the function is called. The -XX:-LazySymbolResolution option forces the VM to immediately resolve symbols for all functions in a user native library when the library is loaded.

These options apply only to functions; variable symbols are always resolved immediately when loaded. If you attempt to use these options on an operating system other than Linux or macOS, the options are accepted, but ignored.

"},{"location":"xxlegacyxlogoption/","title":"-XX:[+|-]LegacyXLogOption","text":""},{"location":"xxlegacyxlogoption/#-xx-legacyxlogoption","title":"-XX:[+|-]LegacyXlogOption","text":"

Controls processing of the -Xlog option.

"},{"location":"xxlegacyxlogoption/#syntax","title":"Syntax","text":"Setting Effect Default -XX:+LegacyXlogOption Enable legacy -Xlog behavior -XX:-LegacyXlogOption Process -Xlog requests for GC logging yes"},{"location":"xxlegacyxlogoption/#explanation","title":"Explanation","text":"

From Eclipse OpenJ9\u2122 0.24.0, the -Xlog option is replaced by the -Xsyslog option. The -XX:[+|-]LegacyXlogOption controls how the -Xlog option is processed.

"},{"location":"xxmaxdirectmemorysize/","title":"-XX:MaxDirectMemorySize","text":""},{"location":"xxmaxdirectmemorysize/#-xxmaxdirectmemorysize","title":"-XX:MaxDirectMemorySize","text":"

This Oracle HotSpot option sets a limit on the amount of memory that can be reserved for all Direct Byte Buffers.

"},{"location":"xxmaxdirectmemorysize/#syntax","title":"Syntax","text":"
-XX:MaxDirectMemorySize=<size>\n
Setting Value Default <size> [1[k|K|m|M|g|G] or greater] Depends on maximum heap size

The value you choose is the limit on memory that can be reserved for all Direct Byte Buffers. If a value is set for this option, the sum of all Direct Byte Buffer sizes cannot exceed the limit. After the limit is reached, a new Direct Byte Buffer can be allocated only when enough old buffers are freed to provide enough space to allocate the new buffer.

By default, the amount of native memory used for Direct Byte Buffers is limited to 87.5% of the maximum heap size.

By default, the amount of native memory used for Direct Byte Buffers is limited to the maximum heap size.

"},{"location":"xxmergecompileroptions/","title":"-XX:[+|-]MergeCompilerOptions","text":""},{"location":"xxmergecompileroptions/#-xx-mergecompileroptions","title":"-XX:[+|-]MergeCompilerOptions","text":"

This option enables or disables the merging of multiple -Xjit or -Xaot options into a single -Xjit or -Xaot option.

"},{"location":"xxmergecompileroptions/#syntax","title":"Syntax","text":"
    -XX:[+|-]MergeCompilerOptions\n
Setting Effect Default -XX:+MergeCompilerOptions Enable -XX:-MergeCompilerOptions Disable yes"},{"location":"xxmergecompileroptions/#explanation","title":"Explanation","text":"

By default, if you specify -Xjit option (or -Xaot option) multiple times, only the last option takes effect. Therefore, on adding an -Xjit option, the resultant behavior might not be as expected, if any instance of this option already exists. It is time-consuming to find the existing instances and try combining them manually so that the system behaves as required.

You can use the -XX:+MergeCompilerOptions option to merge all the existing instances of the -Xjit options logically. To retain the default behavior, whereby only the last option takes effect, you can use the -XX:-MergeCompilerOptions option.

If both -Xjit and -Xaot options exist and you use the -XX:+MergeCompilerOptions option, then multiple -Xjit options are merged into a single -Xjit option and multiple -Xaot options are merged into a single -Xaot option.

"},{"location":"xxmergecompileroptions/#examples","title":"Examples","text":""},{"location":"xxmergecompileroptions/#one-xjit-option","title":"One -Xjit option","text":"
java -Xshareclasses:none  -Xjit:version -version\n

-Xjit option that is applied - version

java -XX:+MergeCompilerOptions -Xshareclasses:none  -Xjit:version -version\n

-Xjit option that is applied - version

java -XX:-MergeCompilerOptions -Xshareclasses:none  -Xjit:version -version\n

-Xjit option that is applied - version

"},{"location":"xxmergecompileroptions/#multiple-xjit-options","title":"Multiple -Xjit options","text":"
java -Xshareclasses:none '-Xjit:verbose={compilePerformance},vlog=vlog' -Xjit:version -version\n

-Xjit option that is applied - version

java -XX:+MergeCompilerOptions -Xshareclasses:none '-Xjit:verbose={compilePerformance},vlog=vlog' -Xjit:version -version\n

-Xjit options that are applied - verbose={compilePerformance},vlog=vlog,version

java -XX:-MergeCompilerOptions -Xshareclasses:none '-Xjit:verbose={compilePerformance},vlog=vlog' -Xjit:version -version\n

-Xjit option that is applied - version

"},{"location":"xxmergecompileroptions/#both-xxmergecompileroptions-and-xx-mergecompileroptions","title":"Both -XX:+MergeCompilerOptions and -XX:-MergeCompilerOptions","text":"

If there are multiple -XX:[+|-]MergeCompilerOptions options with multiple -Xjit options, the last -XX:[+|-]MergeCompilerOptions setting takes effect before the -Xjit options are processed.

java -XX:+MergeCompilerOptions -XX:-MergeCompilerOptions -Xshareclasses:none '-Xjit:verbose={compilePerformance},vlog=vlog' -Xjit:version -version\n

-Xjit option that is applied - version

java -XX:-MergeCompilerOptions -XX:+MergeCompilerOptions -Xshareclasses:none '-Xjit:verbose={compilePerformance},vlog=vlog' -Xjit:version -version\n

-Xjit options that are applied - {compilePerformance},vlog=vlog,version

"},{"location":"xxmergecompileroptions/#see-also","title":"See also","text":""},{"location":"xxnosuballoc32bitmem/","title":"-XXnosuballoc32bitmem","text":""},{"location":"xxnosuballoc32bitmem/#-xxnosuballoc32bitmem","title":"-XXnosuballoc32bitmem","text":"

(z/OS\u00ae only)

When compressed references are used with a 64-bit Eclipse OpenJ9\u2122 VM on z/OS\u00ae, this option forces the VM to use 31-bit memory allocation functions provided by z/OS.

"},{"location":"xxnosuballoc32bitmem/#syntax","title":"Syntax","text":"
    -XXnosuballoc32bitmem\n
Setting Effect Default -XXnosuballoc32bitmem Enable No setting Disable yes"},{"location":"xxnosuballoc32bitmem/#explanation","title":"Explanation","text":"

This option is provided as a workaround for customers who need to use fewer pages of 31-bit virtual storage per VM invocation. Using this option might result in a small increase in the number of frames of central storage used by the VM. However, the option frees 31-bit pages for use by native code or other applications in the same address space.

If this option is not specified, the VM uses an allocation strategy for 31-bit memory that reserves a region of 31-bit virtual memory.

"},{"location":"xxonoutofmemoryerror/","title":"-XX:OnOutOfMemoryError","text":""},{"location":"xxonoutofmemoryerror/#-xxonoutofmemoryerror","title":"-XX:OnOutOfMemoryError","text":"

You can use this Oracle HotSpot option to run commands when a java.lang.OutOfMemoryError is thrown. This option is recognized by Eclipse OpenJ9\u2122 and provided for compatibility.

"},{"location":"xxonoutofmemoryerror/#syntax","title":"Syntax","text":"
    -XX:OnOutOfMemoryError=\"<command_string>\"\n

where <command_string> is a command or list of commands to run when a java.lang.OutOfMemoryError occurs.

For example, the following command specifies that the java -version command is run if the Test application throws a java.lang.OutOfMemoryError exception:

java -XX:OnOutOfMemoryError=\"java -version\" Test

If you want to run multiple commands, use semicolons to separate them within <command_string>. For example:

-XX:OnOutOfMemoryError=\"<java_path> <java_program>; cat file.txt\"

The -XX:OnOutOfMemoryError option is equivalent to the following -Xdump option:

-Xdump:tool:events=systhrow,filter=java/lang/OutOfMemoryError,exec=<command_string>

For more information, see -Xdump.

"},{"location":"xxopenj9commandlineenv/","title":"-XX:[+|-]OpenJ9CommandLineEnv","text":""},{"location":"xxopenj9commandlineenv/#-xx-openj9commandlineenv","title":"-XX:[+|-]OpenJ9CommandLineEnv","text":"

This option controls whether the VM captures the command line in the environment variable OPENJ9_JAVA_COMMAND_LINE. If enabled, the variable is set by the VM after it starts. Using this variable, you can find the command-line parameters set when the VM started. It applies not just to launchers (e.g. java) that are included in a JDK, but to any application that uses JNI_CreateJavaVM().

"},{"location":"xxopenj9commandlineenv/#syntax","title":"Syntax","text":"
    -XX:[+|-]OpenJ9CommandLineEnv\n
Setting Effect Default on z/OS Default on other platforms -XX:+OpenJ9CommandLineEnv Enable yes -XX:-OpenJ9CommandLineEnv Disable yes

This option is currently disabled by default on z/OS\u00ae because it might cause the VM to crash.

"},{"location":"xxopenj9commandlineenv/#see-also","title":"See also","text":""},{"location":"xxoriginaljdk8heapsizecompatibilitymode/","title":"-XX:[+|-]OriginalJDK8HeapSizeCompatibilityMode","text":""},{"location":"xxoriginaljdk8heapsizecompatibilitymode/#-xx-originaljdk8heapsizecompatibilitymode","title":"-XX:[+|-]OriginalJDK8HeapSizeCompatibilityMode","text":"

The default value for the maximum heap size (-Xmx) is 25% of the available memory with a maximum of 25 GB. However, where there is 2 GB or less of physical memory, the value set is 50% of available memory with a minimum value of 16 MB and a maximum value of 512 MB. In Eclipse OpenJ9\u2122 0.18.0 and earlier releases the default is half the available memory with a minimum of 16 MB and a maximum of 512 MB. Enable this option to revert to the earlier default value.

Restriction: This option is supported only on Java\u2122 8. It is ignored on Java 11 and later versions.

"},{"location":"xxoriginaljdk8heapsizecompatibilitymode/#syntax","title":"Syntax","text":"
-XX:[+|-]OriginalJDK8HeapSizeCompatibilityMode\n
Setting Effect Default -XX:+OriginalJDK8HeapSizeCompatibilityMode Enable -XX:-OriginalJDK8HeapSizeCompatibilityMode Disable yes"},{"location":"xxpagealigndirectmemory/","title":"-XX:[+|-]PageAlignDirectMemory","text":""},{"location":"xxpagealigndirectmemory/#-xx-pagealigndirectmemory","title":"-XX:[+|-]PageAlignDirectMemory","text":"

This Oracle HotSpot option affects the alignment of direct byte buffer allocation and is implemented by the Eclipse OpenJ9\u2122 VM for compatibility.

"},{"location":"xxpagealigndirectmemory/#syntax","title":"Syntax","text":"
    -XX:[+|-]PageAlignDirectMemory\n
Setting Effect Default -XX:+PageAlignDirectMemory Enable -XX:-PageAlignDirectMemory Disable yes

As discussed in the Oracle documentation, before Java\u2122 SE 7, direct buffers that were allocated using java.nio.ByteBuffer.allocateDirect(int) were aligned on a page boundary. This behavior changed in Java SE 7 and the -XX:+PageAlignDirectMemory option is provided to revert to the previous behavior.

For more information about the changes, see RFE 4837564, which was introduced in the Java SE 7 release notes.

"},{"location":"xxparallelcmsthreads/","title":"-XX:ParallelCMSThreads","text":""},{"location":"xxparallelcmsthreads/#-xxparallelcmsthreads","title":"-XX:ParallelCMSThreads","text":"

This Oracle HotSpot option affects the number of threads used by the concurrent garbage collector. This option is recognized by Eclipse OpenJ9\u2122 and provided for compatibility.

"},{"location":"xxparallelcmsthreads/#syntax","title":"Syntax","text":"
    -XX:ParallelCMSThreads=<number>\n

Where <number> is the number of low-priority background threads that are attached to assist the mutator threads in concurrent mark.

Within OpenJ9 this option is directly mapped to -Xconcurrentbackground.

"},{"location":"xxparallelgcmaxthreads/","title":"-XX:ParallelGCMaxThreads","text":""},{"location":"xxparallelgcmaxthreads/#-xxparallelgcmaxthreads","title":"-XX:ParallelGCMaxThreads","text":"

This option specifies the maximum number of threads that can be used during parallel operations of the garbage collector. Unlike -XX:ParallelGCThreads, this option does not enforce a thread count, but can be used to allow the garbage collector to adjust the number of parallel GC threads, if used with the Adaptive GC Threading option.

"},{"location":"xxparallelgcmaxthreads/#syntax","title":"Syntax","text":"
    -XX:ParallelGCMaxThreads=<number>\n

Where <number> is the maximum number of threads that can be used for parallel operations.

This option is directly mapped to -Xgcmaxthreads.

"},{"location":"xxparallelgcthreads/","title":"-XX:ParallelGCThreads","text":""},{"location":"xxparallelgcthreads/#-xxparallelgcthreads","title":"-XX:ParallelGCThreads","text":"

This Oracle HotSpot option specifies the number of threads that are used during parallel operations of the default garbage collector. This option is recognized by Eclipse OpenJ9\u2122 and provided for compatibility.

Notes:

This option enforces the thread count and cannot be used with the -XX:+AdaptiveGCThreading option, which enables the garbage collector to adjust the number of parallel threads based on heuristics. If you want to use -XX:+AdaptiveGCThreading, use -XX:ParallelGCMaxThreads instead of -XX:ParallelGCThreads.

"},{"location":"xxparallelgcthreads/#syntax","title":"Syntax","text":"
    -XX:ParallelGCThreads=<number>\n

Where <number> is the number of threads that are used for parallel operations.

Within OpenJ9 this option is directly mapped to -Xgcthreads.

"},{"location":"xxperftool/","title":"-XX:[+|-]PerfTool","text":""},{"location":"xxperftool/#-xx-perftool","title":"-XX:[+|-]PerfTool","text":"

This option enables or disables JIT support for the perf tool without affecting the existing Xjit options.

Restriction: Since this option creates a file that is used by the Linux\u00ae system profiler, perf, it applies only to Linux.

"},{"location":"xxperftool/#syntax","title":"Syntax","text":"
    -XX:[+|-]PerfTool\n
Setting Effect Default -XX:+PerfTool Enable -XX:-PerfTool Disable yes"},{"location":"xxperftool/#explanation","title":"Explanation","text":"

The -XX:+PerfTool option is a stand-alone alternative for the existing -Xjit:perfTool option. If multiple -Xjit options exist, only the last option takes effect. Therefore, if the -Xjit:perfTool option is added later, it overrides the existing -Xjit options. To overcome this issue, the XX:+PerfTool option enables JIT support for the perf tool without having any impact on the existing Xjit options. This enabling option creates a /tmp/perf-<pid>.map file that is used by the perf tool to map the samples in the JIT-compiled code to the corresponding Java method names.

To disable the JIT support for the perf tool, set the -XX:-PerfTool option on the command line.

"},{"location":"xxperftool/#see-also","title":"See also","text":""},{"location":"xxportablesharedcache/","title":"-XX:[+|-]PortableSharedCache","text":""},{"location":"xxportablesharedcache/#-xx-portablesharedcache","title":"-XX:[+|-]PortableSharedCache","text":"

Use this command line option to choose whether AOT-compiled code should be portable.

This option, when enabled, increases the portability of AOT-compiled code, in the following ways:

This feature is particularly relevant for packaging a shared classes cache into a container image (for example, applications deployed on the cloud in the form of Docker containers) due to the following reasons: - The processor on which the container image is built is likely to be different from the processor on which the container is deployed. - In a multi-layered container image where the shared classes cache is multi-layered as well, the AOT-compiled code in shared classes cache will likely come from multiple OpenJ9 VMs with different heap size requirements.

"},{"location":"xxportablesharedcache/#syntax","title":"Syntax","text":"
    -XX:[+|-]PortableSharedCache\n
Setting Effect Default -XX:+PortableSharedCache Enable See notes that follow -XX:-PortableSharedCache Disable"},{"location":"xxportablesharedcache/#default-settings","title":"Default settings","text":"

This option is enabled by default in containers. To disable the option in a container, specify -XX:-PortableSharedCache.

The option is disabled by default outside containers. To enable the option outside a container, specify -XX:+PortableSharedCache for the initial JVM instance (when the creation of the shared classes cache happens) as well as for every subsequent instance that makes use of the same shared classes cache.

"},{"location":"xxpositiveidentityhash/","title":"-XX:[+|-]PositiveIdentityHash","text":""},{"location":"xxpositiveidentityhash/#-xx-positiveidentityhash","title":"-XX:[+|-]PositiveIdentityHash","text":"

Eclipse OpenJ9\u2122 allows both positive and negative identity hashcodes (System.identityHashCode / Object.hashCode). This is problematic for programs that incorrectly assume hashcodes can only be positive.

When enabled, this option limits identity hash codes to non-negative values.

Because limiting identity hash codes to non-negative values can have an impact on the performance of hash-intensive operations, this option is not enabled by default.

"},{"location":"xxpositiveidentityhash/#syntax","title":"Syntax","text":"
    -XX:[+|-]PositiveIdentityHash\n
Setting Effect Default -XX:+PositiveIdentityHash Enable -XX:-PositiveIdentityHash Disable yes"},{"location":"xxprintcodecache/","title":"-XX:[+|-]PrintCodeCache","text":""},{"location":"xxprintcodecache/#-xx-printcodecache","title":"-XX:[+|-]PrintCodeCache","text":"

This Oracle HotSpot option prints the code cache memory usage when the application exits. This option is recognized by Eclipse OpenJ9\u2122 and provided for compatibility.

"},{"location":"xxprintcodecache/#syntax","title":"Syntax","text":"
    -XX:[+|-]PrintCodeCache\n
Setting Effect Default -XX:+PrintCodeCache Enable -XX:-PrintCodeCache Disable yes

As discussed in the Oracle documentation, the code cache usage can be shown when the application exits, by specifying \u2013XX:+PrintCodeCache on the Java launcher command line. The output looks similar to the following:

CodeCache: size=262144Kb used=454Kb max_used=457Kb free=261690Kb\n
"},{"location":"xxprintflagsfinal/","title":"-XX:[+|-]PrintFlagsFinal","text":""},{"location":"xxprintflagsfinal/#-xx-printflagsfinal","title":"-XX:[+|-]PrintFlagsFinal","text":"

When enabled, this option outputs the values of a subset of configuration parameters in a format compatible with that produced by HotSpot. The parameters currently output are those expected by various software projects and packages.

"},{"location":"xxprintflagsfinal/#syntax","title":"Syntax","text":"
    -XX:[+|-]PrintFlagsFinal\n
Setting Effect Default -XX:+PrintFlagsFinal Enable -XX:-PrintFlagsFinal Disable yes"},{"location":"xxprintflagsfinal/#example","title":"Example","text":"

Here is an example of typical output from -XX:+PrintFlagsFinal:

[Global flags]\n   size_t MaxHeapSize              = 4294967296          {product} {ergonomic}\n uint64_t MaxDirectMemorySize      = 3758096384          {product} {ergonomic}\n
"},{"location":"xxreadipinfoforras/","title":"-XX:[+|-]ReadIPInfoForRAS","text":""},{"location":"xxreadipinfoforras/#-xx-readipinfoforras","title":"-XX:[+|-]ReadIPInfoForRAS","text":"

Use this command-line option to enable and disable network queries from being used to determine the host name and IP address for RAS (reliability, availability, and serviceability) troubleshooting purposes.

"},{"location":"xxreadipinfoforras/#syntax","title":"Syntax","text":"
    -XX:[+|-]ReadIPInfoForRAS\n
Setting Effect Default -XX:+ReadIPInfoForRAS Enable yes -XX:-ReadIPInfoForRAS Disable

Eclipse OpenJ9\u2122 captures the host name and IP address by default, for use in diagnosing problems. But if a nameserver cannot be contacted when a network query is made, the program will wait until the resolver times out.

You can avoid this situation by using the -XX:-ReadIPInfoForRAS command-line option to prevent the query from being performed.

"},{"location":"xxreducecpumonitoroverhead/","title":"-XX:[+|-]ReduceCPUMonitorOverhead","text":""},{"location":"xxreducecpumonitoroverhead/#-xx-reducecpumonitoroverhead","title":"-XX:[+|-]ReduceCPUMonitorOverhead","text":"

(AIX\u00ae, Linux\u00ae, macOS\u00ae, and Windows\u2122 only)

This option relates to the CPU usage of thread categories that can be obtained with the com.ibm.lang.management.JvmCpuMonitorMXBean application programming interface. This option affects the way that the VM records the amount of CPU usage of non-Garbage Collection (GC) threads that do work on behalf of GC.

Most GC policies require non-GC threads to do some GC housekeeping work in proportion to the amount of memory allocation that they do. Ideally the exact amount of CPU time that the thread spends doing this housekeeping work should be accounted for in the GC thread category. However there is an overhead that is associated with maintaining the CPU usage data in the correct thread category.

Restriction: This option is not supported on z/OS\u00ae. If you attempt to use this option, the following message is generated:

JVMJ9VM145E -XX:-ReduceCPUMonitorOverhead is unsupported on z/OS. Error: Could not create the Java Virtual Machine.\n
"},{"location":"xxreducecpumonitoroverhead/#syntax","title":"Syntax","text":"

-XX:[+|-]ReduceCPUMonitorOverhead

Setting Effect Default -XX:+ReduceCPUMonitorOverhead Enable yes -XX:-ReduceCPUMonitorOverhead Disable

When you enable this option, the VM does not maintain information on the amount of CPU usage that non-GC threads spend in doing work on behalf of GC. If you set -XX:-ReduceCPUMonitorOverhead, the Eclipse OpenJ9\u2122 VM monitors the amount of GC work that a non-GC thread does and accounts for it in the GC category. This information is made available in the com.ibm.lang.management.JvmCpuMonitorMXBean. Setting this option results in a small increase in application startup time, which varies according to platform.

"},{"location":"xxreducecpumonitoroverhead/#see-also","title":"See also","text":""},{"location":"xxrequirejitserver/","title":"-XX:[+|-]RequireJITServer","text":""},{"location":"xxrequirejitserver/#-xx-requirejitserver","title":"-XX:[+|-]RequireJITServer","text":"

When you enable this option, the JITServer client crashes with an assert if it detects that a JITServer server is unavailable.

"},{"location":"xxrequirejitserver/#syntax","title":"Syntax","text":"
    -XX:[+|-]RequireJITServer\n
Setting Effect Default -XX:+RequireJITServer Enable -XX:-RequireJITServer Disable yes"},{"location":"xxrequirejitserver/#explanation","title":"Explanation","text":"

This option is for debugging purposes only.

When this option is disabled, a server crash forces the client to perform compilations locally. You might want to enable this option if you are running a test suite with JITServer enabled, so that a test fails if the server crashes, instead of switching to local compilations and hiding the failure.

"},{"location":"xxrequirejitserver/#see-also","title":"See also","text":""},{"location":"xxruntimeinstrumentation/","title":"-XX:[+|-]RuntimeInstrumentation","text":""},{"location":"xxruntimeinstrumentation/#-xx-runtimeinstrumentation","title":"-XX:[+|-]RuntimeInstrumentation","text":"

(AIX\u00ae, Linux\u00ae, and z/OS\u00ae only)

This option controls the use of the Runtime Instrumentation (RI) facility in the virtual machines that support it.

The RI facility is a feature that is available in POWER8\u00ae, zEC12, and later processors that offers hardware support for collecting profiling information at run time. The process uses minimal resources. The use of the RI facility is not enabled by default.

"},{"location":"xxruntimeinstrumentation/#syntax","title":"Syntax","text":"
    -XX:[+|-]RuntimeInstrumentation\n
Setting Effect Default -XX:+RuntimeInstrumentation Enable -XX:-RuntimeInstrumentation Disable yes

Note: On Linux, the RI facility on Power 8 and later processors uses the Performance Monitoring Unit (PMU) inside the processor. However, the PMU is also used by system profilers like oprofile or perf. Due to the current Linux kernel implementation, a user cannot reliably profile a Java\u2122 application when RI is enabled. Although this limitation might be addressed in future Linux kernels, for reliable profiling on Power systems that use Linux, the -XX:-RuntimeInstrumentation option must be used.

"},{"location":"xxsethwprefetch/","title":"-XXsetHWPrefetch","text":""},{"location":"xxsethwprefetch/#-xxsethwprefetch","title":"-XXsetHWPrefetch","text":"

(AIX\u00ae only)

This option enables or disables hardware prefetch. Hardware prefetch can improve the performance of applications by prefetching memory. However, because of the workload characteristics of many Java\u2122 applications, prefetching often has an adverse effect on performance.

"},{"location":"xxsethwprefetch/#syntax","title":"Syntax","text":"
    -XXsetHWPrefetch=[none|os-default]\n
Setting Effect Default none Disable yes os-default Enable

The -XXsetHWPrefetch:none option disables hardware prefetch. Although you can disable hardware prefetch on AIX by issuing the command dscrctl -n -s 1, this command disables hardware prefetch for all processes, and for all future processes, which might not be desirable in a mixed workload environment. The -XXsetHWPrefetch:none option allows hardware prefetch to be disabled for individual VMs.

To enable hardware prefetch with the default value for the operating system, specify -XXsetHWPrefetch:os-default. Use this option only for applications that can obtain a performance gain from hardware prefetch.

"},{"location":"xxshareanonymousclasses/","title":"-XX:[+|-]ShareAnonymousClasses","text":""},{"location":"xxshareanonymousclasses/#-xx-shareanonymousclasses","title":"-XX:[+|-]ShareAnonymousClasses","text":"

This option enables or disables the storage of VM anonymous classes, those created by Unsafe.defineAnonymousClass, in the shared classes cache.

In OpenJDK 15 and later versions, this option also enables or disables the storage of hidden classes in the shared classes cache.

The option is enabled by default, which means that anonymous classes (and hidden classes, in OpenJDK 15 and later) are stored in the shared classes cache and are therefore available for ahead-of-time (AOT) compilation, potentially improving startup performance.

"},{"location":"xxshareanonymousclasses/#syntax","title":"Syntax","text":"
    -XX:[+|-]ShareAnonymousClasses\n
Setting Effect Default -XX:+ShareAnonymousClasses Enable yes -XX:-ShareAnonymousClasses Disable"},{"location":"xxshareanonymousclasses/#see-also","title":"See also","text":""},{"location":"xxshareclassesenablebci/","title":"-XX:ShareClassesDisableBCI","text":""},{"location":"xxshareclassesenablebci/#-xxshareclassesdisablebci-xxshareclassesenablebci","title":"-XX:ShareClassesDisableBCI / -XX:ShareClassesEnableBCI","text":"

The option -Xshareclasses:enableBCI improves startup performance without using a modification context, when using JVMTI class modification. This suboption allows classes loaded from the shared cache to be modified using a JVMTI ClassFileLoadHook, or a java.lang.instrument agent, and prevents modified classes being stored in the shared classes cache. You can turn off this option by specifying -XX:ShareClassesDisableBCI when you start your Java\u2122 application.

"},{"location":"xxshareclassesenablebci/#syntax","title":"Syntax","text":"
    -XX:ShareClassesDisableBCI|ShareClassesEnableBCI\n
Setting Effect Default -XX:ShareClassesDisableBCI Disable -XX:ShareClassesEnableBCI Enable yes

These options are equivalent to -Xshareclasses:disableBCI and -Xshareclasses:enableBCI. For more information, see -Xshareclasses.

"},{"location":"xxshareclassesenablebci/#see-also","title":"See also","text":""},{"location":"xxsharedcachehardlimit/","title":"-XX:SharedCacheHardLimit","text":""},{"location":"xxsharedcachehardlimit/#-xxsharedcachehardlimit","title":"-XX:SharedCacheHardLimit","text":"

Specifies the size for a new shared classes cache. Use this option together with the -Xscmx option to set actual and soft maximum size limits respectively.

"},{"location":"xxsharedcachehardlimit/#syntax","title":"Syntax","text":"
    -XX:SharedCacheHardLimit=<size>\n
Setting Value Default <size> [1[k|K|m|M|g|G] or greater]

See Using -X command-line options for more information about the <size> parameter.

When you use this option with the -Xscmx option, the -Xscmx option sets the soft maximum size, and the -XX:SharedCacheHardLimit option sets the actual size, of a new shared classes cache. For more information, see -Xscmx.

If you use this option without the -Xscmx option, the behavior is the same as using the -Xscmx option by itself; both options set the actual size of the shared classes cache.

For more information about cache sizes, see Cache size limits.

"},{"location":"xxsharedcachehardlimit/#example","title":"Example","text":"

The following settings, when used together, set the soft maximum size of the shared classes cache to 16 MB and the actual maximum cache size to 64 MB.

-XX:SharedCacheHardLimit=64m -Xscmx16m\n
"},{"location":"xxsharedcachehardlimit/#see-also","title":"See also","text":""},{"location":"xxshareunsafeclasses/","title":"-XX:[+|-]ShareUnsafeClasses","text":""},{"location":"xxshareunsafeclasses/#-xx-shareunsafeclasses","title":"-XX:[+|-]ShareUnsafeClasses","text":"

This option enables or disables the storage of VM classes created through Unsafe.defineClass in the shared classes cache.

The option is enabled by default, which means that unsafe classes are stored in the shared classes cache and are therefore available for ahead-of-time (AOT) compilation, potentially improving startup performance.

"},{"location":"xxshareunsafeclasses/#syntax","title":"Syntax","text":"
    -XX:[+|-]ShareUnsafeClasses\n
Setting Effect Default -XX:+ShareUnsafeClasses Enable yes -XX:-ShareUnsafeClasses Disable"},{"location":"xxshareunsafeclasses/#see-also","title":"See also","text":""},{"location":"xxshowcarrierframes/","title":"-XX:[+|-]ShowCarrierFrames","text":""},{"location":"xxshowcarrierframes/#-xx-showcarrierframes","title":"-XX:[+|-]ShowCarrierFrames","text":"

This option controls the addition of the carrier threads' stack trace to the Throwable.getStackTrace() method. You can add the stack trace of the carrier threads to facilitate the debugging process.

Notes:

"},{"location":"xxshowcarrierframes/#syntax","title":"Syntax","text":"
    -XX:[+|-]ShowCarrierFrames\n
Setting Effect Default -XX:+ShowCarrierFrames Enable -XX:-ShowCarrierFrames Disable yes"},{"location":"xxshowcarrierframes/#explanation","title":"Explanation","text":"

Virtual threads require platform threads to run because the operating system identifies only platform threads. Therefore, a VM maintains multiple platform threads that are used as carrier threads to run the virtual threads. The VM assigns a virtual thread to a platform thread in a process called mounting.

Although the virtual thread runs on a carrier thread, the stack trace of the virtual thread and its carrier thread are separate. If an exception occurs on running the virtual threads, the thread dumps do not include stack frames from the carrier thread's stack.

You can use the -XX:+ShowCarrierFrames option to add the stack trace of the carrier thread in addition to the virtual thread stack trace to the Throwable.getStackTrace() method, if an exception occurs.

"},{"location":"xxshowcodedetailsinexceptionmessages/","title":"-XX:[+|-]ShowCodeDetailsInExceptionMessages","text":""},{"location":"xxshowcodedetailsinexceptionmessages/#-xx-showcodedetailsinexceptionmessages","title":"-XX:[+|-]ShowCodeDetailsInExceptionMessages","text":"

This OpenJDK HotSpot option enables or disables the feature that displays the details of a NullPointerException generated by a VM. This option is recognized by Eclipse OpenJ9\u2122 and provided for compatibility.

"},{"location":"xxshowcodedetailsinexceptionmessages/#syntax","title":"Syntax","text":"
    -XX:[+|-]ShowCodeDetailsInExceptionMessages\n
Setting Effect Default -XX:+ShowCodeDetailsInExceptionMessages Enable yes -XX:-ShowCodeDetailsInExceptionMessages Disable yes"},{"location":"xxshowcodedetailsinexceptionmessages/#explanation","title":"Explanation","text":"

A NullPointerException might include a message if a message was specified in the NullPointerException constructor or a null message if no message was specified in the constructor. A NullPointerException that is generated by a VM also has a null message. These messages do not have details of the reason for the exceptions thrown. A NullPointerException also includes a stack trace that contains the method, file name, and line number where the exception occurred. However, a single line of code might contain several access paths. Each of these paths might be the source of that exception, and it is difficult to identify the path that is the root cause of the exception.

JEP 358: Helpful NullPointerExceptions provides extended messages when a NullPointerException is generated by a VM. You can enable this feature with the -XX:+ShowCodeDetailsInExceptionMessages option, which is a part of this JEP 358. When this feature is enabled and the VM throws a NullPointerException, a detailed message with the action that was not completed because of this exception and the reason for this exception is displayed. For example, in the following message, Cannot read field \"c\" is the action that was not completed and because \"a.b\" is null is the root cause of the exception.

Exception in thread \"main\" java.lang.NullPointerException: Cannot read field \"c\" because \"a.b\" is null\n    at Prog.main(Prog.java:5)\n
"},{"location":"xxshowhiddenframes/","title":"-XX:[+|-]ShowHiddenFrames","text":""},{"location":"xxshowhiddenframes/#-xx-showhiddenframes","title":"-XX:[+|-]ShowHiddenFrames","text":"

This reimplementation of the Oracle HotSpot diagonostic option enables or disables the display of generated hidden MethodHandle frames in a stack trace.

This option doesn't affect the contents of dump files.

Unlike the HotSpot implementation, this option doesn't require the +UnlockDiagnosticVMOptions option.

"},{"location":"xxshowhiddenframes/#syntax","title":"Syntax","text":"
    -XX:[+|-]ShowHiddenFrames\n
Setting Effect Default -XX:+ShowHiddenFrames Enable -XX:-ShowHiddenFrames Disable yes When disabled, this option causes the VM to hide generated hidden MethodHandle frames in a stacktrace."},{"location":"xxshownativestacksymbols/","title":"-XX:[+|-]ShowNativeStackSymbols","text":""},{"location":"xxshownativestacksymbols/#-xx-shownativestacksymbols","title":"-XX:[+|-]ShowNativeStackSymbols","text":"

This option controls whether Java\u00ae dumps show the names of functions in native call stacks.

"},{"location":"xxshownativestacksymbols/#syntax","title":"Syntax","text":"
    -XX:-ShowNativeStackSymbols\n    -XX:+ShowNativeStackSymbols=<value>\n
Setting Value Effect Default -XX:-ShowNativeStackSymbols Don't show native stack symbols, not even in response to a signal, such as a fault signal -XX:+ShowNativeStackSymbols basic Show all the available native stack symbols for a signaled or faulting thread, but only easily acquired native stack symbols for other threads yes -XX:+ShowNativeStackSymbols all Show all the available native stack symbols for all threads"},{"location":"xxshownativestacksymbols/#explanation","title":"Explanation","text":"

Java dumps take longer to produce when the native stack symbols are included. If your Java application has a lot of threads, you might get an incomplete Java dump. You can avoid this situation by reducing the number of native stack symbols in the Java dump or by omitting them altogether.

"},{"location":"xxshowunmountedthreadstacks/","title":"-XX:[+|-]ShowUnmountedThreadStacks","text":""},{"location":"xxshowunmountedthreadstacks/#-xx-showunmountedthreadstacks","title":"-XX:[+|-]ShowUnmountedThreadStacks","text":"

This option enables or disables the inclusion of the unmounted virtual thread stacks in a Java\u2122 core file.

"},{"location":"xxshowunmountedthreadstacks/#syntax","title":"Syntax","text":"
    -XX:[+|-]ShowUnmountedThreadStacks\n
Setting Effect Default -XX:+ShowUnmountedThreadStacks Enable -XX:-ShowUnmountedThreadStacks Disable yes"},{"location":"xxshowunmountedthreadstacks/#explanation","title":"Explanation","text":"

In a VM, Java\u2122 threads are mapped one-to-one to platform threads and each thread is allocated a new native Java stack.

Virtual threads require platform threads to run because the operating system identifies only platform threads, but these virtual threads are not tied one-to-one to a platform thread. The VM mounts the virtual threads on available platform threads, called carrier threads. When the VM faces a blocking operation on a virtual thread, the thread is unmounted from its carrier thread and hence, the virtual thread is no longer mapped to a platform thread.

Java core file lists stacks of only those threads that are mapped to platform threads. Therefore, the stack of any unmounted virtual thread is not included in the Java core file and thus, the virtual thread information remains incomplete. The unmounted threads also include the carrier thread if a virtual thread was mounted on it. Unmounting the virtual thread, unmounts the carrier thread itself. The stack of any unmounted carrier thread is also not included in the Java core file.

You can use the -XX:+ShowUnmountedThreadStacks option to include all the thread data that a VM is aware of, both regular Java threads and the unmounted threads, in the Java core file.

The -XX:-ShowUnmountedThreadStacks option is the default option because the chance of having issues with unmounted virtual threads is low. Usually the running or mounted threads are what causes failures. Including the unmounted virtual thread information increases the Java core file size and that might affect performance.

"},{"location":"xxshowunmountedthreadstacks/#see-also","title":"See also","text":""},{"location":"xxstacktraceinthrowable/","title":"-XX:-StackTraceInThrowable","text":""},{"location":"xxstacktraceinthrowable/#-xx-stacktraceinthrowable","title":"-XX:-StackTraceInThrowable","text":"

This option removes stack traces from exceptions.

"},{"location":"xxstacktraceinthrowable/#syntax","title":"Syntax","text":"
    -XX:-StackTraceInThrowable\n
Setting Effect Default -XX:-StackTraceInThrowable Disable No

While stack traces are included in exceptions by default, recording them can have a negative impact on performance. Use this option if you want to remove stack traces, although this might cause difficulties with problem determination.

When this option is enabled, Throwable.getStackTrace() returns an empty array and the stack trace is displayed when an uncaught exception occurs. Thread.getStackTrace() and Thread.getAllStackTraces() are not affected by this option.

"},{"location":"xxstacktraceinthrowable/#see-also","title":"See also","text":""},{"location":"xxtransparenthugepage/","title":"-XX:[+|-]TransparentHugePage","text":""},{"location":"xxtransparenthugepage/#-xx-transparenthugepage","title":"-XX:[+|-]TransparentHugePage","text":"

(Linux\u00ae systems only: x86, POWER\u00ae, and IBM Z\u00ae)

If Transparent Huge Pages (THP) is set to madvise on your system, this option, when enabled, promotes all memory allocated to huge pages. On systems without THP, or if THP is set to always or never on your system, this option is ignored. When transparent huge pages are used, your application footprint might increase.

"},{"location":"xxtransparenthugepage/#syntax","title":"Syntax","text":"Setting Effect Default -XX:+TransparentHugePage Enable yes -XX:-TransparentHugePage Disable"},{"location":"xxusecompressedoops/","title":"-XX:[+|-]UseCompressedOops","text":""},{"location":"xxusecompressedoops/#-xx-usecompressedoops","title":"-XX:[+|-]UseCompressedOops","text":"

(64-bit only)

This Oracle HotSpot option enables or disables compressed references in 64-bit JVMs. The option is recognized by the Eclipse OpenJ9\u2122 VM and is provided to help when porting applications from the HotSpot JVM to the OpenJ9 VM. This option might not be supported in subsequent releases.

"},{"location":"xxusecompressedoops/#syntax","title":"Syntax","text":"
    -XX:[+|-]UseCompressedOops\n
Setting Effect Default -XX:+UseCompressedOops Enable -XX:-UseCompressedOops Disable

The -XX:+UseCompressedOops option is similar to specifying -Xcompressedrefs. Compressed references are used by default when the maximum memory size for an application is set above a platform-specific value. For more information, see -Xcompressedrefs.

"},{"location":"xxusecontainersupport/","title":"-XX:[+|-]UseContainerSupport","text":""},{"location":"xxusecontainersupport/#-xx-usecontainersupport","title":"-XX:[+|-]UseContainerSupport","text":"

(Linux\u00ae only)

If your application is running in a container that imposes a memory limit, the VM allocates a larger fraction of memory to the Java heap. To turn off this behavior, set the -XX:-UseContainerSupport option on the command line.

"},{"location":"xxusecontainersupport/#syntax","title":"Syntax","text":"
    -XX:[+|-]UseContainerSupport\n
Setting Effect Default -XX:-UseContainerSupport Disable -XX:+UseContainerSupport Enable yes

When using container technology, applications are typically run on their own and do not need to compete for memory. The Eclipse OpenJ9\u2122 VM detects when it is running inside a container that imposes a memory limit, and adjusts the maximum Java heap size appropriately.

The following table shows the values that are used when -XX:+UseContainerSupport is set:

Container memory limit <size> Maximum Java heap size Less than 1 GB 50% <size> 1 GB - 2 GB <size> - 512 MB Greater than 2 GB 75% <size>

The default heap size is capped at 25 GB, which is the limit of heap size for 3-bit shift of compressed references (see -Xcompressedrefs), to prevent silent switching to 4-bit shift of compressed references, which has possible performance penalties. You can use the -Xmx option or the -XX:MaxRAMPercentage option to overwrite the 25 GB limit.

The default heap size for containers takes affect only when the following conditions are met:

  1. The application is running in a container environment.
  2. The memory limit for the container is set.
  3. The -XX:+UseContainerSupport option is set, which is the default behavior.

To prevent the VM adjusting the maximum heap size when running in a container, set -XX:-UseContainerSupport.

When -XX:MaxRAMPercentage / -XX:InitialRAMPercentage are used with -XX:+UseContainerSupport, the corresponding heap setting is determined based on the memory limit of the container. For example, to set the maximum heap size to 80% of the container memory, specify the following options:

-XX:+UseContainerSupport -XX:MaxRAMPercentage=80\n

Note: If you set a value for -Xms, the -XX:InitialRAMPercentage option is ignored. If you set a value for -Xmx, the -XX:MaxRAMPercentage option is ignored.

"},{"location":"xxusegcstartuphints/","title":"-XX:[+|-]UseGCStartupHints","text":""},{"location":"xxusegcstartuphints/#-xx-usegcstartuphints","title":"-XX:[+|-]UseGCStartupHints","text":"

When this option is enabled, the VM calculates, over several application restarts, an appropriate startup heap size for your application. You can therefore use this option instead of calculating and setting an -Xms value yourself. Setting an initial size for the heap that is larger than the default helps to avoid frequent garbage collections during the startup phase of an application.

"},{"location":"xxusegcstartuphints/#syntax","title":"Syntax","text":"
    -XX:[+|-]UseGCStartupHints\n
Setting Effect Default -XX:+UseGCStartupHints Enable yes -XX:-UseGCStartupHints Disable

When enabled, the VM records the heap size when a startup complete event occurs, storing the value into the shared classes cache. On subsequent restarts, the garbage collector (GC) reads this value early in startup processing and expands the heap to an appropriate value. For accuracy and stability, averages are taken over a few restarts to stabilize the value used. The heap size recorded is specific to the application command line, therefore a different hint is stored for every unique command line.

You can check the value used by the garbage collector for heap expansion by inspecting verbose GC output. The following example shows heap expansion based on hints from the previous run when using the gencon policy:

<heap-resize id=\"2\" type=\"expand\" space=\"nursery\" amount=\"205258752\" count=\"1\" timems=\"0.328\" reason=\"hint from previous runs\" timestamp=\"2019-06-05T13:26:32.021\" />\n<heap-resize id=\"3\" type=\"expand\" space=\"tenure\" amount=\"692649984\" count=\"1\" timems=\"0.326\" reason=\"hint from previous runs\" timestamp=\"2019-06-05T13:26:32.022\" />\n

The final value stored to the shared cache is not recorded in the verbose GC output.

Notes:

Restriction: This feature is not currently available with the Balanced GC policy.

"},{"location":"xxusejitserver/","title":"-XX:[+|-]UseJITServer","text":""},{"location":"xxusejitserver/#-xx-usejitserver","title":"-XX:[+|-]UseJITServer","text":"

This option starts the Eclipse OpenJ9\u2122 VM in JITServer client mode.

"},{"location":"xxusejitserver/#syntax","title":"Syntax","text":"
    -XX:[+|-]UseJITServer\n
Setting Effect Default -XX:+UseJITServer Enable -XX:-UseJITServer Disable yes"},{"location":"xxusejitserver/#explanation","title":"Explanation","text":"

When you enable this option, the VM tries to connect to a server and send all JIT compilation requests to it. For more information, see JITServer Technology.

You must specify this option for any other -XX:*JITServer* options to take effect.

"},{"location":"xxusejitserver/#see-also","title":"See also","text":""},{"location":"xxusenogc/","title":"-XX:[+|-]UseNoGC","text":""},{"location":"xxusenogc/#-xx-usenogc","title":"-XX:[+|-]UseNoGC","text":"

The -XX:+UseNoGC option enables a garbage collection policy that expands the Java object heap in the normal way until the limit is reached, but memory is not reclaimed through garbage collection.

"},{"location":"xxusenogc/#syntax","title":"Syntax","text":"
    -XX:[+|-]UseNoGC\n
Setting Effect Default -XX:+UseNoGC Enable -XX:-UseNoGC Disable yes"},{"location":"xxusenogc/#explanation","title":"Explanation","text":"

This policy can be useful for test purposes and for short-lived applications. When the limit is reached an OutOfMemory error is generated and the VM shuts down.

The -XX:-UseNoGC option turns off a previously enabled -XX:+UseNoGC option.

This policy can also be enabled with the -Xgcpolicy:nogc option. See -Xgcpolicy:nogc for more details about this policy and when it is appropriate to use it.

"},{"location":"xxusezlibnx/","title":"-XX:[+|-]UseZlibNX","text":""},{"location":"xxusezlibnx/#-xx-usezlibnx","title":"-XX:[+|-]UseZlibNX","text":"

AIX\u00ae with IBM POWER9\u00ae and later only

This option enables or disables the adding of the zlibNX library directory location to the LIBPATH environment variable.

"},{"location":"xxusezlibnx/#syntax","title":"Syntax","text":"
    -XX:[+|-]UseZlibNX\n
Setting Effect Default -XX:+UseZlibNX Enable yes -XX:-UseZlibNX Disable"},{"location":"xxusezlibnx/#explanation","title":"Explanation","text":"

AIX system adds the zlibNX library location, if available, to the LIBPATH variable by default. But having the zlibNX library directory location in the LIBPATH variable might cause some issues. For example, Git clone fails when executed from Java\u00ae when zlibNX is on the LIBPATH in the environment.

You can disable adding of the zlibNX library location to the LIBPATH variable with the -XX:-UseZlibNX option.

"},{"location":"xxusezlibnx/#see-also","title":"See also","text":""},{"location":"xxutfcache/","title":"-XX:[+|-]UTFCache","text":""},{"location":"xxutfcache/#-xx-utfcache","title":"-XX:[+|-]UTFCache","text":"

This option enables or disables the UTF to String cache used to enhance reflection performance.

"},{"location":"xxutfcache/#syntax","title":"Syntax","text":"
    -XX:[+|-]UTFCache\n
Setting Effect Default -XX:+UTFCache Enable yes -XX:-UTFCache Disable

The option, -XX:+UTFCache, causes the VM to cache the conversion of UTF8 data to java String objects during reflection. This is the default option.

When specifying the -XX:-UTFCache option, the VM does not performing this caching.

"},{"location":"xxverboseverification/","title":"-XX:[+|-]VerboseVerification","text":""},{"location":"xxverboseverification/#-xx-verboseverification","title":"-XX:[+|-]VerboseVerification","text":"

You can use this option to control the output of verbose diagnostic data that relates to verification.

The Oracle documentation to support this option is no longer available, because it is no longer used by the HotSpot VM. An explanation is provided here.

"},{"location":"xxverboseverification/#syntax","title":"Syntax","text":"
    -XX:[+|-]VerboseVerification\n
Setting Effect Default -XX:-VerboseVerification Disable yes -XX:+VerboseVerification Enable

Use -XX:-VerboseVerification to enable the output of verbose diagnostic data to stderr that is generated during verification from the class file StackMapTable attribute. The data provides extra contextual information about bytecode verification, which helps diagnose bytecode or stackmap deficiencies in the field.

Class files that have StackMapTable attributes (that is, class files that conform to version 50.0 or later of the class file format specification), are introduced in Java\u2122 V6. Class files with StackMapTable attributes are marked as new format in the verbose output, as shown in the example. Class files without the StackMapTable attributes are marked as old format. The StackMapTable diagnostic information is available only to classes verified with the new format.

Here is an example of StackMapTable diagnostic output:

Verifying class java.example.ibm.com with new format\nVerifying method java.example.ibm.com.foo(Ljava/lang/String;Ljava/lang/Class;[Ljava/lang/String;Ljava/io/PrintStream;)I\nStackMapTable: frame_count = 3\ntable = {\n  bci: @37\n  flags: { }\n  locals: { 'java/lang/String', 'java/lang/Class', '[Ljava/lang/String;', 'java/io/PrintStream', 'java/lang/Class' }\n  stack: { 'java/lang/ThreadDeath' }\n  bci: @42\n  flags: { }\n  locals: { 'java/lang/String', 'java/lang/Class', '[Ljava/lang/String;', 'java/io/PrintStream', 'java/lang/Class' }\n  stack: { 'java/lang/Throwable' }\n  bci: @79\n  flags: { }\n  locals: { 'java/lang/String', 'java/lang/Class', '[Ljava/lang/String;', 'java/io/PrintStream', 'java/lang/Class',\n        'java/lang/Throwable' }\n  stack: { }\n }\nEnd class verification for: java.example.ibm.com\n
"},{"location":"xxvmlockclassloader/","title":"-XX:[+|-]VMLockClassLoader","text":""},{"location":"xxvmlockclassloader/#-xx-vmlockclassloader","title":"-XX:[+|-]VMLockClassLoader","text":"

This option affects synchronization on class loaders that are not parallel-capable class loaders, during class loading.

"},{"location":"xxvmlockclassloader/#syntax","title":"Syntax","text":"
    -XX:[+|-]VMLockClassLoader\n
Setting Effect Default -XX:+VMLockClassLoader Enable yes -XX:-VMLockClassLoader Disable

The option, -XX:+VMLockClassLoader, causes the VM to force synchronization on a class loader that is not a parallel capable class loader during class loading. This action occurs even if the loadClass() method for that class loader is not synchronized. For information about parallel capable class loaders, see java.lang.ClassLoader.registerAsParallelCapable(). Note that this option might cause a deadlock if class loaders use non-hierarchical delegation. For example, setting the system property osgi.classloader.lock=classname with Equinox is known to cause a deadlock. This is the default option.

When specifying the -XX:-VMLockClassLoader option, the VM does not force synchronization on a class loader during class loading. The class loader still conforms to class library synchronization, such as a synchronized loadClass() method.

"},{"location":"xzero/","title":"-Xzero","text":""},{"location":"xzero/#-xzero","title":"-Xzero","text":"

Enables reduction of the memory footprint of the Java\u2122 runtime environment when concurrently running multiple Java invocations.

This option is deprecated and will be removed in a future release.

This option can be used only with Java SE version 8 runtime environments.

-Xzero might not be appropriate for all types of applications because it changes the implementation of java.util.ZipFile, which might cause extra memory usage.

"},{"location":"xzero/#syntax","title":"Syntax","text":"Setting Effect -Xzero:none Disable all sub options -Xzero:describe Prints the sub options in effect -Xzero:sharebootzip Enables the sharebootzip sub option -Xzero:nosharebootzip Disables the sharebootzip sub option

The following parameters are no longer supported. The options are parsed but do nothing:

Setting Effect -Xzero:j9zip Enables the j9zip sub option -Xzero:noj9zip Disables the j9zip sub option -Xzero:sharezip Enables the sharezip sub option -Xzero:nosharezip Disables the sharezip sub option"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"About the docs","text":""},{"location":"#eclipse-openj9","title":"Eclipse OpenJ9","text":"

Welcome to the user documentation for the Eclipse OpenJ9\u2122 virtual machine (VM).

This user documentation supports the configuration, tuning, and diagnosis of the OpenJ9 VM in an OpenJDK runtime. However, due to differences between the Java SE class libraries, specific options might apply only to one Java SE version. Icons are used to indicate where differences apply. For example:

This sentence applies only to Java 11 binaries that include the OpenJ9 VM. Icons for LTS releases are this colour.

This sentence applies only to Java 16 or later binaries that include the OpenJ9 VM. Icons for feature releases are this colour.

To see which Java releases are LTS releases and which are feature releases, and for information about release cadence, supported platforms, and build environments, see Supported environments.

Note: Documentation to support OpenJ9 is still under construction. The current content covers some high level information about OpenJ9 components together with the command-line options and environment variables that you can use to configure the VM when you start your application. Because OpenJ9 was contributed to the Eclipse Foundation by IBM, this content contains some links to additional information that forms part of the IBM\u00ae SDK, Java\u2122 Technology Edition product documentation in IBM Documentation. That content supplements the documentation here until a more complete set of user documentation is available.

We welcome contributions to the user documentation. If you would like to get involved, please read our Contribution guidelines. If you spot any errors in the documentation, please raise an issue at our GitHub repository.

"},{"location":"#supported-environments","title":"Supported environments","text":"

OpenJDK binaries that contain the OpenJ9 VM are supported on a range of hardware and operating systems. This range is expanding as work progresses at the Eclipse foundation. See the current list of supported environments for details.

Note: This user guide also contains information about configuring, tuning, and debugging OpenJ9 on the z/OS\u00ae platform.

"},{"location":"#documentation-for-specific-releases","title":"Documentation for specific releases","text":"

Several versions of the documentation are available, covering all releases of OpenJ9:

"},{"location":"#useful-links","title":"Useful links","text":""},{"location":"allocation/","title":"Heap allocation","text":""},{"location":"allocation/#heap-allocation","title":"Heap allocation","text":"

The process of managing memory in the VM is handled by the allocator and the garbage collector. These components operate on an area of memory that is reserved for VM processing called the Java\u2122 heap.

The allocator assigns areas of the heap for Java objects. Objects are considered as live when they have a chain of references to them that start from root references, such as those found in thread stacks. When that reference or pointer no longer exists, the objects are considered as garbage.

The garbage collector reclaims memory by removing objects when they are no longer required. To find out more about the garbage collector, see Garbage collection.

Depending on your application workload or service level agreement, you can choose from a number of Eclipse OpenJ9\u2122 garbage collection (GC) policies. Each GC policy uses a different strategy to manage memory on the heap. The structure of the heap also depends on the strategy in force. For more information about choosing a GC policy, see Garbage collection policies.

"},{"location":"allocation/#the-allocator","title":"The allocator","text":"

The allocator manages pools of free memory and how the free memory is consumed. It is also responsible for allocating areas of storage in the Java heap for objects at the request of applications, class libraries, or the VM.

In general, allocation requires a heap lock to synchronize concurrent threads that try to access the same area of memory at the same time. When an object is allocated, the heap lock is released. If there is insufficient space to allocate the object, allocation fails, the heap lock is released, and the garbage collector is called. If GC manages to recover some space on the heap, the allocator can resume operations. If GC does not recover enough space, it returns an OutOfMemoryError exception.

Acquiring a heap lock for every allocation would be an intensive operation with an impact to performance. To get around this problem, small objects are allocated to allocation caches.

"},{"location":"allocation/#allocation-caches","title":"Allocation caches","text":"

To improve performance, allocation caches are reserved in the heap for different threads. These allocation caches are known as thread local heaps (TLH) and allow each thread to allocate memory from its cache without acquiring the heap lock. Objects are allocated from the TLH unless there is insufficient space remaining in the TLH to satisfy the request. In this situation, the allocation might proceed directly from the heap for larger objects by using a heap lock or the TLH might be refreshed for smaller objects.

If a thread allocates a lot of objects, the allocator gives that thread a larger TLH to reduce contention on the heap lock.

A TLH is predefined with an initial default size of 2 KB. On every TLH refresh, the requested size for that thread is increased by an increment (default 4 KB). The requested size can grow up to a predefined maximum (default 128 KB). If a TLH refresh fails to complete, a GC cycle is triggered.

After every GC cycle, the requested size of the TLH for each thread is reduced, sometimes by as much as 50%, to take account of threads that reduce their allocation rate and no longer need large TLHs.

For very inactive threads, the requested size can even drop below the initial value, down to the predefined minimum (512/768 bytes). For very active threads, the maximum TLH requested size might be reached before the next GC occurs.

Larger TLHs can help reduce heap lock contention, but might also reduce heap utilization and increase heap fragmentation.

The following options control the requested TLH size:

Typically, when the maximum TLH size is increased, you should also increase the increment proportionally, so that active threads can reach the maximum requested TLH size more quickly.

"},{"location":"allocation/#heap-configuration","title":"Heap configuration","text":"

Depending on the memory management strategy in force, the Java heap can be configured in a number of ways. The simplest configuration consists of a single area of memory, often referred to as a flat heap. Other configurations divide the heap into different areas or regions, which might contain objects of different ages (generations) or sizes.

"},{"location":"allocation/#area-based-heaps","title":"Area-based heaps","text":"

The default GC policy for OpenJ9 uses a heap configuration that is divided into two main areas: the nursery area for new object allocation, and the tenure area for objects that continue to be reachable for a longer period of time. Most objects have short lifecycles and can be reclaimed by the garbage collector more quickly by focusing only on the nursery area. Global GC cycles that cause application pauses in order to clear and defragment the tenure area are less frequent.

"},{"location":"allocation/#soa-and-loa","title":"SOA and LOA","text":"

All area-based heaps subdivide part of the heap into the Small Object Area (SOA) and the Large Object Area (LOA).

The allocator initially attempts to allocate objects in the SOA, regardless of size. If the allocation cannot be satisfied the following actions are possible, depending on object size:

The GC action that is triggered by the allocation failure depends on the GC policy in force.

The overall size of the LOA is calculated when the heap is initialized, and recalculated at the end of each global GC cycle. The garbage collector can expand or contract the LOA, depending on usage, to avoid allocation failures.

You can control the size of the LOA by using the -Xloainitial, -Xloaminimum, and -Xloamaximum command line options. If the LOA is not used, the garbage collector contracts the LOA after a few cycles, down to the value of -Xloaminimum. You can also specify -Xnoloa to prevent an LOA being created.

An SOA and LOA are used by the OpenJ9 GC policies: gencon, optavgpause, and optthruput. For the gencon policy, the LOA and SOA are contained within the tenure area, which is designated for ageing objects. For more information about policies, see Garbage collection policies.

"},{"location":"allocation/#region-based-heaps","title":"Region-based heaps","text":"

The Java heap can also be subdivided into multiple regions. The balanced GC policy uses a heap that is divided into thousands of equal size regions in order to manage multiple generations of objects. The metronome GC policy also uses multiple regions, which are grouped by size-class to manage a singe generation of objects. To learn more about how the regions are configured for each policy, see Garbage collection policies.

In addition to regions, the balanced and metronome policies use structures called arraylets to store large arrays in the heap.

"},{"location":"allocation/#arraylets","title":"Arraylets","text":"

A Java heap that is subdivided into regions might not be able to contain a large enough region for data arrays. This problem is solved by using arraylets. An arraylet has a spine, which contains the class pointer and size, and leaves, which contain the data associated with the array. The spine also contains arrayoids, which are pointers to the respective arraylet leaves, as shown in the following diagram.

There are a number of advantages to using arraylets.

Note: Despite the general advantage of using arraylets, they can slow down processing when the Java Native Interface (JNI) is being used. The JNI provides flexibility by enabling Java programs to call native code; for example, C or C++, and if direct addressability to the inside of an object is needed, a JNI critical section can be used. However, that requires the object to be in a contiguous region of memory, or at least appear to be so. The JNI, therefore, creates a temporary contiguous array that is the same size as the original array and copies everything, element by element, to the temporary array. After the JNI critical section is finished, everything is copied from the temporary array back to the arraylet, element by element.

"},{"location":"allocation/#heap-sizing","title":"Heap sizing","text":"

The overall size of the Java heap is determined by two command-line options, -Xms, which sets the initial size of the heap, and -Xmx, which sets the maximum size of the heap. Finer tuning of the heap depends on the heap configuration that is being used by a GC policy. For example, an LOA within the heap can be sized by using the -Xloainitial, -Xloaminimum, and -Xloamaximum command-line options. A nursery area within the heap can be sized by using the -Xmn, -Xmns, and -Xmnx command-line options. For more information about policies and the heap configurations that are used, see GC policies. To determine the values that are in use for the Java heap, use the -verbose:sizes option when you run your Java application.

When the Java heap runs out of space, OutOfMemoryError exceptions are generated. If you are confident that your heap settings are appropriate for your application but are still receiving an OutOfMemoryError exception, check the Java dump file that gets automatically generated when the error occurs. A Java dump file can tell you more about what your application was attempting to do at the time of the error. For example, see the Java OutOfMemoryError scenario.

"},{"location":"allocation/#expansion-and-contraction","title":"Expansion and contraction","text":"

At startup, the VM allocates a single contiguous area of virtual storage to match the value of -Xmx. By default, this is 25% of the available memory up to a maximum of 25 GB. The actual Java heap size starts at the value set by -Xms and expands automatically, as required, up to the maximum heap size. The VM can also contract the size of the Java heap. Expansion and contraction occur as part of a GC cycle when the VM has exclusive access to the heap. The only GC policy that does not support heap expansion and contraction is the metronome GC policy, where the heap is always fully expanded.

Note: On operating systems that support paging, the VM allocates a single contiguous area that matches the value of -Xms. Additional memory is committed as the heap expands by using the paging process.

Expansion occurs to maintain free space on the Java heap for object allocation. By default, the heap is expanded to maintain 30% free space, but this proportion can be adjusted by setting one of the following command-line options:

If expansion is required, the amount of memory that the heap can expand by is controlled by the following command-line options:

Expansion can also be triggered if more time is being spent on GC processing than is specified by the -Xmaxt option. In this case, the heap expands by an amount that provides 17% more free space, within the limits imposed by the -Xmine and -Xmaxe values.

Heap contraction occurs under certain conditions and might be preceded by heap compaction. If the last three GC cycles caused a heap expansion, contraction does not occur. Otherwise, contraction is triggered when the proportion of free heap space that is specified by the -Xmaxf option is reached. The amount of memory to reduce the heap by is calculated to the nearest 1024-byte boundary, down to the minimum size specified for the initial Java heap (-Xms). To prevent heap contraction, set the -Xmaxf value to 1, which sets the maximum free space allowed on the heap to 100%.

When the heap contracts, physical memory is not released unless paging is supported by the underlying operating system.

"},{"location":"allocation/#balanced-gc-policy","title":"balanced GC policy","text":"

For the balanced GC policy, if the -Xminf/-Xmaxf and/or -Xmint/-Xmaxt criteria are not being met and this results in a heap resize, then the heap resize that occurs, happens only on non-eden heap (similar to how these options apply to tenure part for gencon).

The non-eden heap resizing occurs at the end of a GMP cycle, or global collection. At this point, heap resizing decision is made by observing both -Xmint/-Xmaxt and -Xminf/-Xmaxf and comparing them to the appropriate proportion of time spent in GC, and free heap respectively.

If either -Xmint/-Xmaxt and/or -Xminf/-Xmaxf criteria are not being met, there is no guarantee that a heap resize will occur. The heap sizing logic is looking at the following two things:

Since these two criteria may be providing opposite recommendations (for example, lots of free memory, but high % of time in GC) causing oscillations in heap size, the balanced GC heap sizing logic finds a balance between these two criteria.

"},{"location":"allocation/#compressed-references","title":"Compressed references","text":"

On 64-bit systems, the VM can use compressed references to decrease the size of Java objects and make better use of the available space in the Java heap. By storing objects in a 32-bit representation, the object size is identical to that in a 32-bit VM, which creates a smaller memory footprint. These 4 byte (32-bit) compressed references are converted to 64-bit values at runtime with minimal overhead. Smaller objects enable larger heap sizes that result in less frequent garbage collection and improve memory cache utilization. Overall, the performance of 64-bit applications that store compressed rather than uncompressed 64-bit object references is significantly improved.

Compressed references are used by default when the maximum Java heap size is in the range 0 - 57 GB on AIX\u00ae, Linux\u00ae, and Windows\u00ae systems. The upper limit is also 57 GB on z/OS\u00ae systems that have APAR OA49416 installed (25 GB without APAR OA49416). All GC policies observe these limits except for the metronome policy, which can support a heap size of up to 25 GB only with compressed references.

When the VM uses compressed references, classes, threads, and monitors are stored in the lowest 4 GB of address space. However, this area of memory is also used by native libraries, the operating system, and for small Java heaps. If you receive native memory OutOfMemoryError exceptions in the lowest 4 GB when running with compressed references enabled, these errors might result from the lowest 4 GB of address space becoming full. Try specifying a large heap with the -Xmx option, which puts the Java heap into a higher area of address space or using the -Xmcrs option to reserve space in the lowest 4 GB of address space for compressed references.

To turn off compressed references, use the -Xnocompressedrefs command-line option.

"},{"location":"aot/","title":"AOT Compiler","text":""},{"location":"aot/#ahead-of-time-aot-compiler","title":"Ahead-Of-Time (AOT) compiler","text":"

The AOT compiler dynamically compiles Java methods into native AOT code at runtime and stores them in the shared classes cache. This activity enables the VM to start an application faster the next time it runs because it doesn't need to spend time interpreting Java methods. The VM automatically chooses which methods should be AOT-compiled based on heuristics that identify the start-up phase of large applications. AOT code is always used in combination with class data sharing and is enabled automatically when -Xshareclasses is set on the command line. When a cached AOT method is run it might also be optimized further by the Just-In-Time (JIT) compiler.

If you want to turn off AOT compilation and disable the use of AOT-compiled code, set the -Xnoaot suboption. When the AOT compiler is disabled, the JIT compiles frequently used methods into native code. However, because the JIT compiler operates while the application is running, the startup time for an application will increase.

"},{"location":"aot/#see-also","title":"See also","text":""},{"location":"api-conditionhandling/","title":"Condition exception handling","text":""},{"location":"api-conditionhandling/#condition-handling-api-documentation","title":"Condition Handling API documentation","text":""},{"location":"api-cuda/","title":"CUDA4J","text":""},{"location":"api-cuda/#cuda4j-api-documentation","title":"CUDA4J API documentation","text":""},{"location":"api-daa/","title":"Data access acceleration","text":""},{"location":"api-daa/#data-access-acceleration-api-documentation","title":"Data access acceleration API documentation","text":""},{"location":"api-dtfj/","title":"DTFJ","text":""},{"location":"api-dtfj/#dtfj-api-documentation","title":"DTFJ API documentation","text":""},{"location":"api-gpu/","title":"GPU","text":""},{"location":"api-gpu/#gpu-api-documentation","title":"GPU API documentation","text":""},{"location":"api-jdk11/","title":"Java 11 API","text":""},{"location":"api-jdk11/#openj9-jdk-11-api-documentation","title":"OpenJ9 JDK 11 API documentation","text":""},{"location":"api-jdk17/","title":"Java 17 API","text":""},{"location":"api-jdk17/#openj9-jdk-17-api-documentation","title":"OpenJ9 JDK 17 API documentation","text":""},{"location":"api-jdk21/","title":"Java 21 API","text":""},{"location":"api-jdk21/#openj9-jdk-21-api-documentation","title":"OpenJ9 JDK 21 API documentation","text":""},{"location":"api-jdk22/","title":"Java 22 API","text":""},{"location":"api-jdk22/#openj9-jdk-22-api-documentation","title":"OpenJ9 JDK 22 API documentation","text":""},{"location":"api-jvm/","title":"JVM diagnostic utilities","text":""},{"location":"api-jvm/#jvm-diagnostic-utilities-api-documentation","title":"JVM diagnostic utilities API documentation","text":""},{"location":"api-langmgmt/","title":"Monitoring and management","text":""},{"location":"api-langmgmt/#monitoring-and-management-api-documentation","title":"Monitoring and management API documentation","text":""},{"location":"api-overview/","title":"Overview","text":""},{"location":"api-overview/#api-documentation","title":"API documentation","text":"

The Eclipse OpenJ9\u2122 VM provides supplementary application programming interfaces and extensions, which can be used to improve performance, assist with problem determination, or help monitor and manage the OpenJ9 VM. The documentation also includes links to the API documentation for the Java\u2122 SE and JDK reference implementation.

"},{"location":"api-overview/#native-data-operations","title":"Native data operations","text":"

If your Java application manipulates native data, the Data Access Accelerator API package (com.ibm.dataaccess) can help improve application performance. Classes are available for the following types of operation:

"},{"location":"api-overview/#gpu-acceleration","title":"GPU acceleration","text":"

You can improve the performance of your applications by offloading certain processing functions from your processor (CPU) to a graphics processing unit (GPU). If your application contains code that would benefit from parallel processing, you can use the CUDA4J API package (com.ibm.cuda) to specify in your code when to offload processing to the GPU. You can also use the GPU API package (com.ibm.gpu) to accelerate certain Java functions, such as sort operations.

"},{"location":"api-overview/#problem-determination","title":"Problem determination","text":"

The JVM diagnostic utilities API package (com.ibm.jvm) provides classes for controlling dump, log, and trace operations.

The Diagnostic Tool Framework for Java (DTFJ) API packages (com.ibm.dtfj.*) allow custom applications to be written that can access a wide range of information in a system dump or a Java dump.

"},{"location":"api-overview/#monitoring-and-management","title":"Monitoring and management","text":"

The shared classes API package (com.ibm.oti.shared) provides a large number of classes for managing permissions, finding and storing classes and byte data, and obtaining statistics about a shared classes cache. Classes are also available to enable class sharing for a custom class loader implementation.

OpenJ9 includes MXBean extensions to the java.lang.management API (com.ibm.lang.management and openj9.lang.management), which can be used to monitor and manage the VM. These extensions provide access to information about the state of the OpenJ9 VM and the environment in which it is running.

"},{"location":"api-shrc/","title":"Shared classes","text":""},{"location":"api-shrc/#shared-classes-api-documentation","title":"Shared classes API documentation","text":""},{"location":"attachapi/","title":"Java Attach API","text":""},{"location":"attachapi/#java-attach-api","title":"Java Attach API","text":"

With the Attach API, your application can connect to a running VM and load an agent into that VM to run tasks. The typical use case for this feature is to load an agent that can be used to monitor the application that's running in the target VM.

For example, if you wanted to start monitoring an application that is already running with the Attach API enabled, you can use a tool such as the IBM Health Center. In this case, a Health Center agent can start in its own VM and attach to the target VM where the application is running to start recording and sending data to the Health Center client.

The Eclipse OpenJ9\u2122 implementation of the Attach API is equivalent to the reference implementation (API documentation is available on the Oracle website). However, you can use the Attach API only to connect to another OpenJ9 VM.

When you run a Java\u2122 application, VM support for the Attach API is enabled by default on all platforms except z/OS\u00ae. For security reasons on z/OS, processes that use the default z/OS OMVS segment cannot enable the Attach API.

To enable or disable the Attach API, use the -Dcom.ibm.tools.attach.enable=[yes|no] command line option.

"},{"location":"attachapi/#securing-the-attach-api","title":"Securing the Attach API","text":"

Because the Attach API can be used to connect to a running application, you must control access to it to ensure that only authorized users or processes can use it. Disable the Attach API if you do not intend to use it.

If you do not want to disable the Attach API but want to control the unauthorized dynamic loading of agents into the VM by using the Attach API, use the -XX:-EnableDynamicAgentLoading option.

On Windows\u2122 systems, the Attach API uses the system temporary directory, which is typically C:\\Users\\<USERNAME>\\AppData\\Local\\Temp. The Attach API creates a common subdirectory, which is .com_ibm_tools_attach by default. Because files and directories in the system temporary directory are handled by Windows security, only the process owner can connect to their processes.

On UNIX systems, the Attach API uses /tmp and creates a common subdirectory, which is .com_ibm_tools_attach by default. The common subdirectory must be on a local drive, not a network drive. Security is handled by POSIX file permissions. The Attach API directory must be owned by root user and must have read, write, and execute file permissions for user, group, and other (drwxrwxrwx). The sticky bit is set so that only the owner and root can delete or rename files or directories within it. A process that uses the Java Attach API must be owned by the same UNIX user ID as the target process.

~/tmp $ ls -al\ntotal 0\ndrwxr-xr-x   3 user_a staff    96  6 Aug 17:11 .\ndrwxr-xr-x+ 89 user_a staff  2848  6 Aug 17:11 ..\ndrwxrwxrwx+  7 root   staff   224  6 Aug 17:22 .com_ibm_tools_attach\n

In the default Attach API directory, you can find certain files that start with an underscore _*, which are involved in synchronization. By default, any user that has read and write permissions can own these files. The files are empty and are automatically re-created if deleted. A user might interfere with the functioning of the Attach API by modifying the file permissions. To prevent such an interference, you can protect the file permissions by setting root as the owner of the files.

When your application attaches to a VM, a process directory is created.

~/tmp/.com_ibm_tools_attach $ ls -l\ntotal 3\n-rw-rw-rw-  1 user_a  staff    0  6 Aug 17:12 _attach_lock\n-rw-rw-rw-  1 user_a  staff    0  6 Aug 17:12 _controller\n-rw-rw-rw-  1 user_a  staff    0  6 Aug 17:12 _notifier\ndrwx--x--x  6 user_b  staff  192  6 Aug 17:21 process_a\n

The files in the subdirectory for a process, with the exception of a lock file, are accessible only by the owner of a process. The permissions for these files are rwxr-xr-x with the exception of the attachNotificationSync file, as shown in the following example.

~/tmp/.com_ibm_tools_attach/process_a $ ls -l\ntotal 4\n-rwxrw-rw-  1 user_b  staff  0  6 Aug 17:18 attachNotificationSync\n-rwxr-xr-x  1 user_b  staff  0  6 Aug 17:21 file_a\n-rwxr-xr-x  1 user_b  staff  0  6 Aug 17:21 file_b\n-rwxr-xr-x  1 user_b  staff  0  6 Aug 17:21 file_c\n

Notes for z/OS:

"},{"location":"attachapi/#configuring","title":"Configuring","text":"

A number of system properties are available to configure the Attach API when you start a Java application, as shown in the following table:

System property Description -Dcom.ibm.tools.attach.directory=<directory_name> Specify a different common directory for Attach API working files. -Dcom.ibm.tools.attach.displayName=<my_display_name> Change the display name recorded by an agent -Dcom.ibm.tools.attach.id=<my_vm_ID> Change the VM identifier recorded by an agent -Dcom.ibm.tools.attach.timeout=<value_in_milliseconds> Change the connection timeout -Dcom.ibm.tools.attach.shutdown_timeout=<value_in_milliseconds> Specify the timeout for ending the Attach API wait loop thread -Dcom.ibm.tools.attach.command_timeout=<value_in_milliseconds> Specify the timeout for sending a command to the target VM after initial attachment -Dcom.ibm.tools.attach.retry=<number_of_retries> Specify the number of times the jcmd tool retries attaching to a running VM when the tool encounters the SocketException error on Windows platform

To learn more about each property, click the link in the table.

"},{"location":"attachapi/#troubleshooting","title":"Troubleshooting","text":"

Problems with the Attach API generate one of the following exceptions:

Exceptions from agents on the target VM go to stderr or stdout for the target VM. These exceptions are not reported in the output of the attaching VM.

Here are some problems that you might encounter:

If you have checked for these potential issues but you are still experiencing problems, a number of command line system properties are available to help narrow down the cause. These options are shown in the following table:

System property Description -Dcom.ibm.tools.attach.logging=<yes|no> Turn on tracing of attach API events -Dcom.ibm.tools.attach.log.name=<my_log_name> Specify the path and prefix for the log files

To learn more about each property, click the link in the table.

"},{"location":"builds/","title":"OpenJ9 builds","text":""},{"location":"builds/#eclipse-openj9-builds","title":"Eclipse OpenJ9 builds","text":"

Eclipse Foundation projects are not permitted to distribute, market or promote JDK binaries unless they have passed a Java SE Technology Compatibility Kit licensed from Oracle, to which the Eclipse OpenJ9\u2122 project does not currently have access. See the Eclipse Adoptium Project Charter.

"},{"location":"builds/#supported-platforms","title":"Supported platforms","text":"

The community develops and maintains a test infrastructure for the OpenJ9 source across a broad range of platforms. For information about the platforms and minimum operating system levels supported, see the Platform support matrix.

"},{"location":"builds/#building-your-own-binaries","title":"Building your own binaries","text":"

If you want to build your own binaries of OpenJDK with OpenJ9, a complete set of build instructions for several platforms can be found in the OpenJ9 GitHub repository.

"},{"location":"builds/#installation-pre-requisites","title":"Installation pre-requisites","text":"

Note the following:

"},{"location":"cmdline_general/","title":"Standard options","text":""},{"location":"cmdline_general/#standard-command-line-options","title":"Standard command-line options","text":"

The Eclipse OpenJ9\u2122 virtual machine supports the standard Java\u2122 options that are common to all Java virtual machine implementations, including Oracle's HotSpot VM. Some of the common options supported are summarised in the following table:

Standard option name Purpose -classpath:<resource_name>[:<resource_name>] Sets the search path for application classes and resources (directories and compressed or .jar files). cp can be used instead of classpath. -help, -? Prints a usage message. -fullversion Prints the build and version information for a VM -showversion Prints product version and continues. -verbose:<option>[,<option>] Enables verbose output. Options include class, dynload, gc, init, jni, sizes, stack, and module. (See Notes) -version Prints the full build and version information a VM

Notes:

For more information about standard options, see Oracle Java SE Standard Options

"},{"location":"cmdline_general/#openj9-extensions","title":"OpenJ9 extensions","text":"

OpenJ9 supports the following extension to the -verbose option:

"},{"location":"cmdline_migration/","title":"Switching to OpenJ9","text":""},{"location":"cmdline_migration/#switching-to-eclipse-openj9","title":"Switching to Eclipse OpenJ9","text":"

If you are already familiar with HotSpot command-line options but want the advantages of Eclipse OpenJ9\u2122, the following information will prove helpful. In all cases, check individual topics for minor discrepancies in the way these options might work.

Note: For information about HotSpot equivalences and differences for items other than command-line options, see New to Eclipse OpenJ9?

"},{"location":"cmdline_migration/#compatible-options","title":"Compatible options","text":"

You can use the following command-line options in OpenJ9, just as you did in HotSpot; you can continue to use the HotSpot option in OpenJ9 without having to change your code:

Option Usage -X Displays help on nonstandard options. -Xbootclasspath Specifies the search path for bootstrap classes and resources. -Xcheck:jni Runs additional checks for JNI functions during VM startup. -Xfuture Turns on strict class-file format checks. -Xint Runs an application in interpreted-only mode. -Xlog Some forms of -Xlog that enable garbage collection logging are recognized. (Equivalent to -Xverbosegclog). -Xmn Sets the initial and maximum size of the new area when using -Xgcpolicy:gencon. -Xms Sets the initial size of the heap. (Equivalent to -XX:InitialHeapSize) -Xmx Specifies the maximum size of the object memory allocation pool. (Equivalent to -XX:MaxHeapSize) -Xnoclassgc Disables class garbage collection (GC). -Xrs Prevents the OpenJ9 run time environment from handling signals. -Xss Sets the Java\u2122 thread stack size. (Equivalent to -XX:ThreadStackSize). Note: Unlike HotSpot, this option applies only to the Java stack. OpenJ9 has a separate native stack for operating system threads (see -Xmso) -Xverify:mode Enables or disables the verifier. -XX:ConcGCThreads Configures the number of GC mutator background threads. -XX:[+|-]AlwaysPreTouch Enables or disables committing of memory during initial heap inflation or heap expansion. -XX:[+|-]CompactStrings Enables or disables String compression. Note: This option is enabled by default in OpenJ9 on Java 11 and later. In the earlier versions, this option is disabled by default. -XX:DiagnoseSyncOnValueBasedClasses=<number> Configure warnings for value-based classes. -XX:[+|-]DisableExplicitGC Enables or disables explicit System.gc() calls. (Alias for -Xdisableexplicitgc / -Xenableexplicitgc) -XX:[+|-]ExitOnOutOfMemoryError Triggers VM shutdown on out-of-memory conditions. -XX:[+|-]HeapDumpOnOutOfMemory Enables or disables dumps on out-of-memory conditions. -XX:HeapDumpPath Specifies a directory for all VM dumps including heap dumps, javacores, and system dumps. (Alias for -Xdump:directory) -XX:[+|-]IgnoreUnrecognizedVMOptions Specifies whether to ignore unrecognized top-level VM options. -XX:InitialHeapSize Sets the initial size of the heap. (Alias for -Xms) -XX:InitialRAMPercentage Sets the initial size of the Java heap as a percentage of total memory. -XX:MaxDirectMemorySize Sets a limit on the amount of memory that can be reserved for all direct byte buffers. -XX:MaxHeapSize Specifies the maximum size of the object memory allocation pool. (Alias for -Xmx) -XX:MaxRAMPercentage Sets the maximum size of the Java heap as a percentage of total memory. -XX:OnOutOfMemoryError Runs specified commands when a java.lang.OutOfMemoryError is thrown. (Equivalent to -Xdump:tool:events=systhrow,filter=java/lang/OutOfMemoryError,exec=) -XX:ParallelCMSThreads Configures the number of GC mutator background threads. -XX:ParallelGCThreads Configures the number of GC threads. -XX:[+|-]PrintCodeCache Prints code cache usage when the application exits. -XX:[+|-]ShowHiddenFrames Specifies whether generated hidden MethodHandle frames are displayed in a stack trace. Note: Unlike HotSpot, this option doesn't require the +UnlockDiagnosticVMOptions option. -XX:[+|-]UseCompressedOops Disables compressed references in 64-bit JVMs. (See also -Xcompressedrefs) -XX:[+|-]UseContainerSupport Sets a larger fraction of memory to the Java heap when the VM detects that it is running in a container."},{"location":"cmdline_migration/#equivalent-options","title":"Equivalent options","text":"

These HotSpot command-line options have equivalents in OpenJ9 that are not specified in the same way, but perform a related function:

HotSpot Option OpenJ9 Option Usage -Xcomp -Xjit:count=01 -Xcomp disables interpreted method invocations. -Xgc -Xgcpolicy2 Configuring your garbage collection policy. -XX:+UseNUMA -Xnuma:none3 Controls non-uniform memory architecture (NUMA) awareness.

Notes:

  1. HotSpot uses -Xcomp to force compilation of methods on first invocation. However, this option is deprecated. Whilst it can be used for compatibility, using -Xjit:count=0 is preferred.

  2. HotSpot uses -Xgc to both select policies and configure them; OpenJ9 uses -Xgcpolicy to select policies, reserving -Xgc for configuration.

  3. In HotSpot, NUMA awareness is turned off by default and is turned on by using the -XX:+UseNUMA option. Conversely, the OpenJ9 VM automatically enables NUMA awareness and uses -Xnuma:none to turn it off.

"},{"location":"cmdline_migration/#creating-compatible-behavior","title":"Creating compatible behavior","text":"

You can set the following options to make OpenJ9 behave in the same way as HotSpot.

Option Usage -Djava.lang.string.substring.nocopy=true Avoid String sharing by String.substring(). -Xnuma:none Disable non-uniform memory architecture (NUMA) awareness. -XX:[+|-]HandleSIGABRT Force handling of SIGABRT signals to be compatible with HotSpot."},{"location":"cmdline_migration/#compatible-environment-variables","title":"Compatible environment variables","text":"

The JAVA_TOOL_OPTIONS environment variable can be used to set command line options as described in OpenJ9 command-line options and Environment variables.

"},{"location":"cmdline_specifying/","title":"Specifying options","text":""},{"location":"cmdline_specifying/#eclipse-openj9-command-line-options","title":"Eclipse OpenJ9 command-line options","text":"

When you start a Java\u2122 application you can specify various options on the command line to configure the runtime environment. These options include:

Although the command line is the traditional way to specify command-line options, you can also pass options to the Eclipse OpenJ9\u2122 virtual machine (VM) by using a manifest file, options files, and environment variables.

Options specified on the command line override the equivalent environment variables. For example, specifying java -cp <dir1> completely overrides setting the environment variable CLASSPATH=<dir2>.

"},{"location":"cmdline_specifying/#quotation-marks","title":"Quotation marks","text":"

Use single or double quotation marks for command-line options only when explicitly directed to do so. Single and double quotation marks have different meanings on different platforms, operating systems, and shells. Do not use '-X<option>' or \"-X<option>\". Instead, you must use -X<option>. For example, do not use '-Xmx500m' and \"-Xmx500m\". Write this option as -Xmx500m.

"},{"location":"cmdline_specifying/#precedence","title":"Precedence","text":"

The sequence of the Java options on the command line defines which options take precedence during startup. Rightmost options have precedence over leftmost options. In the following example, the -Xjit option takes precedence:

java -Xint -Xjit myClass\n

At startup, the list of VM arguments is constructed in the following order, with the lowest precedence first:

  1. Certain options are created automatically by the VM, which specify arguments such as search paths and version information. The VM automatically adds -Xoptionsfile=<path>/options.default at the beginning of the command line, where <path> is the path to the VM directory.

    You can modify the options.default file to include any options that you want to specify for your application instead of entering these options on the command line. For more information about the path and construction of the file, see -Xoptionsfile.

  2. Options can be specified in an executable JAR file by using the META-INF/MANIFEST.MF file. Options are placed in the main section in a header named IBM-Java-Options. Only one IBM-Java-Options header is permitted, but the header can contain multiple options, separated by spaces. A long sequence of options can be split using a header continuation but are treated as a single line.

    Example manifest file:

    Manifest-Version: 1.0\nClass-Path: .\nMain-Class: HelloWorld\nIBM-Java-Options: -Xshareclasses:name=mycache,nonfa\n tal,cacheDirPerm=1000 -Dproperty=example -Da.long.system.pro\n perty=\"this is a long system property value to\n  demonstrate long VM arguments\n in the manifest file\"\n

    This example manifest file is parsed as the following string:

    -Xshareclasses:name=mycache,nonfatal,cacheDirPerm=1000\n-Dproperty=example\n-Da.long.system.property=this is a long system property value to\ndemonstrate long VM arguments in the manifest file\n

    Options specified in the manifest file are subject to the same restrictions as options files. For more information, see the -Xoptionsfile topic in the user guide.

  3. Environment variables that are described in OpenJ9 environment variables are translated into command-line options. For example, the following environment variable adds the parameter -Xrs to the list of arguments:

  4. The OPENJ9_JAVA_OPTIONS environment variable. You can set command-line options using this environment variable. The options that you specify with this environment variable are added to the command line when a VM starts in that environment. The environment variable can contain multiple blank-delimited argument strings, but must not contain comments. For example:

    Note: The environment variable JAVA_TOOL_OPTIONS is equivalent to OPENJ9_JAVA_OPTIONS and is available for compatibility with JVMTI. The equivalent IBM_JAVA_OPTIONS environment variable is deprecated and will be removed in a future release.

  5. Options that are specified on the command line. For example:

    java -Dmysysprop1=tcpip -Dmysysprop2=wait -Xdisablejavadump MyJavaClass\n

    The Java launcher adds some automatically generated arguments to this list, such as the names of the main class.

  6. The _JAVA_OPTIONS environment variable. You can override previous options using this environment variable. The options that you specify with this environment variable are added to the end of the command line when a VM starts in that environment. The environment variable can contain multiple blank-delimited argument strings, but must not contain comments. For example:

You can also use the -Xoptionsfile parameter to specify VM options. This parameter can be used on the command line, or as part of the OPENJ9_JAVA_OPTIONS environment variable. The contents of an option file are expanded in place during startup. For more information about the structure and contents of this type of file, see -Xoptionsfile.

To troubleshoot startup problems, you can check which options are used by the OpenJ9 VM. Append the following command-line option, and inspect the Java core file that is generated:

-Xdump:java:events=vmstart\n

Here is an extract from a Java core file that shows the options that are used:

    2CIUSERARG               -Xdump:java:file=/home/test_javacore.txt,events=vmstop\n    2CIUSERARG               -Dtest.cmdlineOption=1\n    2CIUSERARG               -XXallowvmshutdown:true\n    2CIUSERARG               -Xoptionsfile=test1.test_options_file\n
"},{"location":"configuring/","title":"Configuring your system","text":""},{"location":"configuring/#configuring-your-system","title":"Configuring your system","text":"

Configuring your local system can help you optimize the runtime environment for your Java application. Options include setting operating system environment variables and configuring system resources so that Eclipse OpenJ9\u2122 can exploit the underlying operating system and hardware capabilities.

When you install a Java\u2122 runtime environment on your system you can set the PATH environment variable so that the operating system can find the Java programs and utilities to run your application. To tell your application where to find user classes, you can use the -cp option or set the CLASSPATH environment variable. However, if you set CLASSPATH globally, all invocations of Java are affected. How to set these environment variables is covered in many publications about Java, such as The Java Tutorials: PATH and CLASSPATH.

On some systems, a further environment variable might be required if your application requires shared libraries but does not specify their exact location. You can set the following environment variables to specify the directory location of the shared libraries, although setting a global value affects all invocations of Java:

Although most Java applications should run without changing anything on the underlying system, a unique pre-requisite exists for AIX systems on OpenJDK version 11 and later; you must have the 16.1 XL C++ Runtime installed.

"},{"location":"configuring/#setting-resource-limits-aix-linux-and-macos","title":"Setting resource limits (AIX, Linux, and macOS)","text":"

The operating system sets resource limits for a shell, and to processes started by the shell, to ensure that a single process cannot consume all available resources. However, these limits can affect certain operations that might need to run for a Java application, such as producing a dump file.

"},{"location":"configuring/#setting-ulimit-values","title":"Setting ulimit values","text":"

Some resource limits are controlled by the ulimit command. A soft limit is the value set by the kernel for a resource and a hard limit imposes a maximum value on the soft limit. A privileged process can change either limit, but an unprivileged process can change only its soft limit (between 0 and the hard limit) or irreversibly lower its hard limit. To see the current limits set for a system, run ulimit -a. The output is similar to the following example:

core file size          (blocks, -c) 0\ndata seg size           (kbytes, -d) unlimited\nfile size               (blocks, -f) unlimited\nmax locked memory       (kbytes, -l) unlimited\nmax memory size         (kbytes, -m) unlimited\nopen files                      (-n) 256\npipe size            (512 bytes, -p) 1\nstack size              (kbytes, -s) 8192\ncpu time               (seconds, -t) unlimited\nmax user processes              (-u) 2784\nvirtual memory          (kbytes, -v) unlimited\n

To show hard limits, use ulimit -Ha.

You can change limits for specific resources on a temporary basis by running the ulimit command. Alternatively, you can store limit settings in a configuration file, which is /etc/security/limits for AIX or etc/security/limits.conf for Linux. For more information about configuring resource limits, refer to the documentation for your operating system.

The main use case for changing ulimit resources is when enabling a system dump to ensure that all the required data can be collected for analysis. For more information, see Enabling a full system dump.

"},{"location":"configuring/#setting-shared-memory-values","title":"Setting shared memory values","text":"

Another use case for changing resource limits is to ensure that there is sufficient shared memory allocated for class data sharing. By default, the shared classes cache consists of memory-mapped files that are created on disk and persist when the system is restarted. If you choose to use non-persistent caches by setting the -Xshareclasses:nonpersistent option, caches are not retained on startup and are allocated by using the System V IPC shared memory mechanism.

Note: The virtual address space of a process is shared between the shared classes cache and the Java heap. Increasing the maximum size for the shared classes cache might reduce the size of the Java heap that you can create.

Shared memory limits are also important when configuring large page memory allocation on Linux systems. For more information, see Configuring large page memory allocation: Linux systems.

"},{"location":"configuring/#setting-resource-limits-zos","title":"Setting resource limits (z/OS)","text":"

Resource limits imposed by z/OS might affect Java operations. To learn how these resource limits are set, see Customizing the BPXPRMxx member of SYS1.PARMLIB.

The OpenJ9 class data sharing feature is implemented by using shared memory segments on z/OS. Special consideration should be given to the following parameters that relate to the shared memory and IPC semaphore settings:

Incorrect or suboptimal settings might prevent shared classes from working or impact performance. By default, the VM attempts to create a 16 MB cache on Java 8 and a 300 MB cache on Java 11 and later. If you set a cache size for your application by specifying the -Xscmx option on the command line, the VM rounds the value up to the nearest megabyte. Ensure that the value set for IPCSHMMPAGES takes this adjustment into consideration.

To see the current settings, enter the following z/OS operator command:

D OMVS,O\n

The suggested minimum values for Java applications are shown in the following table:

Parameter Value MAXPROCSYS 900 MAXPROCUSER 512 MAXUIDS 500 MAXTHREADS 10000 MAXTHREADTASKS 5000 MAXASSIZE 2147483647 MAXCPUTIME 2147483647 MAXMMAPAREA 40960 IPCSHMSPAGES 262144 IPCSHMMPAGES 25600 IPCSHMNSEGS 10 IPCSEMNIDS 500 IPCSEMNSEMS 1000 SHRLIBRGNSIZE 67 108 864

Note: The number of threads that can be created by a Java process is limited by the lower of the two values for MAXTHREADS and MAXTHREADSTASKS.

You can change these settings dynamically without re-IPLing the system. For example, to set MACPROCUSER to 256, run SETOMVS MAXPROCUSER=256

z/OS uses region sizes to determine the amount of storage available to running programs. For a Java runtime environment, the region size must be sufficiently large to avoid storage related error messages or abends. Rather than restricting region size, allow the VM to use what it needs. Region size can be affected by one of the following parameters: JCL REGION, BPXPRMxx MAXASSIZE, the RACF OMVS segment ASSIZEMAX, or IEFUSI (Step initiation exit).

SHRLIBRGNSIZE controls how much storage is reserved in each address space for mapping shared DLLs that have the +l extended attribute set. If this storage space is exceeded, DLLs are loaded into the address space instead of using a single copy of z/OS UNIX System Services storage that is shared between the address spaces. The z/OS command D OMVS,L shows the SHRLIBRGNSIZE size and peak usage. If this size is set to a much higher value than is needed, the Java application might have problems acquiring native storage. These problems can cause a z/OS abend, such as 878-10, or a Java OutOfMemoryError.

"},{"location":"configuring/#configuring-language-environment-runtime-options","title":"Configuring Language Environment runtime options","text":"

Language Environment\u00ae runtime options affect performance and storage usage. These options can be optimized for your application.

Runtime options are typically embedded in programs by using #pragma runopts settings. In many cases, these options provide suitable default values that are known to produce good performance results. However, these options can be overridden to tune the runtime environment of your application.

On 64-bit z/OS systems, the following runtime options affect Java applications:

A suitable MEMLIMIT value is also required. The OpenJ9 VM requirement is the sum of the following amounts:

Note: If you intend to use the Concurrent Scavenge mode of the default Generational Concurrent (gencon) garbage collection policy by using hardware-based support, the virtual storage used might exceed the Java maximum heap size. Set the z/OS memory limit to a larger value than the maximum heap size. For more information, see -Xgc:concurrentScavenge.

The following guides are available to help you configure Language Environment runtime options and callable services:

Warning: Changing the runtime options can often degrade performance.

"},{"location":"configuring/#configuring-large-page-memory-allocation","title":"Configuring large page memory allocation","text":"

If your application allocates a large amount of memory and frequently accesses that memory, you might be able to improve performance by enabling large page support on your system.

Some Linux kernels implement Transparent HugePage Support (THP), which automates the provision of large pages to back virtual memory, as described in Linux systems. Alternatively, you can configure the VM to use large pages (if the large pages support is enabled on the system) by setting the -Xlp:objectheap and -Xlp:codecache options on the command line when you start your application. These options have the following effects:

The process for enabling the large page support differs in different operating systems, as explained in the following sections.

"},{"location":"configuring/#aix-systems","title":"AIX systems","text":"

AIX supports large page sizes of 64 KB and 16 MB, and a huge page size of 16 GB depending on the underlying system P hardware. To determine which page sizes are supported on a particular system, run pagesize -a.

To use large pages to back an application's data and heap segments, specify the LDR_CNTRL environment variable. You can set different page sizes for different purposes. The following variables can be used:

The following example sets 4 KB for text and 64 KB for stack, native data, and heap areas:

LDR_CNTRL=TEXTPSIZE=4K@STACKPSIZE=64K@DATAPSIZE=64K\n

For more information, including support considerations, see Large pages and Multiple page size support in the AIX documentation.

The 16 MB and 16 GB page sizes, which are intended for very high performance environments, require special user permissions. You must also configure the number of pages that you require, which cannot be adjusted on demand. For 16 MB large pages, you set the number of large pages by using the vmo command. For 16 GB huge pages you must define the number of pages by using the hardware management console. For more information, see Page sizes for very high-performance environments in the AIX documentation.

"},{"location":"configuring/#linux-systems","title":"Linux systems","text":"

Large pages are typically referred to as huge pages on Linux systems. To configure huge page memory allocation, the kernel must support huge pages. If huge pages are supported, the following lines are present in the /proc/meminfo file:

HugePages_Total:    \nHugePages_Free:     \nHugepagesize:     \n

If these lines do not exist, update your Linux kernel. If HugePages_Total has a value of 0, huge pages are available, but not enabled. To enable huge pages, add the following line to your /etc/sysctl.conf file and reload the configuration by running sysctl -p:

vm.nr_hugepages=<number>\n

Where <number> is the number of huge pages required.

Configure the number of huge pages that you require at boot time to ensure that the VM has access to sufficient contiguous pages. The following kernel parameters must be set appropriately for your system:

The user running the Java process must either be ROOT or have permissions to use huge pages. For the appropriate permissions, the user must be a member of a group that has its group identifier (gid) stored in /proc/sys/vm/hugetlb_shm_group. The locked memory limit must also be increased to at least the size of the Java heap by using the ulimit -l command.

Where huge page support is available, the following default sizes apply for the object heap:

Transparent HugePage Support (THP) is an automated mechanism of using huge pages to back virtual memory. On Linux kernels that support THP, it is typically enabled by default with the madvise option and can be relied on to provide huge pages as required without any user configuration. To disable THP for your application, use the OpenJ9 -XX:-TransparentHugePage option on the command line. To disable THP system-wide, change the sysfs boot time defaults with the command transparent_hugepage=never. For more information about THP see Transparent HugePage Support.

"},{"location":"configuring/#windows-systems","title":"Windows systems","text":"

On Windows systems, large pages are typically 2 MB in size. To use large pages, the VM user must have the Windows Lock pages in memory setting enabled in the Local Security Policy. Applications must also be run with Admin privileges in order to use large page memory allocations.

For more information, see the following resources from Microsoft:

"},{"location":"configuring/#zos-systems","title":"z/OS systems","text":"

When available, 1 MB pageable pages are the default size for the object heap and the code cache. Other page sizes are available for the object heap, depending on the system architecture as shown in the following table:

Large page size System architecture required -Xlp:codecache -Xlp:objectheap 2 GB nonpageable IBM zEnterprise EC12 processor or later Not supported Supported (64-bit VM only) 1 MB nonpageable System z10 processor or later Not supported Supported (64-bit VM only) 1 MB pageable IBM zEnterprise EC12 processor or later (see Note) Supported Supported

Note: The Flash Express feature (#0402) helps avoid demoting 1 MB pageable pages to 4 KB pages when there is system paging activity.

If a particular page size cannot be allocated, a smaller page size is attempted, in descending order. For example, if 2 GB nonpageable pages are requested but not available, the VM tries to allocate 1MB nonpageable pages. If 1 MB nonpageable pages are not available, the VM tries to allocate 1MB pageable pages. If large pages are not available, 4 KB pages are allocated.

If you want to use nonpageable large pages for the object heap, a system programmer must configure z/OS for nonpageable large pages in the IEASYSxx parmlib member. Users who require large pages must also be authorized to the IARRSM.LRGPAGES resource in the RACF FACILITY class with read authority.

Use the following z/OS system command to show large page usage for an LPAR:

MODIFY AXR,IAXDMEM\n

For more information, see Displaying real storage memory statistics in the z/OS product documentation.

For usage information, including examples, see -Xlp:objectheap.

"},{"location":"configuring/#configuring-dynamic-lpar-support-aix-only","title":"Configuring Dynamic LPAR support (AIX only)","text":"

Dynamic logical partitioning (DLPAR) provides a mechanism to add or remove system resources, such as memory or CPU, to or from the operating system in a logical partition without rebooting. Changing these resources dynamically can have an impact on Java applications that are running on the LPAR.

To enable an application to respond to DLPAR events, you can use OpenJ9 MXBean extensions to the java.lang.management API. The following classes are available in the com.ibm.lang.management package:

These extensions can listen for events and trigger any necessary adjustments to the runtime environment. For example, if a Java VM is running in an LPAR with 2GB of memory, but the available memory might be adjusted between 1GB and 8GB, you might set the following options for the Java heap at run time:

\u2013Xms1g \u2013Xsoftmx2g \u2013Xmx8g\n

This command-line string sets an initial heap size of 1 GB, a soft (adjustable) maximum heap size of 2 GB, and a maximum heap size of 8 GB. You can then use the MemoryMXBean API to dynamically respond to changes in memory resources. The following classes can be used:

For more information about the com.ibm.lang.managment package, which extends the jdk.management module, see the API documentation.

"},{"location":"criusupport/","title":"CRIU support","text":""},{"location":"criusupport/#criu-support","title":"CRIU support","text":"

(Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), Linux on AArch64, and Linux on IBM Z\u00ae only)

Notes:

In OpenJ9, the CRIU support includes an API that you can use to stop the VM at a checkpoint, save its state, and then run the VM from the point where it was stopped. The period of time between when the VM starts and when the application takes a checkpoint is referred to as the checkpoint phase. The application writes the VM state that was saved at the checkpoint to one or more image files. The saved state includes memory pages, methods, file systems, processes, and network connections. You can restore the VM from these files multiple times from the same point and in multiple environments.

Because the checkpoint image files have the live state of the VM that is used to restore the VM in different systems, they should not contain cryptographically-sensitive security data. If the image files contain sensitive security data, the security components are vulnerable to exploitation even if you don't move the image files between systems. The CRIU technical preview introduces the CRIUSECProvider security provider, which provides the following limited set of security services:

When you enable CRIU support, all existing security providers are removed from the security provider list during the checkpoint phase, by default and CRIUSECProvider is added. When you restore the VM in the nonportable restore mode (-XX:+CRIURestoreNonPortableMode), CRIUSECProvider is removed from the security provider list and the previous security providers are added back again.

You can disable CRIUSECProvider during the checkpoint phase with the -XX:-CRIUSecProvider option. For more information, see -XX:[+|-]CRIUSecProvider.

When the VM starts from the saved point instead of the beginning, the VM startup time improves.

"},{"location":"criusupport/#enabling-criu-support","title":"Enabling CRIU support","text":"

CRIU support is not enabled by default. You must enable it by specifying the -XX:+EnableCRIUSupport command-line option when you start your application.

"},{"location":"criusupport/#configuring-criu-support","title":"Configuring CRIU support","text":"

You can access the OpenJ9 CRIU support capabilities by specifying different options. The VM enables the addition of VM options on restore through the CRIUSupport.registerRestoreOptionsFile API and environment variables through the CRIUSupport.registerRestoreEnvVariables API. OPENJ9_RESTORE_JAVA_OPTIONS is a special environment variable for adding the VM options on restore.

There are new options that work at checkpoint as well as at restore and some new options that work at restore only. There are also some existing options that work on restore but some of them behave differently.

"},{"location":"criusupport/#new-options","title":"New options","text":"

You can use the following options only during the checkpoint phase:

You can use the following options only when you restore a VM. If you specify these options when you start the VM (during the checkpoint phase), the VM does not start:

"},{"location":"criusupport/#existing-options","title":"Existing options","text":"

Of the existing command-line options, only the following are supported when you run a restored VM and some of these options have changed behavior:

Options Changed behavior -Xverbosegclog -XcompilationThreads -XsamplingExpirationTime -XX:[+|-]PrintCodeCache -Xtrace If you specify an output file before a checkpoint and another output file for restore, both the files are written according to the -Xtrace options associated with the output file. -Xdump Dump events that are triggered on exception throws or catches cannot be enabled on restore. -Xgcthreads This option is ignored if the number of GC threads is less than the checkpoint GC thread count. -Xjit If -Xint or -Xnoaot and -Xnojit are specified pre-checkpoint, the compiler remains disabled post-restore. -Xaot If -Xnoaot is specified pre-checkpoint, then specifying -Xaot post-restore does not enable AOT compilation or load. -Xjit / -Xaot You can specify the following parameters with the -Xjit and -Xaot options when you run a restored VM:count: Applies only to new methods; existing interpreted methods will not have their counts that are updated. limit, limitFile, exclude: Invalidates the existing compiled methods that do not match the filters. The filters are then enforced for all future JIT and AOT compilations. loadLimit, loadLimitFile, loadExclude: Applies only to future AOT loads; does not impact existing compiled methods. verbose: Effective post-restore; does not override verbose options specified pre-checkpoint. vlog: A vlog file is opened post-restore. If this option was specified pre-checkpoint, the old file is closed first. -Xnoaot Prevents AOT compilations and loads; does not affect the existing compiled methods and does not prevent JIT compilation. -Xnojit Invalidates all existing compiled methods and prevents JIT compilations; does not prevent AOT compilations and loads.

If you specify an unsupported option, the VM throws a JVMRestoreException error by default. If you specify the -XX:+IgnoreUnrecognizedRestoreOptions option, the VM does not throw any exception and just ignores the unsupported option.

For more more information on CRIU support, see the openj9.criu module in your OpenJ9 JDK version (OpenJDK 11 and later) API documentation.

Restrictions:

"},{"location":"criusupport/#see-also","title":"See Also","text":""},{"location":"d_jvm_commands/","title":"Using System properties","text":""},{"location":"d_jvm_commands/#using-system-property-command-line-options","title":"Using system property command-line options","text":"

Java\u2122 system properties determine the environment in which a Java program runs by starting a Java virtual machine with a set of values. You can choose to use the default values for Java system properties or you can specify values for them by adding parameters to the command line when you start your application.

To set a system property from the command line, use:

java -D<property_name>=<value> <program_name>\n

For example, to specify the UTF-8 file encoding for your application MyProgram, use:

java -Dfile.encoding=UTF-8 MyProgram\n
"},{"location":"dcomibmenableclasscaching/","title":"-Dcom.ibm.enableClassCaching","text":""},{"location":"dcomibmenableclasscaching/#-dcomibmenableclasscaching","title":"-Dcom.ibm.enableClassCaching","text":"

Setting this property to true enables caching of the Latest User Defined Class Loader (LUDCL).

"},{"location":"dcomibmenableclasscaching/#syntax","title":"Syntax","text":"
    -Dcom.ibm.enableClassCaching=[true|false]\n
Setting Effect Default true Enable yes false Disable"},{"location":"dcomibmenableclasscaching/#explanation","title":"Explanation","text":"

By reducing repeated lookups, Java\u2122 applications that use deserialization extensively can see a performance improvement.

"},{"location":"dcomibmenableclasscaching/#see-also","title":"See also","text":""},{"location":"dcomibmenablelegacydumpsecurity/","title":"-Dcom.ibm.enableLegacyDumpSecurity","text":""},{"location":"dcomibmenablelegacydumpsecurity/#-dcomibmenablelegacydumpsecurity","title":"-Dcom.ibm.enableLegacyDumpSecurity","text":"

To improve security, the security checks in the certain com.ibm.jvm.Dump APIs are now enabled by default, when the SecurityManager is enabled. Use this system property to turn off security checking for these APIs.

"},{"location":"dcomibmenablelegacydumpsecurity/#syntax","title":"Syntax","text":"
    -Dcom.ibm.enableLegacyDumpSecurity=[true|false]\n
Setting Effect Default true Enable yes false Disable"},{"location":"dcomibmenablelegacydumpsecurity/#explanation","title":"Explanation","text":"

Security checking is enabled in the following APIs:

"},{"location":"dcomibmenablelegacydumpsecurity/#see-also","title":"See also","text":""},{"location":"dcomibmenablelegacylogsecurity/","title":"-Dcom.ibm.enableLegacyLogSecurity","text":""},{"location":"dcomibmenablelegacylogsecurity/#-dcomibmenablelegacylogsecurity","title":"-Dcom.ibm.enableLegacyLogSecurity","text":"

To improve security, the security checks in the certain com.ibm.jvm.Log APIs are now enabled by default, when the SecurityManager is enabled. Use this system property to turn off security checking for these APIs.

"},{"location":"dcomibmenablelegacylogsecurity/#syntax","title":"Syntax","text":"
    -Dcom.ibm.enableLegacyLogSecurity=[true|false]\n
Setting Effect Default true Enable yes false Disable"},{"location":"dcomibmenablelegacylogsecurity/#explanation","title":"Explanation","text":"

Security checking is enabled in the following APIs:

"},{"location":"dcomibmenablelegacylogsecurity/#see-also","title":"See also","text":""},{"location":"dcomibmenablelegacytracesecurity/","title":"-Dcom.ibm.enableLegacyTraceSecurity","text":""},{"location":"dcomibmenablelegacytracesecurity/#-dcomibmenablelegacytracesecurity","title":"-Dcom.ibm.enableLegacyTraceSecurity","text":"

To improve security, the security checks in certain com.ibm.jvm.Trace APIs are now enabled by default, when the SecurityManager is enabled. Use this system property to turn off security checking for these APIs.

"},{"location":"dcomibmenablelegacytracesecurity/#syntax","title":"Syntax","text":"
    -Dcom.ibm.enableLegacyTraceSecurity=[true|false]\n
Setting Effect Default true Enable yes false Disable"},{"location":"dcomibmenablelegacytracesecurity/#explanation","title":"Explanation","text":"

Security checking is enabled in the following APIs:

"},{"location":"dcomibmenablelegacytracesecurity/#see-also","title":"See also","text":""},{"location":"dcomibmgpudisable/","title":"-Dcom.ibm.gpu.disable","text":""},{"location":"dcomibmgpudisable/#-dcomibmgpudisable","title":"-Dcom.ibm.gpu.disable","text":"

Restriction: This system property is supported only on Java\u2122 11 and later.

If you have enabled GPU processing with -Dcom.ibm.gpu.enable, use this system property to turn off processing that can be offloaded to a graphics processing unit (GPU).

"},{"location":"dcomibmgpudisable/#syntax","title":"Syntax","text":"
    -Dcom.ibm.gpu.disable\n
"},{"location":"dcomibmgpudisable/#explanation","title":"Explanation","text":"

Because establishing and completing communication with a GPU incurs an additional overhead, not all processing requirements benefit from being offloaded to the GPU. GPU processing is therefore disabled by default. However, if you have enabled GPU processing with -Dcom.ibm.gpu.enable, this property turns GPU processing off.

"},{"location":"dcomibmgpudisable/#see-also","title":"See also","text":""},{"location":"dcomibmgpuenable/","title":"-Dcom.ibm.gpu.enable","text":""},{"location":"dcomibmgpuenable/#-dcomibmgpuenable","title":"-Dcom.ibm.gpu.enable","text":"

Restriction: This system property is supported only on Java\u2122 11 and later.

Use this system property to control the type of processing that can be offloaded to a graphics processing unit (GPU) when processing requirements meet a specific threshold. This feature can improve the performance of certain Java functions.

"},{"location":"dcomibmgpuenable/#syntax","title":"Syntax","text":"
    -Dcom.ibm.gpu.enable=[all|sort]\n
Setting Effect all Turns on GPU processing for all possible Java functions. sort Turns on GPU processing only for the Java sort() function.

By default, this property is not set.

"},{"location":"dcomibmgpuenable/#explanation","title":"Explanation","text":"

Because establishing and completing communication with a GPU incurs an additional overhead, not all processing requirements benefit from being offloaded to the GPU. When set, this property enables GPU processing for any array that meets a minimum size.

"},{"location":"dcomibmgpuenable/#see-also","title":"See also","text":""},{"location":"dcomibmgpuverbose/","title":"-Dcom.ibm.gpu.verbose","text":""},{"location":"dcomibmgpuverbose/#-dcomibmgpuverbose","title":"-Dcom.ibm.gpu.verbose","text":"

Restriction: This system property is supported only on Java\u2122 11 and later.

This system property can be used to help identify problems with graphics processing unit (GPU) processing.

"},{"location":"dcomibmgpuverbose/#syntax","title":"Syntax","text":"
    -Dcom.ibm.gpu.verbose\n

This property is not set by default.

"},{"location":"dcomibmgpuverbose/#explanation","title":"Explanation","text":"

When specified, this option generates verbose output to STDOUT, which can be piped to a file.

"},{"location":"dcomibmgpuverbose/#see-also","title":"See also","text":""},{"location":"dcomibmlangmanagementosmxbeaniscputime100ns/","title":"-Dcom.ibm.lang.management.OperatingSystemMXBean.isCpuTime100ns","text":""},{"location":"dcomibmlangmanagementosmxbeaniscputime100ns/#-dcomibmlangmanagementoperatingsystemmxbeaniscputime100ns","title":"-Dcom.ibm.lang.management.OperatingSystemMXBean.isCpuTime100ns","text":"

Changes the unit of the return value of the OperatingSystemMXBean.getProcessCpuTime() method.

"},{"location":"dcomibmlangmanagementosmxbeaniscputime100ns/#syntax","title":"Syntax","text":"
    -Dcom.ibm.lang.management.OperatingSystemMXBean.isCpuTime100ns=[true|false]\n
Setting Effect Default true Enable false Disable yes"},{"location":"dcomibmlangmanagementosmxbeaniscputime100ns/#explanation","title":"Explanation","text":"

The Oracle java.lang.management package includes MBean categories such as Memory, OperatingSystem, and GarbageCollector. The Eclipse OpenJ9\u2122 VM provides additional MXBeans to extend the monitoring and management capabilities. For example, the OperatingSystemMXBean, which monitors operating system settings such as physical and virtual memory size, processor capacity, and processor utilization.

The OperatingSystemMXBean.getProcessCpuTime() method returns a value in nanoseconds (10-9 s), for compatibility with the com.sun.management.OperatingSystemMXBean and UnixOperatingSystemMXBean interfaces.

In earlier VM releases, the return value was in hundreds of nanoseconds. If you want to revert to this behavior, set the -Dcom.ibm.lang.management.OperatingSystemMXBean.isCpuTime100ns property to true.

The default value for this property is false.

"},{"location":"dcomibmlangmanagementosmxbeaniscputime100ns/#see-also","title":"See also","text":""},{"location":"dcomibmlangmanagementverbose/","title":"-Dcom.ibm.lang.management.verbose","text":""},{"location":"dcomibmlangmanagementverbose/#-dcomibmlangmanagementverbose","title":"-Dcom.ibm.lang.management.verbose","text":"

Enables verbose information from java.lang.management operations to be written to the output channel during VM operations.

"},{"location":"dcomibmlangmanagementverbose/#syntax","title":"Syntax","text":"
    -Dcom.ibm.lang.management.verbose\n

There are no options for this system property.

"},{"location":"dcomibmotisharedsharedclassglobalfilterclass/","title":"-Dcom.ibm.oti.shared.SharedClassGlobalFilterClass","text":""},{"location":"dcomibmotisharedsharedclassglobalfilterclass/#-dcomibmotisharedsharedclassglobalfilterclass","title":"-Dcom.ibm.oti.shared.SharedClassGlobalFilterClass","text":"

This system property applies a global filter to all non-bootstrap class loaders that share classes.

"},{"location":"dcomibmotisharedsharedclassglobalfilterclass/#syntax","title":"Syntax","text":"
    -Dcom.ibm.oti.shared.SharedClassGlobalFilterClass=<filter_class_name>\n

This property is not set by default.

"},{"location":"dcomibmotisharedsharedclassglobalfilterclass/#explanation","title":"Explanation","text":"

A filter can be used to decide which classes are found and stored by a custom class loader in a shared classes cache. The filter is applied to a particular package by implementing the SharedClassFilter interface.

"},{"location":"dcomibmotisharedsharedclassglobalfilterclass/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachcommand_timeout/","title":"-Dcom.ibm.tools.attach.command_timeout","text":""},{"location":"dcomibmtoolsattachcommand_timeout/#-dcomibmtoolsattachcommand_timeout","title":"-Dcom.ibm.tools.attach.command_timeout","text":"

Specify the timeout for sending a command to the target VM after the initial attachment.

"},{"location":"dcomibmtoolsattachcommand_timeout/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.command_timeout=<ms>\n
Setting Value Default <ms> [1 millisecond or greater] 0 milliseconds (no timeout)"},{"location":"dcomibmtoolsattachcommand_timeout/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachdirectory/","title":"-Dcom.ibm.tools.attach.directory","text":""},{"location":"dcomibmtoolsattachdirectory/#-dcomibmtoolsattachdirectory","title":"-Dcom.ibm.tools.attach.directory","text":"

Specify a different common directory for Attach API working files.

"},{"location":"dcomibmtoolsattachdirectory/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.directory=<directory_name>\n
Setting Value Default <directory_name> [string] .com_ibm_tools_attach

To change the value for directory_name, specify a different directory name. If the directory does not exist, it is created. However, if a parent directory is specified, it must exist. The common directory must be on a local drive, not a network drive.

"},{"location":"dcomibmtoolsattachdirectory/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachdisplayname/","title":"-Dcom.ibm.tools.attach.displayName","text":""},{"location":"dcomibmtoolsattachdisplayname/#-dcomibmtoolsattachdisplayname","title":"-Dcom.ibm.tools.attach.displayName","text":"

Change the default display name for the target virtual machine.

"},{"location":"dcomibmtoolsattachdisplayname/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.displayName=<my_display_name>\n
Setting Value <my_display_name> [string]

To change the value for <my_display_name> that is recorded by an agent, enter a character string of your choice.

If the display name is not set through the -Dcom.ibm.tools.attach.displayName system property, then the main class name along with the application arguments is set as the default display name. For more information, see Java diagnostic command (jcmd) tool.

"},{"location":"dcomibmtoolsattachdisplayname/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachenable/","title":"-Dcom.ibm.tools.attach.enable","text":""},{"location":"dcomibmtoolsattachenable/#-dcomibmtoolsattachenable","title":"-Dcom.ibm.tools.attach.enable","text":"

Enable the Attach API for this application.

"},{"location":"dcomibmtoolsattachenable/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.enable=[yes|no]\n

On AIX\u00ae, Linux\u00ae, macOS\u00ae, and Windows\u2122 systems, the following default applies:

Value Effect Default yes Enable yes no Disable

On z/OS\u00ae systems, the following default applies:

Value Effect Default yes Enable no Disable yes"},{"location":"dcomibmtoolsattachenable/#explanation","title":"Explanation","text":"

A useful reference for information about the Java\u2122 Attach API can be found at http://docs.oracle.com/javase/8/docs/technotes/guides/attach/index.html. The following extract is taken from the Oracle documentation:

The Attach API is an extension that provides a mechanism to attach to a Java virtual machine. A tool written in the Java Language, uses this API to attach to a target virtual machine and load its tool agent into that virtual machine.

A usage example is to late attach the IBM\u00ae Health Center agent to a virtual machine (VM) that is already running.

The Eclipse OpenJ9\u2122 implementation of the Attach API is equivalent to the Oracle implementation. However, the OpenJ9 implementation cannot be used to attach to, or accept attach requests from, other VM implementations.

"},{"location":"dcomibmtoolsattachenable/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachfileaccessupdatetime/","title":"-Dcom.ibm.tools.attach.fileAccessUpdateTime","text":""},{"location":"dcomibmtoolsattachfileaccessupdatetime/#-dcomibmtoolsattachfileaccessupdatetime","title":"-Dcom.ibm.tools.attach.fileAccessUpdateTime","text":"

Linux\u00ae only

This option enables Attach API to update the control file access times at specific intervals, for long-running applications.

"},{"location":"dcomibmtoolsattachfileaccessupdatetime/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.fileAccessUpdateTime=<sleep days>\n

where <sleep days> is the number of interval days after which Attach API updates the control file access times for long-running applications. The default value for <sleep days> is 8.

"},{"location":"dcomibmtoolsattachfileaccessupdatetime/#explanation","title":"Explanation","text":"

By default, the Attach API of a VM places its control files in the system temporary directory, /tmp/.com_ibm_tools_attach. The long-running Attach API uses the control files to operate. But, the VM does not open, modify, or read from these files after the files are created, if there is no attempt to attach to a target VM.

This causes a problem in Linux environments because by default systemd-tmpfiles automatically deletes all files and directories that are stored in the /tmp/ folder that are not changed or read within a specific time period. By default, the files in the /tmp/ folder are cleaned up after 10 days by systemd-tmpfiles.

You can prevent Linux systemd-tmpfiles from deleting the Attach API control files within the /tmp/ folder with the -Dcom.ibm.tools.attach.fileAccessUpdateTime system property. You can specify the interval days after which Attach API updates the control file access times with the -Dcom.ibm.tools.attach.fileAccessUpdateTime system property.

If 0 is specified as the number of <sleep days>, the control file access times are not updated and if systemd-tmpfiles is enabled, it deletes the files in the /tmp/ folder.

You can specify a different location outside of the /tmp/ folder to place the Attach API control files with the -Dcom.ibm.tools.attach.directory system property, if you do not want to use the -Dcom.ibm.tools.attach.fileAccessUpdateTime system property.

"},{"location":"dcomibmtoolsattachfileaccessupdatetime/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachid/","title":"-Dcom.ibm.tools.attach.id","text":""},{"location":"dcomibmtoolsattachid/#-dcomibmtoolsattachid","title":"-Dcom.ibm.tools.attach.id","text":"

Specify a different virtual machine (VM) identifier.

"},{"location":"dcomibmtoolsattachid/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.id=<my_vm_ID>\n
Setting Value Default <my_vm_ID> [string] Target VM process ID

To change the VM identifier recorded by an agent, change the value for <my_vm_ID>. The string must start with an alphabetic character. The remaining characters must be alphanumeric or underscore. Case-sensitivity is system dependent. If the VM identifier is already in use, the attach API modifies it to create a unique value.

"},{"location":"dcomibmtoolsattachid/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachlogging/","title":"-Dcom.ibm.tools.attach.logging","text":""},{"location":"dcomibmtoolsattachlogging/#-dcomibmtoolsattachlogging","title":"-Dcom.ibm.tools.attach.logging","text":"

Enable logging for Attach API events.

"},{"location":"dcomibmtoolsattachlogging/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.logging=[yes|no]\n
Value Effect Default yes Enable no Disable yes"},{"location":"dcomibmtoolsattachlogging/#explanation","title":"Explanation","text":"

Turn on tracing and logging of Attach API events to help diagnose problems. One timestamped log file is created for each Java\u2122 process in the current directory for the running JVM .

"},{"location":"dcomibmtoolsattachlogging/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachlogname/","title":"-Dcom.ibm.tools.attach.log.name","text":""},{"location":"dcomibmtoolsattachlogname/#-dcomibmtoolsattachlogname","title":"-Dcom.ibm.tools.attach.log.name","text":"

Specify the path and prefix for the log files.

"},{"location":"dcomibmtoolsattachlogname/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.log.name=<path/prefix>\n
Setting Value Default <path/prefix> [string] VM process directory

By default, when -Dcom.ibm.tools.attach.logging=true is set, timestamped log files are written to the current directory for the running VM. Use the -Dcom.ibm.tools.attach.log.name option to change the path and prefix for the logfiles.

"},{"location":"dcomibmtoolsattachlogname/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachretry/","title":"-Dcom.ibm.tools.attach.retry","text":""},{"location":"dcomibmtoolsattachretry/#-dcomibmtoolsattachretry","title":"-Dcom.ibm.tools.attach.retry","text":"

Windows\u2122 only

This option specifies the number of times the jcmd tool retries attaching to a running VM when the tool encounters the SocketException error.

"},{"location":"dcomibmtoolsattachretry/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.retry=<number_of_retries>\n

The default value for <number_of_retries> is 3.

"},{"location":"dcomibmtoolsattachretry/#explanation","title":"Explanation","text":"

When the jcmd tool sends a command to a running VM, the command might throw the Socket Exception error in case of issues, such as a network failure or a connection reset. Instead of failing the attaching request, you can specify the number of times the tool retries attaching to the target VM with the -Dcom.ibm.tools.attach.retry system property.

"},{"location":"dcomibmtoolsattachretry/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachshutdown_timeout/","title":"-Dcom.ibm.tools.attach.shutdown_timeout","text":""},{"location":"dcomibmtoolsattachshutdown_timeout/#-dcomibmtoolsattachshutdown_timeout","title":"-Dcom.ibm.tools.attach.shutdown_timeout","text":"

Specify a timeout before ending the Attach API wait loop thread.

"},{"location":"dcomibmtoolsattachshutdown_timeout/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.shutdown_timeout=<ms>\n
Setting Value Default <ms> [1 millisecond or greater] 10000 milliseconds (10 seconds)"},{"location":"dcomibmtoolsattachshutdown_timeout/#see-also","title":"See also","text":""},{"location":"dcomibmtoolsattachtimeout/","title":"-Dcom.ibm.tools.attach.timeout","text":""},{"location":"dcomibmtoolsattachtimeout/#-dcomibmtoolsattachtimeout","title":"-Dcom.ibm.tools.attach.timeout","text":"

Specify a time that an application should wait when attempting to connect to a target virtual machine (VM) before ending.

"},{"location":"dcomibmtoolsattachtimeout/#syntax","title":"Syntax","text":"
    -Dcom.ibm.tools.attach.timeout=<ms>\n
Setting Value Default <ms> [501 milliseconds or greater] 120000 milliseconds (120 seconds)

If you specify a value of 500 milliseconds or lower, no connection attempt is made.

"},{"location":"dcomibmtoolsattachtimeout/#example","title":"Example","text":"

To timeout after 60 seconds, specify:

-Dcom.ibm.tools.attach.timeout=60000

"},{"location":"dcomibmtoolsattachtimeout/#see-also","title":"See also","text":""},{"location":"dfileencoding/","title":"-Dfile.encoding","text":""},{"location":"dfileencoding/#-dfileencoding","title":"-Dfile.encoding","text":"

Use this OpenJDK property to define the file encoding that is required.

"},{"location":"dfileencoding/#syntax","title":"Syntax","text":"
    -Dfile.encoding=<value>\n
Setting Value Default <value> [string] Unicode 3.0 standards where <value> defines the file encoding that is required."},{"location":"dfileencoding/#explanation","title":"Explanation","text":"

By default the GBK converter follows Unicode 3.0 standards. To force the GBK converter to follow Unicode 2.0 standards, use a value of bestfit936.

"},{"location":"diag_overview/","title":"Overview","text":""},{"location":"diag_overview/#diagnostic-data-and-tooling","title":"Diagnostic data and tooling","text":"

Eclipse OpenJ9\u2122 contains a broad range of diagnostic capabilities to help identify, isolate, and solve run time problems. These capabilities include dump files, verbose logs, and trace files, which are supported by a variety of diagnostic tools and interfaces.

"},{"location":"diag_overview/#dumps","title":"Dumps","text":"

Various types of dumps are produced by default in response to certain events, such as a GPF fault or an OutOfMemoryError exception. You can also trigger the production of dumps by using the com.ibm.jvm.Dump API or by specifying -Xdump options on the command line.

All dumps are produced by dump agents, which are initialized when the OpenJ9 VM starts. Different dumps target different areas of the runtime environment. If you want to generate a dump to diagnose a particular type of problem, you need to understand what data the dump will provide. The following dumps are typically used for problem diagnosis:

Other types of dump include binary JIT dumps, stack dumps, and snap dumps. For a complete list of dump agents and the diagnostic data they produce, see Dump agents.

"},{"location":"diag_overview/#verbose-log-files","title":"Verbose log files","text":"

Some components of OpenJ9 can also produce verbose output or log files to assist with problem determination.

"},{"location":"diag_overview/#trace-files","title":"Trace files","text":"

The OpenJ9 trace facility can be used to trace applications, Java methods, or internal JVM operations with minimal impact on performance. Trace is configured by using the -Xtrace command line option, which allows you to control what is traced and when.

Trace data is produced in binary format and must be processed by the OpenJ9 trace formatter to convert it to a readable form. For more information, see Trace formatter.

"},{"location":"diag_overview/#diagnostic-tools","title":"Diagnostic tools","text":"

A number of diagnostic tools are available with OpenJ9 to assist with the analysis of dump and trace files.

"},{"location":"diag_overview/#dump-extractor","title":"Dump extractor","text":"

The dump extractor (jpackcore) supports a full analysis of core files on specific platforms by collecting key files from a system and packaging them into an archive along with a core dump. This archive file is extremely useful when reporting issues to the OpenJ9 community, helping to ensure a faster analysis and turnaround. For more information, see Dump extractor.

"},{"location":"diag_overview/#dump-viewer","title":"Dump viewer","text":"

Because system dumps are binary files, OpenJ9 provides a dump viewer tool (jdmpview) to analyze the contents. This tool can work with dumps from any platforms independently of a system debugger. For more information, see Dump viewer.

"},{"location":"diag_overview/#trace-formatter","title":"Trace formatter","text":"

The trace formatter tool converts binary trace point data in a trace file into a readable format for analysis. For more information, see Trace formatter.

"},{"location":"diag_overview/#option-builder","title":"Option builder","text":"

OpenJ9 contains an extensive set of command-line options to assist with problem diagnosis. Certain options are complex, containing many sub-options with numerous parameters. Whilst these offer a great degree of flexibility, the syntax can be difficult to construct. Option builder tools are available that provide a simple graphical user interface to help you construct your command-line argument. For more information, see Option builder.

"},{"location":"diag_overview/#hotspot-compatible-tools","title":"HotSpot-compatible tools","text":"

A number of tools are available for compatibility with the reference implementation. These tools are independently implemented by OpenJ9 but have similar functions, allowing users to migrate more easily. The available tools are listed in the Tools section.

Note: If you are already familiar with tools that are provided with HotSpot, see Switching to OpenJ9, which explains some of the differences you might encounter when using OpenJ9.

"},{"location":"diag_overview/#eclipse-marketplace-tools","title":"Eclipse marketplace tools","text":"

OpenJ9 provides support for a number of monitoring and diagnostic tools that can be found in the Eclipse marketplace. Each tool provides a graphical user interface to help you visualize data and, in some cases, can provide tuning or debugging recommendations.

If you are familiar with using HotSpot as part of an Oracle JDK or OpenJDK, the Java VisualVM utility is functionally similar to Health Center.

"},{"location":"diag_overview/#interfaces","title":"Interfaces","text":""},{"location":"diag_overview/#jvm-tool-interface-jvmti","title":"JVM tool interface (JVMTI)","text":"

OpenJ9 supports the Java Virtual Machine Tool Interface (JVMTI) and provides extensions that allow JVMTI tools to obtain diagnostic information or trigger diagnostic operations in the VM. For more information, see Java Virtual Machine Tool Interface.

"},{"location":"diag_overview/#dtfj-interface","title":"DTFJ Interface","text":"

OpenJ9 includes the Diagnostic Tool Framework for Java (DTFJ) API. Custom applications can be written that use this API to access a wide range of information in a system dump or a Java dump. DTFJ can be used with the Eclipse Memory Analyzer tool (MAT) to examine the Java object heap for memory leaks and to reduce memory consumption. For more information, see Diagnostic Tool Framework for Java.

"},{"location":"diag_overview/#language-management-interface","title":"Language Management interface","text":"

OpenJ9 provides MXBean additions and extensions to the standard java.lang.management API, which enables you to use tools such as JConsole to monitor and manage your Java applications. For more information, see Language management interface.

"},{"location":"diag_overview/#jpda-tools","title":"JPDA tools","text":"

OpenJ9 is compliant with the Java Platform Debugging Architecture (JPDA), which means you can use any JPDA tool for diagnosis, including Eclipse JDT Debug.

"},{"location":"djavacompiler/","title":"-Djava.compiler","text":""},{"location":"djavacompiler/#-djavacompiler","title":"-Djava.compiler","text":"

This Oracle HotSpot property is used for loading a JIT compiler from a named, native library. This option can be used on the command line to specify the JIT compiler for the Eclipse OpenJ9\u2122 VM.

"},{"location":"djavacompiler/#syntax","title":"Syntax","text":"
    -Djava.compiler=j9jit29\n
"},{"location":"djavalangstringbuffergrowaggressively/","title":"-Djava.lang.stringBuffer.growAggressively","text":""},{"location":"djavalangstringbuffergrowaggressively/#-djavalangstringbuffergrowaggressively","title":"-Djava.lang.stringBuffer.growAggressively","text":"

Restriction: This system property is supported only on Java\u2122 8.

Setting this property to false reverts to the behavior (Eclipse OpenJ9\u2122 0.18 and earlier) of growing a 1 G char[] or larger StringBuffer or StringBuilder only as much as necessary to accommodate the String being added. The default behavior is to immediately grow to the maximum possible size, similarly to Java 11 and later. The default behavior is compatible with the Oracle HotSpot VM.

"},{"location":"djavalangstringbuffergrowaggressively/#syntax","title":"Syntax","text":"
    -Djava.lang.stringBufferAndBuilder.growAggressively=[true|false]\n
Setting Effect Default true Above 1 G, grow to the maximum size yes false Above 1 G, grow only as required"},{"location":"djavalangstringsubstringnocopy/","title":"-Djava.lang.string.substring.nocopy","text":""},{"location":"djavalangstringsubstringnocopy/#-djavalangstringsubstringnocopy","title":"-Djava.lang.string.substring.nocopy","text":"

Restriction: This system property is supported only on Java\u2122 8. String sharing cannot be enabled on Java 11 and later.

Setting this property to true avoids sharing a String object when substring() is used to subset a String beginning from offset zero. Avoiding sharing is compatible with the Oracle HotSpot VM.

"},{"location":"djavalangstringsubstringnocopy/#syntax","title":"Syntax","text":"
    -Djava.lang.string.substring.nocopy=[true|false]\n
Setting Effect Default true No sharing false Sharing yes"},{"location":"djdknativecbc/","title":"-Djdk.nativeCBC","text":""},{"location":"djdknativecbc/#-djdknativecbc","title":"-Djdk.nativeCBC","text":"

This option enables or disables OpenSSL native cryptographic support for the CBC algorithm.

"},{"location":"djdknativecbc/#syntax","title":"Syntax","text":"
    -Djdk.nativeCBC=[true|false]\n
Setting value Default -Djdk.nativeCBC true yes -Djdk.nativeCBC false"},{"location":"djdknativecbc/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the CBC algorithm. If you want to turn off this algorithm only, set this option to false. To turn off all the algorithms, see the -Djdk.nativeCrypto system property command line option.

"},{"location":"djdknativechacha20/","title":"-Djdk.nativeChaCha20","text":""},{"location":"djdknativechacha20/#-djdknativechacha20","title":"-Djdk.nativeChaCha20","text":"

This option enables or disables OpenSSL native cryptographic support for the ChaCha20 and ChaCha20-Poly1305 algorithms.

Restrictions:

"},{"location":"djdknativechacha20/#syntax","title":"Syntax","text":"
    -Djdk.nativeChaCha20=[true|false]\n
Setting value Default -Djdk.nativeChaCha20 true yes -Djdk.nativeChaCha20 false"},{"location":"djdknativechacha20/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the ChaCha20 and ChaCha20-Poly1305 algorithms. If you want to turn off support for these algorithms only, set this option to false. To turn off support for these and other algorithms, see the -Djdk.nativeCrypto system property command line option.

"},{"location":"djdknativecrypto/","title":"-Djdk.nativeCrypto","text":""},{"location":"djdknativecrypto/#-djdknativecrypto","title":"-Djdk.nativeCrypto","text":"

This option controls the use of OpenSSL native cryptographic support.

"},{"location":"djdknativecrypto/#syntax","title":"Syntax","text":"
    -Djdk.nativeCrypto=[true|false]\n
Setting value Default -Djdk.nativeCrypto true yes -Djdk.nativeCrypto false"},{"location":"djdknativecrypto/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the following algorithms:

If you want to turn off the OpenSSL implementation, set the -Djdk.nativeCrypto option to false.

Restrictions:

If you want to turn off the algorithms individually, use the following system properties:

"},{"location":"djdknativedigest/","title":"-Djdk.nativeDigest","text":""},{"location":"djdknativedigest/#-djdknativedigest","title":"-Djdk.nativeDigest","text":"

This option enables or disables OpenSSL native cryptographic support for the MD5, SHA-224, SHA-256, SHA-384, and SHA-512 digest algorithms.

"},{"location":"djdknativedigest/#syntax","title":"Syntax","text":"
    -Djdk.nativeDigest=[true|false]\n
Setting value Default -Djdk.nativeDigest true yes -Djdk.nativeDigest false"},{"location":"djdknativedigest/#explanation","title":"Explanation","text":"

To turn off all the algorithms, see the -Djdk.nativeCrypto system property command-line option.

Note: The MD5 digest algorithm is not supported for OpenSSL on AIX\u00ae. The Java implementation is always used for the MD5 digest algorithm on AIX.

"},{"location":"djdknativeec/","title":"-Djdk.nativeEC","text":""},{"location":"djdknativeec/#-djdknativeec","title":"-Djdk.nativeEC","text":"

This option enables or disables OpenSSL native cryptographic support for the ECDH key agreement algorithm.

"},{"location":"djdknativeec/#syntax","title":"Syntax","text":"
    -Djdk.nativeEC=[true|false]\n
Setting value Default -Djdk.nativeEC true yes -Djdk.nativeEC false"},{"location":"djdknativeec/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the ECDH key agreement algorithm. If you want to turn off support for this algorithm only, set this option to false. To turn off support for this and other algorithms, see the -Djdk.nativeCrypto system property command line option.

"},{"location":"djdknativeeckeygen/","title":"-Djdk.nativeECKeyGen","text":""},{"location":"djdknativeeckeygen/#-djdknativeeckeygen","title":"-Djdk.nativeECKeyGen","text":"

This option enables or disables OpenSSL native cryptographic support for the EC key generation algorithm.

"},{"location":"djdknativeeckeygen/#syntax","title":"Syntax","text":"
    -Djdk.nativeECKeyGen=[true|false]\n
Setting value Default -Djdk.nativeECKeyGen true yes -Djdk.nativeECKeyGen false"},{"location":"djdknativeeckeygen/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the EC key generation algorithm. If you want to turn off support for this algorithm only, set this option to false. To turn off support for this and other algorithms, see the -Djdk.nativeCrypto system property command line option.

Note: The EC key generation algorithm is not supported for OpenSSL on AIX\u00ae. This option is ignored on AIX and the Java implementation is always used.

"},{"location":"djdknativegcm/","title":"-Djdk.nativeGCM","text":""},{"location":"djdknativegcm/#-djdknativegcm","title":"-Djdk.nativeGCM","text":"

This option enables or disables OpenSSL native cryptographic support for the GCM algorithm.

"},{"location":"djdknativegcm/#syntax","title":"Syntax","text":"
    -Djdk.nativeGCM=[true|false]\n
Setting value Default -Djdk.nativeGCM true yes -Djdk.nativeGCM false"},{"location":"djdknativegcm/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the GCM algorithm. If you want to turn off this algorithm only, set this option to false. To turn off all the algorithms, see the -Djdk.nativeCrypto system property command line option.

"},{"location":"djdknativersa/","title":"-Djdk.nativeRSA","text":""},{"location":"djdknativersa/#-djdknativersa","title":"-Djdk.nativeRSA","text":"

This option enables or disables OpenSSL native cryptographic support for the RSA algorithm.

"},{"location":"djdknativersa/#syntax","title":"Syntax","text":"
    -Djdk.nativeRSA=[true|false]\n
Setting value Default -Djdk.nativeRSA true yes -Djdk.nativeRSA false"},{"location":"djdknativersa/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the RSA algorithm. If you want to turn off support for this algorithm only, set this option to false. To turn off all the algorithms, see the -Djdk.nativeCrypto system property command line option.

"},{"location":"djdknativexdhkeyagreement/","title":"-Djdk.nativeXDHKeyAgreement","text":""},{"location":"djdknativexdhkeyagreement/#-djdknativexdhkeyagreement","title":"-Djdk.nativeXDHKeyAgreement","text":"

This option enables or disables OpenSSL native cryptographic support for the XDH key agreement algorithm.

Restrictions:

"},{"location":"djdknativexdhkeyagreement/#syntax","title":"Syntax","text":"
    -Djdk.nativeXDHKeyAgreement=[true|false]\n
Setting value Default -Djdk.nativeXDHKeyAgreement true yes -Djdk.nativeXDHKeyAgreement false"},{"location":"djdknativexdhkeyagreement/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the XDH key agreement algorithm. If you want to turn off support for this algorithm only, set this option to false. To turn off support for this and other algorithms, see the -Djdk.nativeCrypto system property command line option.

Note: The XDH key agreement algorithm is not supported for OpenSSL on AIX\u00ae. This option is ignored on AIX and the Java implementation is always used.

"},{"location":"djdknativexdhkeygen/","title":"-Djdk.nativeXDHKeyGen","text":""},{"location":"djdknativexdhkeygen/#-djdknativexdhkeygen","title":"-Djdk.nativeXDHKeyGen","text":"

This option enables or disables OpenSSL native cryptographic support for the XDH key generation algorithm.

Restrictions:

"},{"location":"djdknativexdhkeygen/#syntax","title":"Syntax","text":"
    -Djdk.nativeXDHKeyGen=[true|false]\n
Setting value Default -Djdk.nativeXDHKeyGen true yes -Djdk.nativeXDHKeyGen false"},{"location":"djdknativexdhkeygen/#explanation","title":"Explanation","text":"

OpenSSL support is enabled by default for the XDH key generation algorithm. If you want to turn off support for this algorithm only, set this option to false. To turn off support for this and other algorithms, see the -Djdk.nativeCrypto system property command line option.

Note: The XDH key generation algorithm is not supported for OpenSSL on AIX\u00ae. This option is ignored on AIX and the Java implementation is always used.

"},{"location":"dorgeclipseopenj9criuimmutableenvvars/","title":"-Dorg.eclipse.openj9.criu.ImmutableEnvVars","text":""},{"location":"dorgeclipseopenj9criuimmutableenvvars/#-dorgeclipseopenj9criuimmutableenvvars","title":"-Dorg.eclipse.openj9.criu.ImmutableEnvVars","text":"

This system property specifies the environment variables that you want to add to the ImmutableEnvVars list.

Restrictions: This option takes effect only when the -XX:+EnableCRIUSupport option is enabled. This option can be used only during the checkpoint phase.

"},{"location":"dorgeclipseopenj9criuimmutableenvvars/#syntax","title":"Syntax","text":"
    -Dorg.eclipse.openj9.criu.ImmutableEnvVars=<environment_variables>\n

Where <environment_variables> is a comma-separated list of environment variables. For example:

-Dorg.eclipse.openj9.criu.ImmutableEnvVars=INVOKED,WLP_USER_DIR,WLP_OUTPUT_DIR,LOG_DIR,X_LOG_DIR,LOG_FILE,X_LOG_FILE,VARIABLE_SOURCE_DIRS,X_CMD\n

The following environment variables are included in the list by default and cannot be removed:

"},{"location":"dorgeclipseopenj9criuimmutableenvvars/#explanation","title":"Explanation","text":"

The environment variables are a property of the operating system environment and not the VM. The VM considers these properties as immutable and does not allow the environment variables to change values between checkpoint and restore.

During the checkpoint and restore phases, the VM can detect the environment variables that are in the immutableEnvvars list. You can add any other immutable variables that you want the VM to detect in the ImmutableEnvVars list with the -Dorg.eclipse.openj9.criu.ImmutableEnvVars option. If an environment variable is not in the list, the VM does not detect that variable even if the underlying system has defined it. These environment variables exist for the entire lifetime of the VM (checkpoint and restore).

At restore, the VM can also detect the environment variables that are added through the CRIUSupport.registerRestoreEnvVariables API.

For more information about how environment variables are handled during the checkpoint and restore process, see the Environment Variables section in the OpenJ9 CRIU Support: A look under the hood\u202f(part II) blog post.

"},{"location":"dorgeclipseopenj9criuimmutableenvvars/#see-also","title":"See also","text":""},{"location":"dump_heapdump/","title":"Heap dump","text":""},{"location":"dump_heapdump/#heap-dump","title":"Heap dump","text":"

Heap dumps contain a snapshot of all the live objects that are being used by a running Java\u2122 application on the Java heap. You can obtain detailed information for each object instance, such as the address, type, class name, or size, and whether the instance has references to other objects.

There are two formats for heap dumps; the classic format and the Portable Heap Dump (PHD) format, which is the default. Whilst the classic format is generated in ascii text and can be read, the PHD format is binary and and must be processed for analysis.

"},{"location":"dump_heapdump/#obtaining-dumps","title":"Obtaining dumps","text":"

Heap dumps are generated by default in PHD format when the Java heap runs out of space. If you want to trigger the production of a heap dump in response to other situations, or in classic format, you can use one of the following options:

"},{"location":"dump_heapdump/#analyzing-dumps","title":"Analyzing dumps","text":"

The best method to analyze a PHD heap dump is to use the Eclipse Memory Analyzer\u2122 tool (MAT) or the IBM Memory Analyzer tool. These tools process the dump file and provide a visual representation of the objects in the Java Heap. Both tools require the Diagnostic Tool Framework for Java (DTFJ) plug-in. To install the DTFJ plug-in in the Eclipse IDE, select the following menu items:

Help > Install New Software > Work with \"IBM Diagnostic Tool Framework for Java\" > IBM Monitoring and Diagnostic Tools > Diagnostic Tool Framework for Java   \n

The following sections contain detailed information about the content of each type of heap dump file.

"},{"location":"dump_heapdump/#portable-heap-dump-phd-format","title":"Portable Heap Dump (PHD) format","text":"

A PHD format dump file contains a header section and a body section. The body section can contain information about object, array, or class records. Primitive numbers are used to describe the file format, as detailed in the following table:

Primitive number Length in bytes byte 1 short 2 int 4 long 8 word 4 (32-bit platforms) or 8 (64-bit platforms)"},{"location":"dump_heapdump/#general-structure","title":"General structure","text":"

The following structure comprises the header section of a PHD file:

The body of a PHD file is indicated by a byte that contains a tag with a value of 2, after which there are a number of dump records. Dump records are preceded by a 1 byte tag with the following record types:

These records are described in more detail in the sections that follow.

The end of the PHD body is indicated by a byte that contains a tag with a value of 3.

"},{"location":"dump_heapdump/#object-records","title":"Object records","text":"

Object records can be short, medium, or long, depending on the number of object references in the heap dump.

1. Short object record

The following information is contained within the tag byte:

2. Medium object record

These records provide the actual address of the class rather than a cache index. The following format is used:

3. Long object record

This record format is used when there are more than 7 references, or if there are extra flags or a hash code. The following format is used:

"},{"location":"dump_heapdump/#array-records","title":"Array records","text":"

PHD arrays can be primitive arrays or object arrays, as described in the sections that follow.

1. Primitive array record

The following information is contained in an array record:

2. Long primitive array record

This type of record is used when a primitive array has been hashed.

3. Object array record

The following format applies:

"},{"location":"dump_heapdump/#class-records","title":"Class records","text":"

The PHD class record encodes a class object and contains the following format:

"},{"location":"dump_heapdump/#classic-heap-dump-format","title":"Classic Heap Dump format","text":"

Classic heap dumps are produced in ascii text on all platforms except z/OS, which are encoded in EBCDIC. The dump is divided into the following sections:

"},{"location":"dump_heapdump/#header-record","title":"Header record","text":"

A single string containing information about the runtime environment, platform, and build levels, similar to the following example:

// Version: JRE 1.8.0 Linux amd64-64 (build 1.8.0_232-b09)\n
"},{"location":"dump_heapdump/#object-records_1","title":"Object records","text":"

A record of each object instance in the heap with the following format:

<object address, in hexadecimal> [<length in bytes of object instance, in decimal>] OBJ <object type>\n<heap reference, in hexadecimal> <heap reference, in hexadecimal> ...\n

The following object types (object type) might be shown:

These types are abbreviated in the record. To determine the type, see the Java VM Type Signature table.

Any references found are also listed, excluding references to an object's class or NULL references.

The following example shows an object instance (16 bytes in length) of type java/lang/String, with a reference to a char array:

0x00000000E0000AF0 [16] OBJ java/lang/String\n    0x00000000E0000B00\n

The object instance (length 32 bytes) of type char array, as referenced from the java/lang/String, is shown in the following example:

0x00000000E0000B00 [32] OBJ [C\n

The following example shows an object instance (24 bytes in length) of type array of java/lang/String:

0x00000000FFF07498 [24] OBJ [Ljava/lang/String;\n    0x00000000E0005D78 0x00000000E0005D50 0x00000000E0005D28 0x00000000E0005D00\n
"},{"location":"dump_heapdump/#class-records_1","title":"Class records","text":"

A record of each class in the following format:

<class object address, in hexadecimal> [<length in bytes of class object, in decimal>] CLS <class type>\n<heap reference, in hexadecimal> <heap reference, in hexadecimal>...\n

The following class types (<class type>) might be shown:

These types are abbreviated in the record. To determine the type, see the Java VM Type Signature table.

Any references found in the class block are also listed, excluding NULL references.

The following example shows a class object (80 bytes in length) for java/util/Date, with heap references:

0x00000000E00174F0 [80] CLS java/util/Date\n    0x00000000FFF1BB60 0x00000000FFF29630\n
"},{"location":"dump_heapdump/#trailer-record-1","title":"Trailer record 1","text":"

A single record containing record counts, in decimal.

For example:

// Breakdown - Classes: 630, Objects: 3692, ObjectArrays: 576, PrimitiveArrays: 2249\n
"},{"location":"dump_heapdump/#trailer-record-2","title":"Trailer record 2","text":"

A single record containing totals, in decimal.

For example:

// EOF:  Total 'Objects',Refs(null) : 7147,22040(12379)\n

The values in the example reflect the following counts:

"},{"location":"dump_heapdump/#java-vm-type-signatures","title":"Java VM Type Signatures","text":"

The following table shows the abbreviations used for different Java types in the heap dump records:

Java VM Type Signature Java Type Z boolean B byte C char S short I int J long F float D double L<fully-qualified class>; <fully-qualified class> [<type> <type>[](array of <type>) (<arg-types>)<ret-type> method"},{"location":"dump_heapdump/#see-also","title":"See also","text":""},{"location":"dump_javadump/","title":"Java dump","text":""},{"location":"dump_javadump/#java-dump","title":"Java dump","text":"

Java\u2122 dumps, sometimes referred to as Java cores, are produced when the VM ends unexpectedly because of an operating system signal, OutOfMemoryError, or a user-initiated keystroke combination. You can also generate a Java dump by calling the Dump API programmatically from your application or specifying the -Xdump:java option on the command line.

If your Java application crashes or hangs, Java dumps can provide useful information to help you diagnose the root cause.

To help you understand how a Java dump can help you with problem diagnosis, this topic includes a few scenarios to help you interpret the data:

"},{"location":"dump_javadump/#java-dump-contents","title":"Java dump contents","text":"

Java dumps summarize the state of the VM when the event occurs, with most of the information relating to components of the VM. The file is made up of a number of sections that provide different types of information.

"},{"location":"dump_javadump/#title","title":"TITLE","text":"

The first section of the Java dump file provides information about the event that triggered the production of the dump. In the following example, you can see that a vmstop event triggered the dump at a specified date and time.

0SECTION       TITLE subcomponent dump routine\nNULL           ===============================\n1TICHARSET     UTF-8\n1TISIGINFO     Dump Event \"vmstop\" (00000002) Detail \"#0000000000000000\" received\n1TIDATETIMEUTC Date: 2021/04/23 at 18:02:44:017 (UTC)\n1TIDATETIME    Date: 2021/04/23 at 14:02:44:017\n1TITIMEZONE    Timezone: UTC-4 (EDT)\n1TINANOTIME    System nanotime: 379202644260787\n1TIFILENAME    Javacore filename:    /home/doc-javacore/javacore.20210423.140244.1175.0001.txt\n1TIREQFLAGS    Request Flags: 0x81 (exclusive+preempt)\n1TIPREPSTATE   Prep State: 0x106 (vm_access+exclusive_vm_access+trace_disabled)\n
"},{"location":"dump_javadump/#gpinfo","title":"GPINFO","text":"

The GPINFO section provides general information about the system that the VM is running on. The following example is taken from a Java dump that was generated on a Linux system.

NULL           ------------------------------------------------------------------------\n0SECTION       GPINFO subcomponent dump routine\nNULL           ================================\n2XHOSLEVEL     OS Level         : Linux 3.10.0-862.11.6.el7.x86_64\n2XHCPUS        Processors -\n3XHCPUARCH       Architecture   : amd64\n3XHNUMCPUS       How Many       : 4\n3XHNUMASUP       NUMA is either not supported or has been disabled by user\nNULL\n1XHERROR2      Register dump section only produced for SIGSEGV, SIGILL or SIGFPE.\nNULL\n

The content of this section can vary, depending on the cause of the dump. For example, if the dump was caused by a general protection fault (gpf), the library in which the crash occurred is also recorded, together with a value shown as VM flags. This value can provide some clues about which component of the VM might have been involved. Look for the following line in the output:

1XHFLAGS       VM flags:0000000000000000\n

The hexadecimal number that is recorded for VM flags ends in MSSSS, where M is the VM component and SSSS is component-specific code as shown in the following table:

Component Code value INTERPRETER 0x10000 GC 0x20000 GROW_STACK 0x30000 JNI 0x40000 JIT_CODEGEN 0x50000 BCVERIFY 0x60000 RTVERIFY 0x70000 SHAREDCLASSES 0x80000

A value of 0000000000000000 (0x00000) indicates that a crash occurred outside of the VM.

"},{"location":"dump_javadump/#envinfo","title":"ENVINFO","text":"

This section contains useful information about the environment in which the crash took place, including the following data:

For clarity, the following example shows a shortened version of this section, where ... indicates that lines are removed:

NULL           ------------------------------------------------------------------------\n0SECTION       ENVINFO subcomponent dump routine\nNULL           =================================\n1CIJAVAVERSION JRE 9 Linux amd64-64 (build 9.0.4-internal+0-adhoc..openj9-openjdk-jdk9)\n1CIVMVERSION   20180830_000000\n1CIJ9VMVERSION 8e7c6ec\n1CIJITVERSION  8e7c6ec\n1CIOMRVERSION  553811b_CMPRSS\n1CIJCLVERSION  ec1d223 based on jdk-9.0.4+12\n1CIJITMODES    JIT enabled, AOT enabled, FSD disabled, HCR enabled\n1CIRUNNINGAS   Running as a standalone JVM\n1CIVMIDLESTATE VM Idle State: ACTIVE\n1CICONTINFO    Running in container : FALSE\n1CICGRPINFO    JVM support for cgroups enabled : TRUE\n1CISTARTTIME   JVM start time: 2018/08/30 at 21:55:47:387\n1CISTARTNANO   JVM start nanotime: 22012135233549\n1CIPROCESSID   Process ID: 30285 (0x764D)\n1CICMDLINE     [not available]\n1CIJAVAHOMEDIR Java Home Dir:   /home/me/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-release/images/jdk\n1CIJAVADLLDIR  Java DLL Dir:    /home/me/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-release/images/jdk/bin\n1CISYSCP       Sys Classpath:\n1CIUSERARGS    UserArgs:\n2CIUSERARG               -Xoptionsfile=/home/me/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-release/images/jdk/lib/options.default\n...\n1CIIGNOREDARGS Ignored Args:\n2CIIGNOREDARG            -XX:+UseCompressedOop\n2CIIGNOREDARG            -XX:CompressedClassSpaceSize=528482304\nNULL\n1CIUSERLIMITS  User Limits (in bytes except for NOFILE and NPROC)\nNULL           ------------------------------------------------------------------------\nNULL           type                            soft limit           hard limit\n2CIUSERLIMIT   RLIMIT_AS                        unlimited            unlimited\n2CIUSERLIMIT   RLIMIT_CORE                              0            unlimited\n2CIUSERLIMIT   RLIMIT_CPU                       unlimited            unlimited\n2CIUSERLIMIT   RLIMIT_DATA                      unlimited            unlimited\n2CIUSERLIMIT   RLIMIT_FSIZE                     unlimited            unlimited\n2CIUSERLIMIT   RLIMIT_LOCKS                     unlimited            unlimited\n2CIUSERLIMIT   RLIMIT_MEMLOCK                       65536                65536\n2CIUSERLIMIT   RLIMIT_NOFILE                         4096                 4096\n2CIUSERLIMIT   RLIMIT_NPROC                          4096                30592\n2CIUSERLIMIT   RLIMIT_RSS                       unlimited            unlimited\n2CIUSERLIMIT   RLIMIT_STACK                       8388608            unlimited\n2CIUSERLIMIT   RLIMIT_MSGQUEUE                     819200               819200\n2CIUSERLIMIT   RLIMIT_NICE                              0                    0\n2CIUSERLIMIT   RLIMIT_RTPRIO                            0                    0\n2CIUSERLIMIT   RLIMIT_SIGPENDING                    30592                30592\nNULL\n1CIENVVARS     Environment Variables\nNULL           ------------------------------------------------------------------------\n2CIENVVAR      XDG_VTNR=1\n2CIENVVAR      SSH_AGENT_PID=2653\n...\nNULL\n1CISYSINFO     System Information\nNULL           ------------------------------------------------------------------------\n2CISYSINFO     /proc/sys/kernel/core_pattern = core\n2CISYSINFO     /proc/sys/kernel/core_uses_pid = 1\nNULL\n1CICPUINFO     CPU Information\nNULL           ------------------------------------------------------------------------\n2CIPHYSCPU     Physical CPUs: 8\n2CIONLNCPU     Online CPUs: 8\n2CIBOUNDCPU    Bound CPUs: 8\n2CIACTIVECPU   Active CPUs: 0\n2CITARGETCPU   Target CPUs: 8\n2CIJITFEATURE  CPU features (JIT): fpu cx8 cmov mmx sse sse2 ssse3 fma sse4_1 popcnt aesni osxsave avx avx2 rdt_m\n2CIAOTFEATURE  CPU features (AOT): fpu cx8 cmov mmx sse sse2 ssse3 fma sse4_1 popcnt aesni osxsave avx avx2 rdt_m\nNULL\n1CICGRPINFO    Cgroup Information\nNULL           ------------------------------------------------------------------------\n2CICGRPINFO    subsystem : cpu\n2CICGRPINFO    cgroup name : /\n3CICGRPINFO    CPU Period : 100000 microseconds\n3CICGRPINFO    CPU Quota : Not Set\n3CICGRPINFO    CPU Shares : 1024\n3CICGRPINFO    Period intervals elapsed count : 0\n3CICGRPINFO    Throttled count : 0\n3CICGRPINFO    Total throttle time : 0 nanoseconds\n2CICGRPINFO    subsystem : cpuset\n2CICGRPINFO    cgroup name : /\n3CICGRPINFO    CPU exclusive : 1\n3CICGRPINFO    Mem exclusive : 1\n3CICGRPINFO    CPUs : 0-7\n3CICGRPINFO    Mems : 0\n2CICGRPINFO    subsystem : memory\n2CICGRPINFO    cgroup name : /\n3CICGRPINFO    Memory Limit : Not Set\n3CICGRPINFO    Memory + Swap Limit : Not Set\n3CICGRPINFO    Memory Usage : 5363396608 bytes\n3CICGRPINFO    Memory + Swap Usage : 5363396608 bytes\n3CICGRPINFO    Memory Max Usage : 0 bytes\n3CICGRPINFO    Memory + Swap Max Usage : 0 bytes\n3CICGRPINFO    Memory limit exceeded count : 0\n3CICGRPINFO    Memory + Swap limit exceeded count : 0\n3CICGRPINFO    OOM Killer Disabled : 0\n3CICGRPINFO    Under OOM : 0\nNULL\n
"},{"location":"dump_javadump/#nativememinfo","title":"NATIVEMEMINFO","text":"

This section records information about native memory that is requested by using library functions such as malloc() and mmap(). Values are provided as a breakdown, per component, indicating the total number of bytes allocated and the number of native memory allocations. In the following example, 4,682,840 bytes of native memory are allocated (but not yet freed) to VM Classes, which correspond to 141 allocations.

NULL           ------------------------------------------------------------------------\n0SECTION       NATIVEMEMINFO subcomponent dump routine\nNULL           =================================\n0MEMUSER\n1MEMUSER       JRE: 2,569,088,312 bytes / 4653 allocations\n1MEMUSER       |\n2MEMUSER       +--VM: 2,280,088,336 bytes / 2423 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Classes: 4,682,840 bytes / 141 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Memory Manager (GC): 2,054,966,784 bytes / 433 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Java Heap: 2,014,113,792 bytes / 1 allocation\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Other: 40,852,992 bytes / 432 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Threads: 10,970,016 bytes / 156 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Java Stack: 197,760 bytes / 16 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Native Stack: 10,616,832 bytes / 17 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Other: 155,424 bytes / 123 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Trace: 180,056 bytes / 263 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--JVMTI: 17,776 bytes / 13 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--JNI: 36,184 bytes / 52 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Port Library: 208,179,632 bytes / 72 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Unused <32bit allocation regions: 208,168,752 bytes / 1 allocation\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Other: 10,880 bytes / 71 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Other: 1,055,048 bytes / 1293 allocations\n1MEMUSER       |\n2MEMUSER       +--JIT: 288,472,816 bytes / 140 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--JIT Code Cache: 268,435,456 bytes / 1 allocation\n2MEMUSER       |  |\n3MEMUSER       |  +--JIT Data Cache: 2,097,216 bytes / 1 allocation\n2MEMUSER       |  |\n3MEMUSER       |  +--Other: 17,940,144 bytes / 138 allocations\n1MEMUSER       |\n2MEMUSER       +--Class Libraries: 13,432 bytes / 25 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--VM Class Libraries: 13,432 bytes / 25 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--sun.misc.Unsafe: 3,184 bytes / 13 allocations\n4MEMUSER       |  |  |  |\n5MEMUSER       |  |  |  +--Direct Byte Buffers: 1,056 bytes / 12 allocations\n4MEMUSER       |  |  |  |\n5MEMUSER       |  |  |  +--Other: 2,128 bytes / 1 allocation\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Other: 10,248 bytes / 12 allocations\n1MEMUSER       |\n2MEMUSER       +--Unknown: 513,728 bytes / 2065 allocations\nNULL\n

This section does not record memory that is allocated by application or JNI code and is typically a little less than the value recorded by operating system tools.

"},{"location":"dump_javadump/#meminfo","title":"MEMINFO","text":"

This section relates to memory management, providing a breakdown of memory usage in the VM for the object heap, internal memory, memory used for classes, the JIT code cache, and JIT data cache in decimal and hexadecimal format. You can also find out which garbage collection policy is in use when the dump is produced.

The object memory area (1STHEAPTYPE) records each memory region in use, its start and end address, and region size. Further information is recorded about the memory segments that are used for internal memory, class memory, the JIT code cache, and JIT data cache (1STSEGMENT). This information includes the address of the segment control data structure, the start and end address of the native memory segment, as well as the segment size.

For clarity, the following example shows a shortened version of this section, where ... indicates that lines are removed:

NULL           ------------------------------------------------------------------------\n0SECTION       MEMINFO subcomponent dump routine\nNULL           =================================\nNULL\n1STHEAPTYPE    Object Memory\nNULL           id                 start              end                size               space/region\n1STHEAPSPACE   0x00007FF4F00744A0         --                 --                 --         Generational\n1STHEAPREGION  0x00007FF4F0074CE0 0x0000000087F40000 0x0000000088540000 0x0000000000600000 Generational/Tenured Region\n1STHEAPREGION  0x00007FF4F0074930 0x00000000FFE00000 0x00000000FFF00000 0x0000000000100000 Generational/Nursery Region\n1STHEAPREGION  0x00007FF4F0074580 0x00000000FFF00000 0x0000000100000000 0x0000000000100000 Generational/Nursery Region\nNULL\n1STHEAPTOTAL   Total memory:                     8388608 (0x0000000000800000)\n1STHEAPINUSE   Total memory in use:              2030408 (0x00000000001EFB48)\n1STHEAPFREE    Total memory free:                6358200 (0x00000000006104B8)\nNULL\n1STSEGTYPE     Internal Memory\nNULL           segment            start              alloc              end                type       size\n1STSEGMENT     0x00007FF4F004CBC8 0x00007FF4CD33C000 0x00007FF4CD33C000 0x00007FF4CE33C000 0x01000440 0x0000000001000000\n1STSEGMENT     0x00007FF4F004CB08 0x00007FF4DE43D030 0x00007FF4DE517770 0x00007FF4DE53D030 0x00800040 0x0000000000100000\nNULL\n1STSEGTOTAL    Total memory:                    17825792 (0x0000000001100000)\n1STSEGINUSE    Total memory in use:               894784 (0x00000000000DA740)\n1STSEGFREE     Total memory free:               16931008 (0x00000000010258C0)\nNULL\n1STSEGTYPE     Class Memory\nNULL           segment            start              alloc              end                type       size\n1STSEGMENT     0x00007FF4F03B5638 0x0000000001053D98 0x000000000105BD98 0x000000000105BD98 0x00010040 0x0000000000008000\n1STSEGMENT     0x00007FF4F03B5578 0x0000000001048188 0x0000000001050188 0x0000000001050188 0x00010040 0x0000000000008000\n...\nNULL\n1STSEGTOTAL    Total memory:                     3512520 (0x00000000003598C8)\n1STSEGINUSE    Total memory in use:              3433944 (0x00000000003465D8)\n1STSEGFREE     Total memory free:                  78576 (0x00000000000132F0)\nNULL\n1STSEGTYPE     JIT Code Cache\nNULL           segment            start              alloc              end                type       size\n1STSEGMENT     0x00007FF4F00961F8 0x00007FF4CE43D000 0x00007FF4CE445790 0x00007FF4DE43D000 0x00000068 0x0000000010000000\nNULL\n1STSEGTOTAL    Total memory:                   268435456 (0x0000000010000000)\n1STSEGINUSE    Total memory in use:                34704 (0x0000000000008790)\n1STSEGFREE     Total memory free:              268400752 (0x000000000FFF7870)\n1STSEGLIMIT    Allocation limit:               268435456 (0x0000000010000000)\nNULL\n1STSEGTYPE     JIT Data Cache\nNULL           segment            start              alloc              end                type       size\n1STSEGMENT     0x00007FF4F0096668 0x00007FF4CC553030 0x00007FF4CC753030 0x00007FF4CC753030 0x00000048 0x0000000000200000\nNULL\n1STSEGTOTAL    Total memory:                     2097152 (0x0000000000200000)\n1STSEGINUSE    Total memory in use:              2097152 (0x0000000000200000)\n1STSEGFREE     Total memory free:                      0 (0x0000000000000000)\n1STSEGLIMIT    Allocation limit:               402653184 (0x0000000018000000)\nNULL\n1STGCHTYPE     GC History\nNULL\n

In the example, the GC History (1STGCHTYPE) section is blank. This section is populated if a garbage collection cycle occurred in a VM that is being diagnosed with the trace facility.

"},{"location":"dump_javadump/#locks","title":"LOCKS","text":"

This section of the Java dump provides information about locks, which protect shared resources from being accessed by more than one entity at a time. The information is essential in a deadlock situation, where two threads attempt to synchronize on an object and lock an instance of a class. Precise information is recorded about the threads that are causing the problem, which enables you to identify the root cause.

The following example shows a typical LOCKS section, where no deadlocks existed at the time the dump was triggered. For clarity, the following example shows a shortened version of this section, where ... indicates that lines are removed:

NULL           ------------------------------------------------------------------------\n0SECTION       LOCKS subcomponent dump routine\nNULL           ===============================\nNULL\n1LKPOOLINFO    Monitor pool info:\n2LKPOOLTOTAL     Current total number of monitors: 3\nNULL\n1LKMONPOOLDUMP Monitor Pool Dump (flat & inflated object-monitors):\n2LKMONINUSE      sys_mon_t:0x00007FF4B0001D78 infl_mon_t: 0x00007FF4B0001DF8:\n3LKMONOBJECT       java/lang/ref/ReferenceQueue@0x00000000FFE26A10: <unowned>\n3LKNOTIFYQ            Waiting to be notified:\n3LKWAITNOTIFY            \"Common-Cleaner\" (J9VMThread:0x0000000000FD0100)\nNULL\n1LKREGMONDUMP  JVM System Monitor Dump (registered monitors):\n2LKREGMON          Thread global lock (0x00007FF4F0004FE8): <unowned>\n2LKREGMON          &(PPG_mem_mem32_subAllocHeapMem32.monitor) lock (0x00007FF4F0005098): <unowned>\n2LKREGMON          NLS hash table lock (0x00007FF4F0005148): <unowned>\n...\nNULL\n
"},{"location":"dump_javadump/#threads","title":"THREADS","text":"

The THREADS section of a Java dump file provides summary information about the VM thread pool and detailed information about Java threads, native threads, and stack traces. Understanding the content of this section can help you diagnose problems that are caused by blocked or waiting threads.

A Java thread runs on a native thread. Several lines are recorded for each Java thread in the Thread Details subsection, which include the following key pieces of information:

Java thread priorities are mapped to operating system priority values. Thread states are shown in the following table:

Thread state value Status Description R Runnable The thread is able to run CW Condition Wait The thread is waiting S Suspended The thread is suspended by another thread Z Zombie The thread is destroyed P Parked The thread is parked by java.util.concurrent B Blocked The thread is waiting to obtain a lock

For threads that are parked (P), blocked (B), or waiting (CW), an additional line (3XMTHREADBLOCK) is included in the output that shows what the thread is parked on, blocked on, or waiting for. For threads that are waiting for a class initialization lock (java/lang/J9VMInternals$ClassInitializationLock), this line includes the name of the thread that is currently working to progress the initialization of the class. You can use this information to diagnose deadlocks that are caused by class initialization, which might not be detected and reported in the LOCKS section.

For clarity, the following example shows a shortened version of a typical THREADS section, where ... indicates that lines are removed:

NULL           ------------------------------------------------------------------------\n0SECTION       THREADS subcomponent dump routine\nNULL           =================================\nNULL\n1XMPOOLINFO    JVM Thread pool info:\n2XMPOOLTOTAL       Current total number of pooled threads: 19\n2XMPOOLLIVE        Current total number of live threads: 18\n2XMPOOLDAEMON      Current total number of live daemon threads: 15\nNULL\n1XMTHDINFO     Thread Details\nNULL\n...\n3XMTHREADINFO      \"JIT Diagnostic Compilation Thread-007 Suspended\" J9VMThread:0x0000000000035200, omrthread_t:0x00007F3F8C0D02C8, java/lang/Thread:0x00000000FFF42120, state:R, prio=10\n3XMJAVALTHREAD            (java/lang/Thread getId:0x9, isDaemon:true)\n3XMJAVALTHRCCL            sun/misc/Launcher$AppClassLoader(0x00000000FFF3BF98)\n3XMTHREADINFO1            (native thread ID:0x618F, native priority:0xB, native policy:UNKNOWN, vmstate:CW, vm thread flags:0x00000081)\n3XMTHREADINFO2            (native stack address range from:0x00007F3F879C5000, to:0x00007F3F87AC5000, size:0x100000)\n3XMCPUTIME               CPU usage total: 0.052410771 secs, current category=\"JIT\"\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=0 (0x0)\n3XMTHREADINFO3           No Java callstack associated with this thread\n...\nNULL\n...\n3XMTHREADINFO      \"Class Initialization Thread 2\" J9VMThread:0x0000000000124D00, omrthread_t:0x00007F3F8C1494C8, java/lang/Thread:0x00000000FFF53EE8, state:CW, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x13, isDaemon:false)\n3XMJAVALTHRCCL            sun/misc/Launcher$AppClassLoader(0x00000000FFF3BF98)\n3XMTHREADINFO1            (native thread ID:0x6199, native priority:0x5, native policy:UNKNOWN, vmstate:CW, vm thread flags:0x00000181)\n3XMTHREADINFO2            (native stack address range from:0x00007F3F74AB4000, to:0x00007F3F74AF4000, size:0x40000)\n3XMCPUTIME               CPU usage total: 0.008712260 secs, current category=\"Application\"\n3XMTHREADBLOCK     Waiting on: java/lang/J9VMInternals$ClassInitializationLock@0x00000000FFF61C90 Owned by: <unowned> Initializing thread: \"Class Initialization Thread 1\"\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=4096 (0x1000)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at java/lang/Class.forNameImpl(Native Method)\n4XESTACKTRACE                at java/lang/Class.forName(Class.java:339)\n4XESTACKTRACE                at ClassInitLockBug$ClassInitThread.run(ClassInitLockBug.java:16)\n...\nNULL\n...\nNULL\n3XMTHREADINFO      \"Class Initialization Thread 1\" J9VMThread:0x0000000000124100, omrthread_t:0x00007F3F8C148F50, java/lang/Thread:0x00000000FFF53D80, state:CW, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x12, isDaemon:false)\n3XMJAVALTHRCCL            sun/misc/Launcher$AppClassLoader(0x00000000FFF3BF98)\n3XMTHREADINFO1            (native thread ID:0x6198, native priority:0x5, native policy:UNKNOWN, vmstate:CW, vm thread flags:0x00000481)\n3XMTHREADINFO2            (native stack address range from:0x00007F3F74AF5000, to:0x00007F3F74B35000, size:0x40000)\n3XMCPUTIME               CPU usage total: 0.010221701 secs, current category=\"Application\"\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=12736 (0x31C0)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at java/lang/Thread.sleepImpl(Native Method)\n4XESTACKTRACE                at java/lang/Thread.sleep(Thread.java:983)\n4XESTACKTRACE                at java/lang/Thread.sleep(Thread.java:966)\n4XESTACKTRACE                at TestClass.<clinit>(ClassInitLockBug.java:29)\n4XESTACKTRACE                at java/lang/Class.forNameImpl(Native Method)\n4XESTACKTRACE                at java/lang/Class.forName(Class.java:339)\n4XESTACKTRACE                at ClassInitLockBug$ClassInitThread.run(ClassInitLockBug.java:16)\n...\nNULL\n...\nNULL\n1XMTHDSUMMARY  Threads CPU Usage Summary\nNULL           =========================\nNULL\n1XMTHDCATINFO  Warning: to get more accurate CPU times for the GC, the option -XX:-ReduceCPUMonitorOverhead can be used. See the user guide for more information.\nNULL\n1XMTHDCATEGORY All JVM attached threads: 0.698865000 secs\n1XMTHDCATEGORY |\n2XMTHDCATEGORY +--System-JVM: 0.653723000 secs\n2XMTHDCATEGORY |  |\n3XMTHDCATEGORY |  +--GC: 0.047248000 secs\n2XMTHDCATEGORY |  |\n3XMTHDCATEGORY |  +--JIT: 0.512971000 secs\n1XMTHDCATEGORY |\n2XMTHDCATEGORY +--Application: 0.045142000 secs\n
"},{"location":"dump_javadump/#hooks","title":"HOOKS","text":"

This section shows internal VM event callbacks, which are used for diagnosing performance problems in the VM. Multiple hook interfaces are listed, which include their individual hook events.

The following example shows data for the J9VMHookInterface, including the total time for all previous events, the call site location (<source file>:<line number>), start time, and duration of the last callback and the longest callback (all times measured in microseconds). The hook data is reset after each Java dump.

NULL           ------------------------------------------------------------------------\nSECTION HOOK   subcomponent dump routine\nNULL           =========================\n1NOTE          These data are reset every time a javacore is taken\n1HKINTERFACE   MM_OMRHookInterface\nNULL           ------------------------------------------------------------------------\n1HKINTERFACE   MM_PrivateHookInterface\nNULL           ------------------------------------------------------------------------\n1HKINTERFACE   MM_HookInterface\nNULL           ------------------------------------------------------------------------\n1HKINTERFACE   J9VMHookInterface\nNULL           ------------------------------------------------------------------------\n2HKEVENTID     1\n3HKCALLCOUNT       1239\n3HKTOTALTIME       219564us\n3HKLAST            Last Callback\n4HKCALLSITE            trcengine.c:395\n4HKSTARTTIME           Start Time: 2019-10-18T00:15:14.664\n4HKDURATION            Duration : 16us\n3HKLONGST          Longest Callback\n4HKCALLSITE            trcengine.c:395\n4HKSTARTTIME           Start Time: 2019-10-18T21:28:34.895\n4HKDURATION            Duration : 5012us\nNULL\n...\n1HKINTERFACE   J9VMZipCachePoolHookInterface\nNULL           ------------------------------------------------------------------------\n1HKINTERFACE   J9JITHookInterface\nNULL           ------------------------------------------------------------------------\n2HKEVENTID     3\n3HKCALLCOUNT       3113\n3HKTOTALTIME       4904us\n3HKLAST            Last Callback\n4HKCALLSITE            common/mgmtinit.c:193\n4HKSTARTTIME           Start Time: 2019-10-18T16:04:15.320\n4HKDURATION            Duration : 3us\n3HKLONGST          Longest Callback\n4HKCALLSITE            common/mgmtinit.c:193\n4HKSTARTTIME           Start Time: 2019-10-18T16:37:17.633\n4HKDURATION            Duration : 27us\nNULL\n...\n
"},{"location":"dump_javadump/#shared-classes","title":"SHARED CLASSES","text":"

If the shared classes cache is enabled at run time, the information that is provided in a Java dump file describes settings that were used when creating the cache, together with summary information about the size and content of the cache.

In the following example, the shared classes cache was created with a Class Debug Area (-Xnolinenumbers=false). Byte code instrumentation (BCI) is enabled, which is the default, and VMs sharing the cache are allowed to store classpaths, which is also the default.

The Cache Summary shows a cache size (2SCLTEXTCSZ) of 16776608 bytes, with a soft maximum size (2SCLTEXTSMB) also of 16776608 bytes, which leaves 12691668 bytes of free space (2SCLTEXTFRB). The size of the Class Debug Area (2SCLTEXTDAS) is 1331200 bytes and only 11% of this space is used.

In the Cache Memory Status subsection, the line 2SCLTEXTCMDT indicates the name and location of the shared cache and cr indicates that the cache is a 64-bit compressed references cache.

NULL           ------------------------------------------------------------------------\n0SECTION       SHARED CLASSES subcomponent dump routine\nNULL           ========================================\nNULL\n1SCLTEXTCRTW   Cache Created With\nNULL           ------------------\nNULL\n2SCLTEXTXNL        -Xnolinenumbers       = false\n2SCLTEXTBCI        BCI Enabled           = true\n2SCLTEXTBCI        Restrict Classpaths   = false\nNULL\n1SCLTEXTCSUM   Cache Summary\nNULL           ------------------\nNULL\n2SCLTEXTNLC        No line number content                    = false\n2SCLTEXTLNC        Line number content                       = true\nNULL\n2SCLTEXTRCS        ROMClass start address                    = 0x00007F423061C000\n2SCLTEXTRCE        ROMClass end address                      = 0x00007F42307B9A28\n2SCLTEXTMSA        Metadata start address                    = 0x00007F42313D42FC\n2SCLTEXTCEA        Cache end address                         = 0x00007F4231600000\n2SCLTEXTRTF        Runtime flags                             = 0x00102001ECA6028B\n2SCLTEXTCGN        Cache generation                          = 35\nNULL\n2SCLTEXTCSZ        Cache size                                = 16776608\n2SCLTEXTSMB        Softmx bytes                              = 16776608\n2SCLTEXTFRB        Free bytes                                = 12691668\n2SCLTEXTRCB        ROMClass bytes                            = 1694248\n2SCLTEXTAOB        AOT code bytes                            = 0\n2SCLTEXTADB        AOT data bytes                            = 0\n2SCLTEXTAHB        AOT class hierarchy bytes                 = 32\n2SCLTEXTATB        AOT thunk bytes                           = 0\n2SCLTEXTARB        Reserved space for AOT bytes              = -1\n2SCLTEXTAMB        Maximum space for AOT bytes               = -1\n2SCLTEXTJHB        JIT hint bytes                            = 308\n2SCLTEXTJPB        JIT profile bytes                         = 2296\n2SCLTEXTJRB        Reserved space for JIT data bytes         = -1\n2SCLTEXTJMB        Maximum space for JIT data bytes          = -1\n2SCLTEXTNOB        Java Object bytes                         = 0\n2SCLTEXTZCB        Zip cache bytes                           = 919328\n2SCLTEXTSHB        Startup hint bytes                        = 0\n2SCLTEXTRWB        ReadWrite bytes                           = 114080\n2SCLTEXTJCB        JCL data bytes                            = 0\n2SCLTEXTBDA        Byte data bytes                           = 0\n2SCLTEXTMDA        Metadata bytes                            = 23448\n2SCLTEXTDAS        Class debug area size                     = 1331200\n2SCLTEXTDAU        Class debug area % used                   = 11%\n2SCLTEXTDAN        Class LineNumberTable bytes               = 156240\n2SCLTEXTDAV        Class LocalVariableTable bytes            = 0\nNULL\n2SCLTEXTNRC        Number ROMClasses                         = 595\n2SCLTEXTNAM        Number AOT Methods                        = 0\n2SCLTEXTNAD        Number AOT Data Entries                   = 0\n2SCLTEXTNAH        Number AOT Class Hierarchy                = 1\n2SCLTEXTNAT        Number AOT Thunks                         = 0\n2SCLTEXTNJH        Number JIT Hints                          = 14\n2SCLTEXTNJP        Number JIT Profiles                       = 20\n2SCLTEXTNCP        Number Classpaths                         = 1\n2SCLTEXTNUR        Number URLs                               = 0\n2SCLTEXTNTK        Number Tokens                             = 0\n2SCLTEXTNOJ        Number Java Objects                       = 0\n2SCLTEXTNZC        Number Zip Caches                         = 5\n2SCLTEXTNSH        Number Startup Hint Entries               = 0\n2SCLTEXTNJC        Number JCL Entries                        = 0\n2SCLTEXTNST        Number Stale classes                      = 0\n2SCLTEXTPST        Percent Stale classes                     = 0%\nNULL\n2SCLTEXTCPF        Cache is 24% full\nNULL\n1SCLTEXTCMST   Cache Memory Status\nNULL           ------------------\n1SCLTEXTCNTD       Cache Name                    Feature                  Memory type              Cache path\nNULL\n2SCLTEXTCMDT       sharedcc_doc-javacore         CR                       Memory mapped file       /tmp/javasharedresources/C290M4F1A64P_sharedcc_doc-javacore_G35\nNULL\n1SCLTEXTCMST   Cache Lock Status\nNULL           ------------------\n1SCLTEXTCNTD       Lock Name                     Lock type                TID owning lock\nNULL\n2SCLTEXTCWRL       Cache write lock              File lock                Unowned\n2SCLTEXTCRWL       Cache read/write lock         File lock                Unowned\nNULL\n

The following example shows information for a layered cache:

NULL           ------------------------------------------------------------------------\n0SECTION       SHARED CLASSES subcomponent dump routine\nNULL           ========================================\nNULL\n1SCLTEXTCSTL   Cache Statistics for Top Layer\nNULL\n1SCLTEXTCRTW       Cache Created With\nNULL               ------------------\nNULL\n2SCLTEXTXNL            -Xnolinenumbers       = false\n2SCLTEXTBCI            BCI Enabled           = true\n2SCLTEXTBCI            Restrict Classpaths   = false\nNULL\n1SCLTEXTCSUM       Cache Summary\nNULL               ------------------\nNULL\n2SCLTEXTNLC            No line number content                    = false\n2SCLTEXTLNC            Line number content                       = false\nNULL\n2SCLTEXTRCS            ROMClass start address                    = 0x00007F0EDB567000\n2SCLTEXTRCE            ROMClass end address                      = 0x00007F0EDB567000\n2SCLTEXTMSA            Metadata start address                    = 0x00007F0EDC40241C\n2SCLTEXTCEA            Cache end address                         = 0x00007F0EDC54B000\n2SCLTEXTRTF            Runtime flags                             = 0x80102001ECA602BB\n2SCLTEXTCGN            Cache generation                          = 41\n2SCLTEXTCLY            Cache layer                               = 1\nNULL\n2SCLTEXTCSZ            Cache size                                = 16776608\n2SCLTEXTSMB            Softmx bytes                              = 16776608\n2SCLTEXTFRB            Free bytes                                = 15315996\n2SCLTEXTARB            Reserved space for AOT bytes              = -1\n2SCLTEXTAMB            Maximum space for AOT bytes               = -1\n2SCLTEXTJRB            Reserved space for JIT data bytes         = -1\n2SCLTEXTJMB            Maximum space for JIT data bytes          = -1\n2SCLTEXTRWB            ReadWrite bytes                           = 114080\n2SCLTEXTDAS            Class debug area size                     = 1331200\n2SCLTEXTDAU            Class debug area % used                   = 0%\n2SCLTEXTDAN            Class LineNumberTable bytes               = 0\n2SCLTEXTDAV            Class LocalVariableTable bytes            = 0\nNULL\n2SCLTEXTCPF            Cache is 8% full\nNULL\n1SCLTEXTCMST       Cache Memory Status\nNULL               ------------------\n1SCLTEXTCNTD           Cache Name                    Feature                  Memory type              Cache path\nNULL\n2SCLTEXTCMDT           Cache1                        CR                       Memory mapped file       /tmp/javasharedresources/C290M4F1A64P_Cache1_G41L01\nNULL\n1SCLTEXTCMST       Cache Lock Status\nNULL               ------------------\n1SCLTEXTCNTD           Lock Name                     Lock type                TID owning lock\nNULL\n2SCLTEXTCWRL           Cache write lock              File lock                Unowned\n2SCLTEXTCRWL           Cache read/write lock         File lock                Unowned\nNULL\n1SCLTEXTCSAL   Cache Statistics for All Layers\nNULL\n2SCLTEXTRCB            ROMClass bytes                            = 1459040\n2SCLTEXTAOB            AOT code bytes                            = 57624\n2SCLTEXTADB            AOT data bytes                            = 272\n2SCLTEXTAHB            AOT class hierarchy bytes                 = 1840\n2SCLTEXTATB            AOT thunk bytes                           = 632\n2SCLTEXTJHB            JIT hint bytes                            = 484\n2SCLTEXTJPB            JIT profile bytes                         = 0\n2SCLTEXTNOB            Java Object bytes                         = 0\n2SCLTEXTZCB            Zip cache bytes                           = 1134016\n2SCLTEXTSHB            Startup hint bytes                        = 0\n2SCLTEXTJCB            JCL data bytes                            = 0\n2SCLTEXTBDA            Byte data bytes                           = 0\nNULL\n2SCLTEXTNRC            Number ROMClasses                         = 503\n2SCLTEXTNAM            Number AOT Methods                        = 16\n2SCLTEXTNAD            Number AOT Data Entries                   = 1\n2SCLTEXTNAH            Number AOT Class Hierarchy                = 28\n2SCLTEXTNAT            Number AOT Thunks                         = 11\n2SCLTEXTNJH            Number JIT Hints                          = 15\n2SCLTEXTNJP            Number JIT Profiles                       = 0\n2SCLTEXTNCP            Number Classpaths                         = 1\n2SCLTEXTNUR            Number URLs                               = 0\n2SCLTEXTNTK            Number Tokens                             = 0\n2SCLTEXTNOJ            Number Java Objects                       = 0\n2SCLTEXTNZC            Number Zip Caches                         = 21\n2SCLTEXTNSH            Number Startup Hint Entries               = 0\n2SCLTEXTNJC            Number JCL Entries                        = 0\n2SCLTEXTNST            Number Stale classes                      = 0\n2SCLTEXTPST            Percent Stale classes                     = 0%\n
"},{"location":"dump_javadump/#classes","title":"CLASSES","text":"

The classes section shows information about class loaders. The first part is a summary that records each available class loader (2CLTEXTCLLOADER) followed by the number of libraries and classes that it loaded. This information is followed by a more detailed list of libraries (1CLTEXTCLLIB) and classes (1CLTEXTCLLO) that are loaded.

In the example you can see that the java/lang/InternalAnonymousClassLoader loaded two classes, jdk/internal/loader/BuiltinClassLoader$$Lambda$2/00000000F03876A0(0x0000000001030F00) and jdk/internal/loader/BuiltinClassLoader$$Lambda$1/00000000F00D2460(0x0000000001018A00).

NULL           ------------------------------------------------------------------------\n0SECTION       CLASSES subcomponent dump routine\nNULL           =================================\n1CLTEXTCLLOS    Classloader summaries\n1CLTEXTCLLSS        12345678: 1=primordial,2=extension,3=shareable,4=middleware,5=system,6=trusted,7=application,8=delegating\n2CLTEXTCLLOADER     p---st-- Loader *System*(0x00000000FFE1D258)\n3CLNMBRLOADEDLIB        Number of loaded libraries 5\n3CLNMBRLOADEDCL         Number of loaded classes 638\n2CLTEXTCLLOADER     -x--st-- Loader jdk/internal/loader/ClassLoaders$PlatformClassLoader(0x00000000FFE1D4F0), Parent *none*(0x0000000000000000)\n3CLNMBRLOADEDLIB        Number of loaded libraries 0\n3CLNMBRLOADEDCL         Number of loaded classes 0\n2CLTEXTCLLOADER     ----st-- Loader java/lang/InternalAnonymousClassLoader(0x00000000FFE1DFD0), Parent *none*(0x0000000000000000)\n3CLNMBRLOADEDLIB        Number of loaded libraries 0\n3CLNMBRLOADEDCL         Number of loaded classes 2\n2CLTEXTCLLOADER     -----ta- Loader jdk/internal/loader/ClassLoaders$AppClassLoader(0x00000000FFE1DAD0), Parent jdk/internal/loader/ClassLoaders$PlatformClassLoader(0x00000000FFE1D4F0)\n3CLNMBRLOADEDLIB        Number of loaded libraries 0\n3CLNMBRLOADEDCL         Number of loaded classes 0\n1CLTEXTCLLIB    ClassLoader loaded libraries\n2CLTEXTCLLIB        Loader *System*(0x00000000FFE1D258)\n3CLTEXTLIB              /home/me/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-release/images/jdk/lib/compressedrefs/jclse9_29\n3CLTEXTLIB              /home/me/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-release/images/jdk/lib/java\n3CLTEXTLIB              /home/me/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-release/images/jdk/lib/compressedrefs/j9jit29\n3CLTEXTLIB              /home/me/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-release/images/jdk/lib/zip\n3CLTEXTLIB              /home/me/openj9-openjdk-jdk9/build/linux-x86_64-normal-server-release/images/jdk/lib/nio\n1CLTEXTCLLOD    ClassLoader loaded classes\n2CLTEXTCLLOAD       Loader *System*(0x00000000FFE1D258)\n3CLTEXTCLASS            [Ljava/lang/Thread$State;(0x0000000001056400)\n...\n2CLTEXTCLLOAD       Loader jdk/internal/loader/ClassLoaders$PlatformClassLoader(0x00000000FFE1D4F0)\n2CLTEXTCLLOAD       Loader java/lang/InternalAnonymousClassLoader(0x00000000FFE1DFD0)\n3CLTEXTCLASS            jdk/internal/loader/BuiltinClassLoader$$Lambda$2/00000000F03876A0(0x0000000001030F00)\n3CLTEXTCLASS            jdk/internal/loader/BuiltinClassLoader$$Lambda$1/00000000F00D2460(0x0000000001018A00)\n2CLTEXTCLLOAD       Loader jdk/internal/loader/ClassLoaders$AppClassLoader(0x00000000FFE1DAD0)\n
"},{"location":"dump_javadump/#scenarios","title":"Scenarios","text":""},{"location":"dump_javadump/#general-protection-fault","title":"General Protection Fault","text":"

In this scenario, a Java application has crashed due to a General Protection Fault (GPF), automatically generating a Java dump file.

The first section of the file (TITLE) tells you that the GPF triggered the Java dump.

0SECTION       TITLE subcomponent dump routine\nNULL           ===============================\n1TICHARSET     UTF-8\n1TISIGINFO     Dump Event \"gpf\" (00002000) received\n1TIDATETIMEUTC Date: 2021/04/23 at 18:02:44:017 (UTC)\n1TIDATETIME    Date: 2021/04/23 at 14:02:44:017\n1TITIMEZONE    Timezone: UTC-4 (EDT)\n1TINANOTIME    System nanotime: 379202644260787\n1TIFILENAME    Javacore filename:    /home/test/JNICrasher/javacore.20210423.140244.29399.0002.txt\n1TIREQFLAGS    Request Flags: 0x81 (exclusive+preempt)\n1TIPREPSTATE   Prep State: 0x100 (trace_disabled)\n1TIPREPINFO    Exclusive VM access not taken: data may not be consistent across javacore sections\n

To troubleshoot this problem, you need to know which thread caused the GPF to occur. The thread that was running at the time of the crash is reported as the current thread in the THREADS section of the Java dump. Here is an extract from the THREADS section:

NULL           ------------------------------------------------------------------------\n0SECTION       THREADS subcomponent dump routine\nNULL           =================================\nNULL\n1XMPOOLINFO    JVM Thread pool info:\n2XMPOOLTOTAL       Current total number of pooled threads: 16\n2XMPOOLLIVE        Current total number of live threads: 15\n2XMPOOLDAEMON      Current total number of live daemon threads: 14\nNULL\n1XMCURTHDINFO  Current thread\n3XMTHREADINFO      \"main\" J9VMThread:0xB6B60E00, omrthread_t:0xB6B049D8, java/lang/Thread:0xB55444D0, state:R, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x1, isDaemon:false)\n3XMTHREADINFO1            (native thread ID:0x72D8, native priority:0x5, native policy:UNKNOWN, vmstate:R, vm thread flags:0x00000000)\n3XMTHREADINFO2            (native stack address range from:0xB6CE3000, to:0xB74E4000, size:0x801000)\n3XMCPUTIME               CPU usage total: 0.319865924 secs, current category=\"Application\"\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=778008 (0xBDF18)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at JNICrasher.doSomethingThatCrashes(Native Method)\n4XESTACKTRACE                at JNICrasher.main(JNICrasher.java:7)\n3XMTHREADINFO3           Native callstack:\n4XENATIVESTACK               (0xB6C6F663 [libj9prt29.so+0x3b663])\n4XENATIVESTACK               (0xB6C52F6E [libj9prt29.so+0x1ef6e])\n4XENATIVESTACK               (0xB6C6F1CE [libj9prt29.so+0x3b1ce])\n4XENATIVESTACK               (0xB6C6F2C6 [libj9prt29.so+0x3b2c6])\n4XENATIVESTACK               (0xB6C6ED93 [libj9prt29.so+0x3ad93])\n4XENATIVESTACK               (0xB6C52F6E [libj9prt29.so+0x1ef6e])\n4XENATIVESTACK               (0xB6C6ED07 [libj9prt29.so+0x3ad07])\n4XENATIVESTACK               (0xB6C6AA3D [libj9prt29.so+0x36a3d])\n4XENATIVESTACK               (0xB6C6C3A4 [libj9prt29.so+0x383a4])\n4XENATIVESTACK               (0xB667FA19 [libj9dmp29.so+0xfa19])\n4XENATIVESTACK               (0xB6C52F6E [libj9prt29.so+0x1ef6e])\n4XENATIVESTACK               (0xB66878CF [libj9dmp29.so+0x178cf])\n4XENATIVESTACK               (0xB6688083 [libj9dmp29.so+0x18083])\n4XENATIVESTACK               (0xB6C52F6E [libj9prt29.so+0x1ef6e])\n4XENATIVESTACK               (0xB6680C0D [libj9dmp29.so+0x10c0d])\n4XENATIVESTACK               (0xB667F9D7 [libj9dmp29.so+0xf9d7])\n4XENATIVESTACK               (0xB6C52F6E [libj9prt29.so+0x1ef6e])\n4XENATIVESTACK               (0xB668B02F [libj9dmp29.so+0x1b02f])\n4XENATIVESTACK               (0xB668B4D3 [libj9dmp29.so+0x1b4d3])\n4XENATIVESTACK               (0xB66740F1 [libj9dmp29.so+0x40f1])\n4XENATIVESTACK               (0xB66726FA [libj9dmp29.so+0x26fa])\n4XENATIVESTACK               (0xB6C52F6E [libj9prt29.so+0x1ef6e])\n4XENATIVESTACK               (0xB66726A9 [libj9dmp29.so+0x26a9])\n4XENATIVESTACK               (0xB6676AE4 [libj9dmp29.so+0x6ae4])\n4XENATIVESTACK               (0xB668D75A [libj9dmp29.so+0x1d75a])\n4XENATIVESTACK               (0xB6A28DD4 [libj9vm29.so+0x81dd4])\n4XENATIVESTACK               (0xB6C52F6E [libj9prt29.so+0x1ef6e])\n4XENATIVESTACK               (0xB6A289EE [libj9vm29.so+0x819ee])\n4XENATIVESTACK               (0xB6A29A40 [libj9vm29.so+0x82a40])\n4XENATIVESTACK               (0xB6C52B6A [libj9prt29.so+0x1eb6a])\n4XENATIVESTACK               __kernel_rt_sigreturn+0x0 (0xB7747410)\n4XENATIVESTACK               (0xB75330B6 [libffi29.so+0x50b6])\n4XENATIVESTACK               ffi_raw_call+0xad (0xB7531C53 [libffi29.so+0x3c53])\n4XENATIVESTACK               (0xB69BE4AB [libj9vm29.so+0x174ab])\n4XENATIVESTACK               (0xB6A665BC [libj9vm29.so+0xbf5bc])\n4XENATIVESTACK               (0xB6A15552 [libj9vm29.so+0x6e552])\n4XENATIVESTACK               (0xB6A30894 [libj9vm29.so+0x89894])\n4XENATIVESTACK               (0xB6A6F169 [libj9vm29.so+0xc8169])\n4XENATIVESTACK               (0xB6C52F6E [libj9prt29.so+0x1ef6e])\n4XENATIVESTACK               (0xB6A6F1FA [libj9vm29.so+0xc81fa])\n4XENATIVESTACK               (0xB6A30994 [libj9vm29.so+0x89994])\n4XENATIVESTACK               (0xB6A2CE4C [libj9vm29.so+0x85e4c])\n4XENATIVESTACK               (0xB770487D [libjli.so+0x787d])\n4XENATIVESTACK               (0xB7719F72 [libpthread.so.0+0x6f72])\n4XENATIVESTACK               clone+0x5e (0xB763543E [libc.so.6+0xee43e])\n

The extract tells you that the current thread was java/lang/Thread, and information is provided about the Java call stack and native call stack (3XMTHREADINFO3) at the point at which the crash occurred. To simulate a crash caused by a bug in an application, this example calls a JNI method whose native implementation causes a crash. The Java call stack shows the call to the JNI native method (JNIcrasher), and the native call stack shows the point of failure. In this example, the native call stack does not include any function names to help you isolate the error in the native code. You can get this information from a system dump, which is usually produced alongside the Java dump. Open the system dump with the Dump viewer and use the info thread command to print the Java and native stack for the current thread.

The next time you run the application, you can use the -XX:+ShowNativeStackSymbols=all command line option to display the corresponding function names in the native call stack.

4XENATIVESTACK               protectedBacktrace+0x12 (0x00007F3F9213E312 [libj9prt29.so+0x25312])\n4XENATIVESTACK               omrsig_protect+0x1e3 (0x00007F3F92142AD3 [libj9prt29.so+0x29ad3])\n4XENATIVESTACK               omrintrospect_backtrace_thread_raw+0xbf (0x00007F3F9213E80F [libj9prt29.so+0x2580f])\n4XENATIVESTACK               omrsig_protect+0x1e3 (0x00007F3F92142AD3 [libj9prt29.so+0x29ad3])\n4XENATIVESTACK               omrintrospect_backtrace_thread+0x70 (0x00007F3F9213E1D0 [libj9prt29.so+0x251d0])\n4XENATIVESTACK               setup_native_thread+0x1d2 (0x00007F3F9213F652 [libj9prt29.so+0x26652])\n4XENATIVESTACK               omrintrospect_threads_startDo_with_signal+0x474 (0x00007F3F921403F4 [libj9prt29.so+0x273f4])\n4XENATIVESTACK               omrsig_protect+0x1e3 (0x00007F3F92142AD3 [libj9prt29.so+0x29ad3])\n
"},{"location":"dump_javadump/#java-outofmemoryerror","title":"Java OutOfMemoryError","text":"

In this scenario, the Java heap runs out of memory, causing an OutOfMemoryError, which automatically generates a Java dump file.

The first section of the file (TITLE) tells you that a systhrow event triggered the Java dump as a result of an OOM (java/lang/OutOfMemoryError) for Java heap space.

0SECTION       TITLE subcomponent dump routine\nNULL           ===============================\n1TICHARSET     UTF-8\n1TISIGINFO     Dump Event \"systhrow\" (00040000) Detail \"java/lang/OutOfMemoryError\" \"Java heap space\" received\n1TIDATETIMEUTC Date: 2021/04/23 at 18:02:44:017 (UTC)\n1TIDATETIME    Date: 2021/04/23 at 14:02:44:017\n1TITIMEZONE    Timezone: UTC-4 (EDT)\n1TINANOTIME    System nanotime: 379202644260787\n1TIFILENAME    Javacore filename:    /home/cheesemp/test/javacore.20210423.140244.18885.0003.txt\n1TIREQFLAGS    Request Flags: 0x81 (exclusive+preempt)\n1TIPREPSTATE   Prep State: 0x104 (exclusive_vm_access+trace_disabled)\n

The MEMINFO section records how much memory is allocated to the Java heap (1STHEAPTYPE Object Memory), how much is in use, and how much is free. Solving your problem might be as simple as setting a larger heap size when you start your application.

If you don't know what size the Java heap was set to, you might find that information in the ENVINFO section, which records the command-line options that were used when the application started. Look or search for the 1CIUSERARGS UserArgs: string and review the entries that are recorded for all lines that start 2CIUSERARG. The Java heap size is set by the -Xmx option. If the size has not been set on the command line by -Xmx, the default value applies, which you can find in Default Settings.

In this scenario, the solution to the problem is not an adjustment to the Java heap size. Here is the MEMINFO section:

0SECTION       MEMINFO subcomponent dump routine\nNULL           =================================\nNULL\n1STHEAPTYPE    Object Memory\nNULL           id         start      end        size       space/region\n1STHEAPSPACE   0xB6B49D20     --         --         --     Generational\n1STHEAPREGION  0xB6B4A078 0x95750000 0xB5470000 0x1FD20000 Generational/Tenured Region\n1STHEAPREGION  0xB6B49F10 0xB5470000 0xB54C0000 0x00050000 Generational/Nursery Region\n1STHEAPREGION  0xB6B49DA8 0xB54C0000 0xB5750000 0x00290000 Generational/Nursery Region\nNULL\n1STHEAPTOTAL   Total memory:         536870912 (0x20000000)\n1STHEAPINUSE   Total memory in use:  302603160 (0x12095B98)\n1STHEAPFREE    Total memory free:    234267752 (0x0DF6A468)\n

The output shows that only 56% of the Java heap is in use, so this suggests that the application is trying to do something suboptimal. To investigate further, you need to work out which thread was the current thread when the OOM occurred to see what it was trying to do. As in the previous scenario, you can find the current thread in the THREADS section. Here is an extract from the output:

0SECTION       THREADS subcomponent dump routine\nNULL           =================================\nNULL\n1XMPOOLINFO    JVM Thread pool info:\n2XMPOOLTOTAL       Current total number of pooled threads: 16\n2XMPOOLLIVE        Current total number of live threads: 16\n2XMPOOLDAEMON      Current total number of live daemon threads: 15\nNULL\n1XMCURTHDINFO  Current thread\n3XMTHREADINFO      \"main\" J9VMThread:0xB6B60C00, omrthread_t:0xB6B049D8, java/lang/Thread:0x95764520, state:R, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x1, isDaemon:false)\n3XMTHREADINFO1            (native thread ID:0x49C6, native priority:0x5, native policy:UNKNOWN, vmstate:R, vm thread flags:0x00001020)\n3XMTHREADINFO2            (native stack address range from:0xB6CB5000, to:0xB74B6000, size:0x801000)\n3XMCPUTIME               CPU usage total: 8.537823831 secs, current category=\"Application\"\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=0 (0x0)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at java/lang/StringBuffer.ensureCapacityImpl(StringBuffer.java:696)\n4XESTACKTRACE                at java/lang/StringBuffer.append(StringBuffer.java:486(Compiled Code))\n5XESTACKTRACE                   (entered lock: java/lang/StringBuffer@0x957645B8, entry count: 1)\n4XESTACKTRACE                at java/lang/StringBuffer.append(StringBuffer.java:428(Compiled Code))\n4XESTACKTRACE                at HeapBreaker.main(HeapBreaker.java:34(Compiled Code))\n3XMTHREADINFO3           Native callstack:\n4XENATIVESTACK               (0xB6C535B3 [libj9prt29.so+0x3b5b3])\n4XENATIVESTACK               (0xB6C36F3E [libj9prt29.so+0x1ef3e])\n4XENATIVESTACK               (0xB6C5311E [libj9prt29.so+0x3b11e])\n4XENATIVESTACK               (0xB6C53216 [libj9prt29.so+0x3b216])\n4XENATIVESTACK               (0xB6C52CE3 [libj9prt29.so+0x3ace3])\n4XENATIVESTACK               (0xB6C36F3E [libj9prt29.so+0x1ef3e])\n4XENATIVESTACK               (0xB6C52C57 [libj9prt29.so+0x3ac57])\n4XENATIVESTACK               (0xB6C4E9CD [libj9prt29.so+0x369cd])\n4XENATIVESTACK               (0xB6C502FA [libj9prt29.so+0x382fa])\n

To simulate a Java OutOfMemoryError, this example application repeatedly appends characters to a StringBuffer object in an infinite loop. The Java call stack shows the HeapBreaker.main method appending characters (java/lang/StringGuffer.append) until the method java/lang/StringBuffer.ensureCapacityImpl() throws the OutOfMemoryError.

StringBuffer objects are wrappers for character arrays (char[]) and when the capacity of the underlying array is reached, the contents are automatically copied into a new, larger array. The new array is created in the StringBuffer.ensureCapacity() method, which more or less doubles the size of the old array. In this scenario, the array takes up all the remaining space in the Java heap.

The MEMINFO section of the Java dump file can also tell you when an unexpectedly large allocation request causes an OOM. Look for the GC History (1STGCHTYPE) section, which details allocation requests that trigger GC activity. In the sample output you can see that a large allocation request (requestedbytes=603979784) triggered a global GC. When the GC could not free up sufficient space in the heap to satisfy the request, the allocation failure generated the OOM.

1STGCHTYPE     GC History\n3STHSTTYPE     14:29:29:580239000 GMT j9mm.101 -   J9AllocateIndexableObject() returning NULL! 0 bytes requested for object of class B6BBC300 from memory space 'Generational' id=B6B49D20\n3STHSTTYPE     14:29:29:579916000 GMT j9mm.134 -   Allocation failure end: newspace=2686912/3014656 oldspace=231597224/533856256 loa=5338112/5338112\n3STHSTTYPE     14:29:29:579905000 GMT j9mm.470 -   Allocation failure cycle end: newspace=2686912/3014656 oldspace=231597224/533856256 loa=5338112/5338112\n3STHSTTYPE     14:29:29:579859000 GMT j9mm.475 -   GlobalGC end: workstackoverflow=0 overflowcount=0 memory=234284136/536870912\n3STHSTTYPE     14:29:29:579807000 GMT j9mm.90 -   GlobalGC collect complete\n3STHSTTYPE     14:29:29:579776000 GMT j9mm.137 -   Compact end: bytesmoved=301989896\n3STHSTTYPE     14:29:29:313899000 GMT j9mm.136 -   Compact start: reason=compact to meet allocation\n3STHSTTYPE     14:29:29:313555000 GMT j9mm.57 -   Sweep end\n3STHSTTYPE     14:29:29:310772000 GMT j9mm.56 -   Sweep start\n3STHSTTYPE     14:29:29:310765000 GMT j9mm.94 -   Class unloading end: classloadersunloaded=0 classesunloaded=0\n3STHSTTYPE     14:29:29:310753000 GMT j9mm.60 -   Class unloading start\n3STHSTTYPE     14:29:29:310750000 GMT j9mm.55 -   Mark end\n3STHSTTYPE     14:29:29:306013000 GMT j9mm.54 -   Mark start\n3STHSTTYPE     14:29:29:305957000 GMT j9mm.474 -   GlobalGC start: globalcount=9\n3STHSTTYPE     14:29:29:305888000 GMT j9mm.475 -   GlobalGC end: workstackoverflow=0 overflowcount=0 memory=234284136/536870912\n3STHSTTYPE     14:29:29:305837000 GMT j9mm.90 -   GlobalGC collect complete\n3STHSTTYPE     14:29:29:305808000 GMT j9mm.137 -   Compact end: bytesmoved=189784\n3STHSTTYPE     14:29:29:298042000 GMT j9mm.136 -   Compact start: reason=compact to meet allocation\n3STHSTTYPE     14:29:29:297695000 GMT j9mm.57 -   Sweep end\n3STHSTTYPE     14:29:29:291696000 GMT j9mm.56 -   Sweep start\n3STHSTTYPE     14:29:29:291692000 GMT j9mm.55 -   Mark end\n3STHSTTYPE     14:29:29:284994000 GMT j9mm.54 -   Mark start\n3STHSTTYPE     14:29:29:284941000 GMT j9mm.474 -   GlobalGC start: globalcount=8\n3STHSTTYPE     14:29:29:284916000 GMT j9mm.135 -   Exclusive access: exclusiveaccessms=0.016 meanexclusiveaccessms=0.016 threads=0 lastthreadtid=0xB6B61100 beatenbyotherthread=0\n3STHSTTYPE     14:29:29:284914000 GMT j9mm.469 -   Allocation failure cycle start: newspace=2678784/3014656 oldspace=80601248/533856256 loa=5338112/5338112 requestedbytes=603979784\n3STHSTTYPE     14:29:29:284893000 GMT j9mm.470 -   Allocation failure cycle end: newspace=2678784/3014656 oldspace=80601248/533856256 loa=5338112/5338112\n3STHSTTYPE     14:29:29:284858000 GMT j9mm.560 -   LocalGC end: rememberedsetoverflow=0 causedrememberedsetoverflow=0 scancacheoverflow=0 failedflipcount=0 failedflipbytes=0 failedtenurecount=0 failedtenurebytes=0 flipcount=2 flipbytes=64 newspace=2678784/3014656 oldspace=80601248/533856256 loa=5338112/5338112 tenureage=0\n3STHSTTYPE     14:29:29:284140000 GMT j9mm.140 -   Tilt ratio: 89\n3STHSTTYPE     14:29:29:283160000 GMT j9mm.64 -   LocalGC start: globalcount=8 scavengecount=335 weakrefs=0 soft=0 phantom=0 finalizers=0\n3STHSTTYPE     14:29:29:283123000 GMT j9mm.135 -   Exclusive access: exclusiveaccessms=0.016 meanexclusiveaccessms=0.016 threads=0 lastthreadtid=0xB6B61100 beatenbyotherthread=0\n3STHSTTYPE     14:29:29:283120000 GMT j9mm.469 -   Allocation failure cycle start: newspace=753616/3014656 oldspace=80601248/533856256 loa=5338112/5338112 requestedbytes=603979784\n3STHSTTYPE     14:29:29:283117000 GMT j9mm.133 -   Allocation failure start: newspace=753616/3014656 oldspace=80601248/533856256 loa=5338112/5338112 requestedbytes=603979784\n3STHSTTYPE     14:29:29:269762000 GMT j9mm.134 -   Allocation failure end: newspace=2686928/3014656 oldspace=80601248/533856256 loa=5338112/5338112\n3STHSTTYPE     14:29:29:269751000 GMT j9mm.470 -   Allocation failure cycle end: newspace=2686976/3014656 oldspace=80601248/533856256 loa=5338112/5338112\n3STHSTTYPE     14:29:29:269718000 GMT j9mm.560 -   LocalGC end: rememberedsetoverflow=0 causedrememberedsetoverflow=0 scancacheoverflow=0 failedflipcount=0 failedflipbytes=0 failedtenurecount=0 failedtenurebytes=0 flipcount=0 flipbytes=0 newspace=2686976/3014656 oldspace=80601248/533856256 loa=5338112/5338112 tenureage=0\n3STHSTTYPE     14:29:29:268981000 GMT j9mm.140 -   Tilt ratio: 89\n3STHSTTYPE     14:29:29:268007000 GMT j9mm.64 -   LocalGC start: globalcount=8 scavengecount=334 weakrefs=0 soft=0 phantom=0 finalizers=0\n3STHSTTYPE     14:29:29:267969000 GMT j9mm.135 -   Exclusive access: exclusiveaccessms=0.016 meanexclusiveaccessms=0.016 threads=0 lastthreadtid=0xB6B61100 beatenbyotherthread=0\n3STHSTTYPE     14:29:29:267966000 GMT j9mm.469 -   Allocation failure cycle start: newspace=0/3014656 oldspace=80601248/533856256 loa=5338112/5338112 requestedbytes=48\n3STHSTTYPE     14:29:29:267963000 GMT j9mm.133 -   Allocation failure start: newspace=0/3014656 oldspace=80601248/533856256 loa=5338112/5338112 requestedbytes=48\n3STHSTTYPE     14:29:29:249015000 GMT j9mm.134 -   Allocation failure end: newspace=2686928/3014656 oldspace=80601248/533856256 loa=5338112/5338112\n3STHSTTYPE     14:29:29:249003000 GMT j9mm.470 -   Allocation failure cycle end: newspace=2686976/3014656 oldspace=80601248/533856256 loa=5338112/5338112\n3STHSTTYPE     14:29:29:248971000 GMT j9mm.560 -   LocalGC end: rememberedsetoverflow=0 causedrememberedsetoverflow=0 scancacheoverflow=0 failedflipcount=0 failedflipbytes=0 failedtenurecount=0 failedtenurebytes=0 flipcount=0 flipbytes=0 newspace=2686976/3014656 oldspace=80601248/533856256 loa=5338112/5338112 tenureage=0\n

Although the Java code that was used in this scenario deliberately triggered an OutOfMemoryError in a pronounced way, similar allocation issues can and do occur when dealing with large data sets such as XML files.

The next step in diagnosing the problem is to open the system dump that gets generated automatically when an OutOfMemoryError occurs. Open the dump with the Eclipse Memory Analyzer\u2122 tool (MAT) and search for the StringBuffer object, which should provide further clues about what went wrong. A common example is seeing the same String duplicated over and over again, which might indicate that code is stuck in a loop.

Note: If you want to use MAT to analyze your system dump, you must install the Diagnostic Tool Framework for Java (DTFJ) plug-in in the Eclipse IDE. Select the following menu items:

Help > Install New Software > Work with \"IBM Diagnostic Tool Framework for Java\" >\n

If, unlike the previous scenario, you receive an OutOfMemoryError and the MEMINFO section shows that there is very little space left on the Java heap, the current thread information is typically not important. The current thread is simply the thread that happened to be current when the space ran out. In this situation, you might want to increase your Java heap size. For help with this task, see How to do heap sizing.

"},{"location":"dump_javadump/#native-outofmemoryerror","title":"Native OutOfMemoryError","text":"

In this scenario, the VM runs out of native memory. Native memory is memory that is used by the VM for storing all virtualized resources and data that it needs for VM operations. Native memory that is available to the VM process is limited by the operating system. The native memory available to the VM might also be subject to additional limits imposed by the operating system, for example Unix ulimits.

When a NativeOutOfMemoryError occurs, a Java dump is generated by default. The first section of the file (TITLE) tells you that a systhrow event triggered the Java dump as a result of an OOM (java/lang/OutOfMemoryError) for native memory.

0SECTION       TITLE subcomponent dump routine\nNULL           ===============================\n1TICHARSET     UTF-8\n1TISIGINFO     Dump Event \"systhrow\" (00040000) Detail \"java/lang/OutOfMemoryError\" \"native memory exhausted\" received\n1TIDATETIMEUTC Date: 2021/04/23 at 18:02:44:017 (UTC)\n1TIDATETIME    Date: 2021/04/23 at 14:02:44:017\n1TITIMEZONE    Timezone: UTC-4 (EDT)\n1TINANOTIME    System nanotime: 379202644260787\n1TIFILENAME    Javacore filename:    /home/cheesemp/test/javacore.20210423.140244.19708.0003.txt\n1TIREQFLAGS    Request Flags: 0x81 (exclusive+preempt)\n1TIPREPSTATE   Prep State: 0x104 (exclusive_vm_access+trace_disabled)\n

Sometimes, the current thread is responsible for causing the NativeOutOfMemoryError. Information about the current thread can be found in the THREADS section, as shown in the following output.

0SECTION       THREADS subcomponent dump routine\nNULL           =================================\nNULL\n1XMPOOLINFO    JVM Thread pool info:\n2XMPOOLTOTAL       Current total number of pooled threads: 16\n2XMPOOLLIVE        Current total number of live threads: 16\n2XMPOOLDAEMON      Current total number of live daemon threads: 15\nNULL\n1XMCURTHDINFO  Current thread\n3XMTHREADINFO      \"main\" J9VMThread:0xB6C60C00, omrthread_t:0xB6C049D8, java/lang/Thread:0xB55E3C10, state:R, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x1, isDaemon:false)\n3XMTHREADINFO1            (native thread ID:0x4CFD, native priority:0x5, native policy:UNKNOWN, vmstate:R, vm thread flags:0x00001020)\n3XMTHREADINFO2            (native stack address range from:0xB6D4E000, to:0xB754F000, size:0x801000)\n3XMCPUTIME               CPU usage total: 3.654896026 secs, current category=\"Application\"\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=0 (0x0)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at sun/misc/Unsafe.allocateDBBMemory(Native Method)\n4XESTACKTRACE                at java/nio/DirectByteBuffer.<init>(DirectByteBuffer.java:127(Compiled Code))\n4XESTACKTRACE                at java/nio/ByteBuffer.allocateDirect(ByteBuffer.java:311)\n4XESTACKTRACE                at NativeHeapBreaker.main(NativeHeapBreaker.java:9)\n3XMTHREADINFO3           Native callstack:\n4XENATIVESTACK               (0xB6A9F5B3 [libj9prt29.so+0x3b5b3])\n...\n4XENATIVESTACK               (0xB582CC9C [libjclse7b_29.so+0x40c9c])\n4XENATIVESTACK               Java_sun_misc_Unsafe_allocateDBBMemory+0x88 (0xB5827F6B [libjclse7b_29.so+0x3bf6b])\n4XENATIVESTACK               (0x94A2084A [<unknown>+0x0])\n4XENATIVESTACK               (0xB6B2538B [libj9vm29.so+0x6c38b])\n4XENATIVESTACK               (0xB6B4074C [libj9vm29.so+0x8774c])\n4XENATIVESTACK               (0xB6B7F299 [libj9vm29.so+0xc6299])\n4XENATIVESTACK               (0xB6A82F3E [libj9prt29.so+0x1ef3e])\n4XENATIVESTACK               (0xB6B7F32A [libj9vm29.so+0xc632a])\n4XENATIVESTACK               (0xB6B4084C [libj9vm29.so+0x8784c])\n4XENATIVESTACK               (0xB6B3CD0C [libj9vm29.so+0x83d0c])\n4XENATIVESTACK               (0xB776F87D [libjli.so+0x787d])\n4XENATIVESTACK               (0xB7784F72 [libpthread.so.0+0x6f72])\n4XENATIVESTACK               clone+0x5e (0xB76A043E [libc.so.6+0xee43e])\n

For clarity in the Native callstack output, ... indicates that some lines are removed.

The Java call stack shows the transition from Java to native code (sun/misc/Unsafe.allocateDBBMemory(Native Method)), indicating a request for Direct Byte Buffer (DBB) storage. DBB storage is backed by native memory, with the Java heap containing only a reference to the native heap buffer. In this scenario, DBB storage is the likely culprit for this NativeOutOfMemoryError.

The next step is to investigate the NATIVEMEMINFO section of the Java dump file, which reports the amount of memory used by the JRE process, broken down into component areas.

0SECTION       NATIVEMEMINFO subcomponent dump routine\nNULL           =================================\n0MEMUSER\n1MEMUSER       JRE: 3,166,386,688 bytes / 4388 allocations\n1MEMUSER       |\n2MEMUSER       +--VM: 563,176,824 bytes / 1518 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Classes: 3,104,416 bytes / 120 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Memory Manager (GC): 548,181,888 bytes / 398 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Java Heap: 536,932,352 bytes / 1 allocation\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Other: 11,249,536 bytes / 397 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Threads: 10,817,120 bytes / 147 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Java Stack: 115,584 bytes / 16 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Native Stack: 10,616,832 bytes / 17 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Other: 84,704 bytes / 114 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Trace: 163,688 bytes / 268 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--JVMTI: 17,320 bytes / 13 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--JNI: 23,296 bytes / 55 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Port Library: 8,576 bytes / 74 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Other: 860,520 bytes / 443 allocations\n1MEMUSER       |\n2MEMUSER       +--JIT: 3,744,728 bytes / 122 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--JIT Code Cache: 2,097,152 bytes / 1 allocation\n2MEMUSER       |  |\n3MEMUSER       |  +--JIT Data Cache: 524,336 bytes / 1 allocation\n2MEMUSER       |  |\n3MEMUSER       |  +--Other: 1,123,240 bytes / 120 allocations\n1MEMUSER       |\n2MEMUSER       +--Class Libraries: 2,599,463,024 bytes / 2732 allocations\n2MEMUSER       |  |\n3MEMUSER       |  +--Harmony Class Libraries: 1,024 bytes / 1 allocation\n2MEMUSER       |  |\n3MEMUSER       |  +--VM Class Libraries: 2,599,462,000 bytes / 2731 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--sun.misc.Unsafe: 2,598,510,480 bytes / 2484 allocations\n4MEMUSER       |  |  |  |\n5MEMUSER       |  |  |  +--Direct Byte Buffers: 2,598,510,480 bytes / 2484 allocations\n3MEMUSER       |  |  |\n4MEMUSER       |  |  +--Other: 951,520 bytes / 247 allocations\n1MEMUSER       |\n2MEMUSER       +--Unknown: 2,112 bytes / 16 allocations\nNULL\n

In the VM Class Libraries section, the amount of memory allocated for Direct Byte Buffers is shown. Because the NativeOutOfMemoryError was received on a small 32-bit system, a value of 2,598,510,480 bytes indicates that the operating system has run out of memory. On a larger UNIX\u00ae system, the process might have run out of memory because of the ulimit setting. Increasing the value for ulimit might avoid the error, which you can do temporarily by setting ulimit -f unlimited in your current session.

The theoretical maximum size for a 32-bit process is the size of the 32-bit address space, which is 4 GB. On most operating systems, a portion of the address space for each process is used by the kernel, such that the real limit for 32-bit processes is actually significantly less than 4 GB. As a result, running out of native memory with a 32-bit VM is quite common.

The same 4 GB limit is also important if you are using a 64-bit VM with compressed references. In compressed references mode, all references to objects, classes, threads, and monitors are represented by 32-bit values for performance reasons, so these structures can be allocated only at 32-bit addresses. However, the operating system might place other allocations within this 4 GB of address space, and if this area becomes sufficiently full or fragmented, the VM throws a native NativeOutOfMemoryError error. These errors typically occur when the VM tries to create a new thread or load a class. The Current Thread History section should contain more information about what the thread was doing at the VM level when the NativeOutOfMemoryError error occurred.

You can usually avoid this type of problem by using the -Xmcrs option to reserve a contiguous area of memory within the lowest 4 GB of memory at VM startup.

Another common cause of a NativeOutOfMemoryError is when an application loads duplicate classes. Classes are allocated outside of the Java heap in native memory. If the value reported for Classes in the NATIVEMEMINFO section is very large, duplicate classes might be the cause of your problem. The Eclipse Memory Analyzer tool (MAT) can tell you if you have duplicate classes by using the Class Loader Explorer feature. Because a system dump is automatically generated as well as a Java dump in response to a NativeOutOfMemoryError, simply open the system dump in MAT to continue your diagnosis.

"},{"location":"dump_javadump/#deadlock","title":"Deadlock","text":"

Deadlocks occur when two threads attempt to synchronize on an object and lock an instance of a class. When this happens, your application stops responding and hangs. Generating a Java dump file will quickly tell you whether you have a deadlock situation. Trigger the Java dump by sending a SIGQUIT signal (kill -3) to the VM.

The VM can detect the most common types of deadlock scenario involving Java monitors. If this type of deadlock is detected, information is provided in the LOCKS section. More complex deadlocks, including those that involve a mixture of native mutexes and Java monitors, are not detected.

Here is the output from the code that was used to cause a common deadlock scenario:

NULL\n1LKDEADLOCK    Deadlock detected !!!\nNULL           ---------------------\nNULL\n2LKDEADLOCKTHR  Thread \"Worker Thread 2\" (0x94501D00)\n3LKDEADLOCKWTR    is waiting for:\n4LKDEADLOCKMON      sys_mon_t:0x08C2B344 infl_mon_t: 0x08C2B384:\n4LKDEADLOCKOBJ      java/lang/Object@0xB5666698\n3LKDEADLOCKOWN    which is owned by:\n2LKDEADLOCKTHR  Thread \"Worker Thread 3\" (0x94507500)\n3LKDEADLOCKWTR    which is waiting for:\n4LKDEADLOCKMON      sys_mon_t:0x08C2B3A0 infl_mon_t: 0x08C2B3E0:\n4LKDEADLOCKOBJ      java/lang/Object@0xB5666678\n3LKDEADLOCKOWN    which is owned by:\n2LKDEADLOCKTHR  Thread \"Worker Thread 1\" (0x92A3EC00)\n3LKDEADLOCKWTR    which is waiting for:\n4LKDEADLOCKMON      sys_mon_t:0x08C2B2E8 infl_mon_t: 0x08C2B328:\n4LKDEADLOCKOBJ      java/lang/Object@0xB5666688\n3LKDEADLOCKOWN    which is owned by:\n2LKDEADLOCKTHR  Thread \"Worker Thread 2\" (0x94501D00)\n

This output tells you that Worker Thread 2 is waiting for Worker Thread 3, which is waiting for Worker Thread 1. Because Worker Thread 1 is also waiting for Worker Thread 2, there is a deadlock. The next place to look is the output for Java and native stacks, in the THREADS section. By looking at the stack for each of these worker threads, you can trace the problem back to specific lines in your application code.

In this example, you can see from the following output that for all worker threads, the stack traces (4XESTACKTRACE/5XESTACKTRACE) indicate a problem in line 35 of the application DeadLockTest.java:

3XMTHREADINFO      \"Worker Thread 1\" J9VMThread:0x92A3EC00, omrthread_t:0x92A3C2B0, java/lang/Thread:0xB5666778, state:B, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x13, isDaemon:false)\n3XMTHREADINFO1            (native thread ID:0x52CF, native priority:0x5, native policy:UNKNOWN, vmstate:B, vm thread flags:0x00000201)\n3XMTHREADINFO2            (native stack address range from:0x9297E000, to:0x929BF000, size:0x41000)\n3XMCPUTIME               CPU usage total: 0.004365543 secs, current category=\"Application\"\n3XMTHREADBLOCK     Blocked on: java/lang/Object@0xB5666688 Owned by: \"Worker Thread 2\" (J9VMThread:0x94501D00, java/lang/Thread:0xB56668D0)\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=0 (0x0)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at WorkerThread.run(DeadLockTest.java:35)\n5XESTACKTRACE                   (entered lock: java/lang/Object@0xB5666678, entry count: 1)\n...\n3XMTHREADINFO      \"Worker Thread 2\" J9VMThread:0x94501D00, omrthread_t:0x92A3C8F0, java/lang/Thread:0xB56668D0, state:B, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x14, isDaemon:false)\n3XMTHREADINFO1            (native thread ID:0x52D0, native priority:0x5, native policy:UNKNOWN, vmstate:B, vm thread flags:0x00000201)\n3XMTHREADINFO2            (native stack address range from:0x946BF000, to:0x94700000, size:0x41000)\n3XMCPUTIME               CPU usage total: 0.004555580 secs, current category=\"Application\"\n3XMTHREADBLOCK     Blocked on: java/lang/Object@0xB5666698 Owned by: \"Worker Thread 3\" (J9VMThread:0x94507500, java/lang/Thread:0xB5666A18)\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=0 (0x0)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at WorkerThread.run(DeadLockTest.java:35)\n5XESTACKTRACE                   (entered lock: java/lang/Object@0xB5666688, entry count: 1)\n...\n3XMTHREADINFO      \"Worker Thread 3\" J9VMThread:0x94507500, omrthread_t:0x92A3CC10, java/lang/Thread:0xB5666A18, state:B, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x15, isDaemon:false)\n3XMTHREADINFO1            (native thread ID:0x52D1, native priority:0x5, native policy:UNKNOWN, vmstate:B, vm thread flags:0x00000201)\n3XMTHREADINFO2            (native stack address range from:0x9467E000, to:0x946BF000, size:0x41000)\n3XMCPUTIME               CPU usage total: 0.003657010 secs, current category=\"Application\"\n3XMTHREADBLOCK     Blocked on: java/lang/Object@0xB5666678 Owned by: \"Worker Thread 1\" (J9VMThread:0x92A3EC00, java/lang/Thread:0xB5666778)\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=0 (0x0)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at WorkerThread.run(DeadLockTest.java:35)\n5XESTACKTRACE                   (entered lock: java/lang/Object@0xB5666698, entry count: 1)\n
"},{"location":"dump_javadump/#hang","title":"Hang","text":"

An application can hang for a number of reasons but the most common cause is excessive global garbage collection (GC) activity, where your application is repeatedly paused because your Java heap has almost run out of memory. You can identify this problem by looking at verbose GC output. Collect this output by specifying the -verbose:gc option.

Deadlock situations can also manifest themselves as hangs. For more information on diagnosing this type of problem from a Java dump, see the deadlock scenario.

If you have eliminated verbose GC activity and deadlocks, another common hang scenario involves threads that compete and wait for Java object locks. This type of problem can usually be diagnosed by examining a Java dump. The simplest hang scenario involving Java object locks is where a thread acquires a lock that other threads are waiting for, but it doesn't release the lock for some reason.

The first place to look in the Java dump output is the LOCKS section. This section lists all the monitors and shows which threads have acquired a lock and which threads are waiting. If the hang is caused by a thread not releasing a lock that other threads need, you can see a list of waiting threads in the output.

In this example scenario, the Java dump LOCKS section shows that Worker Thread 0 (3LKMONOBJECT) has acquired a lock and there are 19 other worker threads waiting to obtain the lock.

NULL           ------------------------------------------------------------------------\n0SECTION       LOCKS subcomponent dump routine\nNULL           ===============================\nNULL\n1LKPOOLINFO    Monitor pool info:\n2LKPOOLTOTAL     Current total number of monitors: 1\nNULL\n1LKMONPOOLDUMP Monitor Pool Dump (flat & inflated object-monitors):\n2LKMONINUSE      sys_mon_t:0x92711200 infl_mon_t: 0x92711240:\n3LKMONOBJECT       java/lang/Object@0xB56658D8: Flat locked by \"Worker Thread 0\" (J9VMThread:0x92A3EC00), entry count 1\n3LKWAITERQ            Waiting to enter:\n3LKWAITER                \"Worker Thread 1\" (J9VMThread:0x92703F00)\n3LKWAITER                \"Worker Thread 2\" (J9VMThread:0x92709C00)\n3LKWAITER                \"Worker Thread 3\" (J9VMThread:0x92710A00)\n3LKWAITER                \"Worker Thread 4\" (J9VMThread:0x92717F00)\n3LKWAITER                \"Worker Thread 5\" (J9VMThread:0x9271DC00)\n3LKWAITER                \"Worker Thread 6\" (J9VMThread:0x92723A00)\n3LKWAITER                \"Worker Thread 7\" (J9VMThread:0x92729800)\n3LKWAITER                \"Worker Thread 8\" (J9VMThread:0x92733700)\n3LKWAITER                \"Worker Thread 9\" (J9VMThread:0x92739400)\n3LKWAITER                \"Worker Thread 10\" (J9VMThread:0x92740200)\n3LKWAITER                \"Worker Thread 11\" (J9VMThread:0x92748100)\n3LKWAITER                \"Worker Thread 12\" (J9VMThread:0x9274DF00)\n3LKWAITER                \"Worker Thread 13\" (J9VMThread:0x92754D00)\n3LKWAITER                \"Worker Thread 14\" (J9VMThread:0x9275AA00)\n3LKWAITER                \"Worker Thread 15\" (J9VMThread:0x92760800)\n3LKWAITER                \"Worker Thread 16\" (J9VMThread:0x92766600)\n3LKWAITER                \"Worker Thread 17\" (J9VMThread:0x9276C300)\n3LKWAITER                \"Worker Thread 18\" (J9VMThread:0x92773100)\n3LKWAITER                \"Worker Thread 19\" (J9VMThread:0x92778F00)\nNULL\n

The next step is to determine why Worker Thread 0 is not releasing the lock. The best place to start is the stack trace for this thread, which you can find by searching on the thread name or J9VMThread ID in the THREADS section.

The following extract shows the details for \"Worker Thread 0\" (J9VMThread:0x92A3EC00):

NULL\n3XMTHREADINFO      \"Worker Thread 0\" J9VMThread:0x92A3EC00, omrthread_t:0x92A3C280, java/lang/Thread:0xB56668B8, state:CW, prio=5\n3XMJAVALTHREAD            (java/lang/Thread getId:0x13, isDaemon:false)\n3XMTHREADINFO1            (native thread ID:0x511F, native priority:0x5, native policy:UNKNOWN, vmstate:CW, vm thread flags:0x00000401)\n3XMTHREADINFO2            (native stack address range from:0x9297E000, to:0x929BF000, size:0x41000)\n3XMCPUTIME               CPU usage total: 0.000211878 secs, current category=\"Application\"\n3XMHEAPALLOC             Heap bytes allocated since last GC cycle=0 (0x0)\n3XMTHREADINFO3           Java callstack:\n4XESTACKTRACE                at java/lang/Thread.sleep(Native Method)\n4XESTACKTRACE                at java/lang/Thread.sleep(Thread.java:941)\n4XESTACKTRACE                at WorkerThread.doWork(HangTest.java:37)\n4XESTACKTRACE                at WorkerThread.run(HangTest.java:31)\n5XESTACKTRACE                   (entered lock: java/lang/Object@0xB56658D8, entry count: 1)\n

In the last line of this output, you can see where the thread acquired the lock. Working up from this line, you can see that WorkerThread.run was called, which in turn called WorkerThread.doWork. The stack shows that the thread then entered a call to java/lang/Thread.sleep in HangTest.java on line 37, which is preventing the thread from completing its work and releasing the lock. In this example, the sleep call was added to induce a hang, but in real-world scenarios the cause could be any blocking operation, such as reading from an input stream or socket. Another possibility is that the thread is waiting for another lock owned by yet another thread.

It is important to remember that each Java dump represents a single snapshot in time. You should generate at least three Java dumps separated by a short pause, for example 30 seconds, and compare the output. This comparison tells you whether the threads involved are stuck in a fixed state or whether they are moving.

In this example, the threads do not move and the investigation needs to focus on the logic in WorkerThread.doWork to understand why Worker Thread 0 entered the java/lang/Thread.sleep call.

Another common scenario is where each Java dump shows a number of threads waiting for a lock owned by another thread, but the list of waiting threads and the lock-owning thread change over time. In this case, the cause is likely to be a bottleneck caused by thread contention, where the threads are continually competing for the same lock. In severe cases, the lock is held only for a small amount of time but there are lots of threads trying to obtain it. Because more time is spent handling the lock and scheduling the thread than executing application code, the degradation in performance is manifested as a hang. Thread contention is usually caused by an application design problem. You can use a similar approach to the one used in this scenario to determine which lines of code are responsible for the contention.

"},{"location":"dump_systemdump/","title":"System dump","text":""},{"location":"dump_systemdump/#system-dump","title":"System dump","text":"

System dumps, often known as core dumps, are platform-specific and contain a raw binary dump of the process memory. This type of dump has a complete copy of the Java heap, including the contents of all Java objects in the application.

"},{"location":"dump_systemdump/#obtaining-system-dumps","title":"Obtaining system dumps","text":"

System dumps are produced in response to specific events. To discover which events generate a dump, run the -Xdump:what command. The following output captures the information shown for a system dump:

-Xdump:system:\n    events=gpf+abort+traceassert+corruptcache,\n    label=/home/user/core.%Y%m%d.%H%M%S.%pid.%seq.dmp,\n    range=1..0,\n    priority=999,\n    request=serial\n

This output shows that events such as a general protection fault (gpf) or native abort() call can trigger a system dump. For more information about controlling the behavior of dump agents, see Dump agents.

"},{"location":"dump_systemdump/#enabling-a-full-system-dump-aix-linux-and-macos","title":"Enabling a full system dump (AIX, Linux, and macOS)","text":"

If you require a system dump that contains details of all the native threads that are running, you must change the resource limits for your operating system. Otherwise, the native thread details that are stored in the dump are only for the native thread that was running when the VM ended.

  1. Set the system resource limits by running the following commands: ulimit -c unlimited; ulimit -n unlimited; ulimit -d unlimited; ulimit -f unlimited;

    Where:

  1. For AIX systems, use the system management interface tool (SMIT) to enable a full CORE dump that is not a pre-430 style CORE dump. You can also set this configuration with the following command line option:

chdev -l sys0 -a fullcore='true' -a pre430core='false'

"},{"location":"dump_systemdump/#analyzing-a-system-dump","title":"Analyzing a system dump","text":"

To examine a system dump you can use the Dump viewer (jdmpview), a platform-specific debugging tool, or the Eclipse Memory Analyzer\u2122 tool (MAT).

If you want to use MAT to analyze your system dump, you must install the Diagnostic Tool Framework for Java (DTFJ) plug-in in the Eclipse IDE. Select the following menu items:

Help > Install New Software > Work with \"IBM Diagnostic Tool Framework for Java\" > IBM Monitoring and Diagnostic Tools > Diagnostic Tool Framework for Java   \n
"},{"location":"enhancementstoopenjdksecurity/","title":"Enhancements to OpenJDK security","text":""},{"location":"enhancementstoopenjdksecurity/#enhancements-to-openjdk-security","title":"Enhancements to OpenJDK security","text":"

Eclipse OpenJ9\u2122 includes the following enhancements to the OpenJDK security components.

"},{"location":"enhancementstoopenjdksecurity/#support-for-pkcs11-token-labels","title":"Support for PKCS#11 token labels","text":"

(z/OS\u00ae and Linux on IBM Z\u00ae only)

On z/OS and Linux on IBM Z, OpenJ9 supports the use of an extra attribute, tokenlabel, in the SunPKCS11 configuration file. Use this attribute to assign a label to a PKCS#11 token.

The number of slots and their order depend on the number of tokens in the ICSF token database, their values, and the SAF CRYPTOZ class protection profiles that are currently defined. The ICSF PKCS#11 support ensures that a token resides in its current slot only for the duration of a PKCS#11 session (if the token is not deleted). If you restart an application, or tokens are created or removed, the token might move to a different slot. An application that uses the slot or slotListIndex attributes might fail if it doesn\u2019t first check which slot the token is in. You can avoid this issue by using the tokenlabel attribute instead.

You can specify only one of the attributes - slot, slotListIndex, or tokenlabel. If you do not specify any of these attributes, the default behavior is that the slotListIndex attribute is set to 0.

Note: To configure an ICSF token, add the ICSF token to openCryptoki by using the pkcsicsf utility. The openCryptoki library loads the tokens that provide hardware or software specific support for cryptographic functions. An openCryptoki token uses an RSA key pair of public and private keys to encrypt and decrypt data. You must have openCryptoki version 3.22 or later to generate RSA private keys with the ICA, CCA and EP11 tokens that openCryptoki supports.

For more information about the SunPKCS11 configuration file, see PKCS#11 Reference Guide.

"},{"location":"env_var/","title":"Environment variables","text":""},{"location":"env_var/#environment-variables","title":"Environment variables","text":"

Although the Eclipse OpenJ9\u2122 virtual machine (VM) recognizes many environment variables, most are superseded by command-line arguments. Use command-line arguments rather than environment variables, which are retained only for compatibility.

Note: Environment variables are overridden by command-line arguments.

"},{"location":"env_var/#finding-and-setting-environment-variables","title":"Finding and setting environment variables","text":"

To show the current environment, run:

To show a particular environment variable, run:

Use values exactly as shown in the documentation. The names of environment variables are case-sensitive in AIX, Linux, macOS, and z/OS.

To set the environment variable LOGIN_NAME to Fred, run:

These variables are set only for the current shell or command-line session.

If you are setting multiple values for an environment variable in a list:

"},{"location":"env_var/#general-options","title":"General options","text":"

General VM environment variables are shown in the following table:

Environment\u00a0variable Usage information OPENJ9_JAVA_COMMAND_LINE This variable is set by the VM after it starts. Using this variable, you can find the command-line parameters set when the VM started. See -XX:[+|-]OpenJ9CommandLineEnv for more information. OPENJ9_JAVA_OPTIONS=<option> Set this variable to store default Java options, including -X, -D, or -verbose:gc style options. For example, -Xms256m -Djava.compiler. Any options set are overridden by equivalent options that are specified when Java is started. This variable does not support certain options, see the list in -Xoptionsfile. If you specify the name of a trace output file either directly, or indirectly, by using a properties file, the output file might be accidentally overwritten if you run utilities such as the trace formatter, dump extractor, or dump viewer. To avoid this problem, add %d, %p or %t to the trace file names. See -Xtrace:output. Note: The equivalent to OPENJ9_JAVA_OPTIONS, IBM_JAVA_OPTIONS is deprecated and will be removed in a future release. JAVA_FONTS=<list of directories> Set this environment variable to specify the font directory. Setting this variable is equivalent to setting the property java.awt.fonts on Windows operating systems, and sun.java2d.fontpath on other operating systems. _JAVA_OPTIONS=<option> Set this variable to add Java options to the end of the command line. Supported options and trace file issues are the same as for OPENJ9_JAVA_OPTIONS."},{"location":"env_var/#dump-agent-options","title":"Dump agent options","text":"

The preferred mechanism for controlling the production of dumps is by using the -Xdump option. However, these legacy environment variables are preserved and can still be used. The following table describes dump agent options:

Environment Variable Usage Information JAVA_DUMP_OPTS Used to control the conditions under which dumps are produced.

If you set agents for a condition by using the JAVA_DUMP_OPTS environment variable, default dump agents for that condition are disabled; however, any -Xdump options that are specified on the command line are used.

The JAVA_DUMP_OPTS environment variable uses the following syntax:

JAVA_DUMP_OPTS=\"ON<condition>(<agent>[<count>],<agent>[<count>]),\nON<condition>(<agent>[<count>],...),...)\"\n

Where:

JAVA_DUMP_OPTS is parsed by taking the leftmost occurrence of each condition, so duplicates are ignored. The following setting produces a system dump for the first error condition only:

ONERROR(SYSDUMP[1]),ONERROR(JAVADUMP)\n

Also, the ONANYSIGNAL condition is parsed before all others, so

ONINTERRUPT(NONE),ONANYSIGNAL(SYSDUMP)\n

has the same effect as

ONANYSIGNAL(SYSDUMP),ONINTERRUPT(NONE)\n

If the JAVA_DUMP_TOOL environment variable is set, that variable is assumed to specify a valid executable name and is parsed for replaceable fields, such as %pid. If %pid is detected in the string, the string is replaced with the VM's own process ID. The tool that is specified by JAVA_DUMP_TOOL is run after any system dump or heap dump is taken, before anything else.

The dump settings are applied in the following order. Settings later in the list take precedence:

  1. Default VM dump behavior.
  2. -Xdump command-line options that specify -Xdump:<type>:defaults, see OpenJ9 default options.
  3. DISABLE_JAVADUMP, IBM_HEAPDUMP, and IBM_HEAP_DUMP environment variables.
  4. IBM_JAVADUMP_OUTOFMEMORY and IBM_HEAPDUMP_OUTOFMEMORY environment variables.
  5. JAVA_DUMP_OPTS environment variable.
  6. Remaining -Xdump command-line options.

Setting JAVA_DUMP_OPTS affects only those conditions that you specify. Actions on other conditions are unchanged.

"},{"location":"env_var/#signal-mapping","title":"Signal mapping","text":"

When setting the JAVA_DUMP_OPTS environment variable, the mapping of operating system signals to the \"condition\" is shown in the following table:

Condition z/OS Windows Linux, macOS, and AIX EXCEPTION SIGTRAP, SIGILL, SIGSEGV, SIGFPE, SIGBUS, SIGSYS, SIGXFSV SIGILL, SIGSEGV, SIGFPE SIGTRAP, SIGILL, SIGSEGV, SIGFPE, SIGBUS, SIGXFSV INTERRUPT SIGINT, SIGTERM, SIGHUP SIGINT, SIGTERM SIGINT, SIGTERM, SIGHUP ERROR SIGABRT SIGABRT SIGABRT DUMP SIGQUIT SIGBREAK SIGQUIT"},{"location":"env_var/#java-dump-options","title":"Java dump options","text":"

The preferred mechanism for controlling the production of Java dumps is by using the -Xdump:java option. However, these legacy environment variables are preserved and can still be used.

Environment Variable Usage Information DISABLE_JAVADUMP=[TRUE|FALSE] Setting DISABLE_JAVADUMP to TRUE is the equivalent of using -Xdump:java:none and stops the default production of Java dumps. IBM_JAVACOREDIR=<directory> The default location into which the Java dump is written. On z/OS, the _CEE_DMPTARG environment variable is used instead. IBM_JAVADUMP_OUTOFMEMORY=[TRUE|FALSE] By setting this environment variable to FALSE, you disable Java dumps for an out-of-memory exception. When not set, a Java dump is generated when an out-of-memory exception is thrown but not caught and handled by the application. Set to TRUE to generate a dump when an out-of-memory exception is thrown, even if it is handled by the application. Set to FALSE to disable Java dumps for an out-of-memory exception. TMPDIR=<directory> This variable specifies an alternative temporary directory. This directory is used only when Java dumps and Heap dumps cannot be written to their target directories, or the current working directory. The default is /tmp (C:\\temp for Windows).

Note: You can use the dump agent JAVA_DUMP_OPTS variable to control the conditions under which Java dumps are produced.

"},{"location":"env_var/#heap-dump-options","title":"Heap dump options","text":"

The preferred mechanism for controlling the production of Java dumps is by using the -Xdump:heap option. However, these legacy environment variables are preserved and can still be used.

Environment Variable Usage Information IBM_HEAPDUMP=[TRUE|FALSE] Setting this option to TRUE enables heap dump production by using signals. IBM_HEAP_DUMP=[TRUE|FALSE] Setting this option to TRUE enables heap dump production by using signals. IBM_HEAPDUMPDIR=<directory> The default location into which the heap dump is written. On z/OS, the _CEE_DMPTARG environment variable is used instead. IBM_HEAPDUMP_OUTOFMEMORY=[TRUE|FALSE] Controls the generation of a heap dump when an out-of-memory exception is thrown. When not set, a heap dump is generated when an out-of-memory exception is thrown but not caught and handled by the application. Set to TRUE to generate a dump when an out-of-memory exception is thrown, even if it is handled by the application. Set to FALSE to disable heap dump for an out-of-memory exception. IBM_JAVA_HEAPDUMP_TEST Use this environment variable to cause the VM to generate both PHD and text versions of heap dumps. Equivalent to opts=PHD+CLASSIC on the -Xdump:heap option. IBM_JAVA_HEAPDUMP_TEXT Use this environment variable to cause the VM to generate a text (human readable) Heap dump. Equivalent to opts=CLASSIC on the -Xdump:heap option. TMPDIR=<directory> This variable specifies an alternative temporary directory. This directory is used only when Java dumps and heap dumps cannot be written to their target directories, or the current working directory. The default is /tmp (C:\\temp for Windows).

Note: You can use the dump agent JAVA_DUMP_OPTS variable to control the conditions under which Heap dumps are produced.

"},{"location":"env_var/#other-diagnostic-options","title":"Other diagnostic options","text":"

The following table lists other environment variables that can be set for diagnostic purposes:

Environment variable Usage Instructions IBM_COREDIR=<directory> Set this variable to specify an alternative location for system dumps, JIT dumps, and snap trace. On z/OS, _CEE_DMPTARG is used instead for snap trace, and transaction dumps are written to TSO according to JAVA_DUMP_TDUMP_PATTERN. On Linux and macOS, the dump is written to the directory that is specified directory by the operating system before being moved to the specified location. IBM_JAVA_ABEND_ON_FAILURE=Y (z/OS only) This setting tells the Java launcher to mark the Task Control Block (TCB) with an abend code if the OpenJ9 VM fails to load or is terminated by an uncaught exception. By default, the Java launcher does not mark the TCB. JAVA_DUMP_TDUMP_PATTERN=<string> (z/OS only) The specified <string> is passed to IEATDUMP to use as the data/set name for the Transaction Dump. The default <string> is %uid.JVM.TDUMP.%job.D%y%m%d.T%H%M%S (31-bit) or %uid.JVM.%job.D%y%m%d.T%H%M%S.X&amp;DS (64-bit), where %uid is found from the C code fragment shown in Notes. JAVA_THREAD_MODEL=<string> <string> can be defined as one of the following values: NATIVE (all threads are created as _MEDIUM_WEIGHT), HEAVY (all threads are created as _HEAVY_WEIGHT), MEDIUM (same as NATIVE), or NULL. The default is NATIVE. IBM_XE_COE_NAME=<value> Set this variable to generate a system dump when the specified exception occurs. The value that is supplied is the package description of the exception; for example, java/lang/InternalError. A Signal 11 is followed by a JVMXE message and then the VM ends. JAVA_PLUGIN_TRACE=TRUE When this variable is set to TRUE or 1, a Java plug-in trace is produced for the session when an application runs. Traces are produced from both the Java and Native layer. By default, this variable is set to FALSE, so that a Java plug-in trace is not produced.

Notes: C code fragment to discover %uid for JAVA_DUMP_TDUMP_PATTERN=<string>:

pwd = getpwuid(getuid());\npwd->pw_name;\n
"},{"location":"env_var/#deprecated-jit-options","title":"Deprecated JIT options","text":"

The following table describes deprecated environment variables for the JIT compiler:

Environment Variable Usage Information IBM_MIXED_MODE_THRESHOLD Use -Xjit:count=<value> instead of this variable. JAVA_COMPILER Use -Djava.compiler=<value> instead of this variable."},{"location":"gc/","title":"GC policies","text":""},{"location":"gc/#garbage-collection-policies","title":"Garbage collection policies","text":"

Eclipse OpenJ9\u2122 provides several garbage collection (GC) policies that are designed around different application workloads and service level agreements. Each GC policy consists of a set of characteristics and features that aim to optimize one or more performance aspects of a running application. These performance aspects include application throughput, memory footprint, average pause times, worst-case pause times, and startup time.

Different policies require a Java heap that is configured in different ways in order to achieve different goals. The simplest configuration consists of a single area of memory, often referred to as a flat heap. Other configurations divide the heap into different areas or regions, which might contain objects of different ages (generations) or sizes.

A GC cycle is a repeatable process that involves a set of GC operations. These operations process all or parts of the Java heap to complete a discrete function and are discussed in more detail in GC operations.

GC policies use different GC cycles to manage different aspects of the heap. For example, the gencon policy runs a partial GC cycle on the nursery area of the heap to complete a scavenge operation. At other times, gencon also runs a global GC cycle on the entire Java heap to complete mark and sweep (and optionally compact) operations.

GC cycles might be divided into increments that run over a period of time to reduce maximum pause times. These increments might involve stop-the-world (STW) pauses that must halt application threads to give certain GC operations exclusive access to the Java heap. Alternatively, increments might include GC operations that can run concurrently with application processing.

The following table shows the heap configuration and the GC cycles and operations used by different policies:

Policy Heap configuration GC cycles / operations gencon Two areas: nursery and tenure Two generation groups: new/older Global GC cycle: concurrent mark-sweep operations, optionally followed by a compact operation Partial GC cycle: STW scavenge operation or concurrent scavenge operation (if optionally enabled) balanced Multiple regions of equal size Multiple generations Global GC mark cycle: incremental concurrent mark operation (global mark phase) Partial GC cycle: STW copy forward operation and optional mark, sweep, or compact operations optavgpause One area: flat One generation Global GC cycle: concurrent mark-sweep operations, optionally followed by a compact operation optthruput One area: flat One generation Global GC cycle: STW mark-sweep operations, optionally followed by a compact operation metronome Multiple regions by size class One generation Global GC cycle: incremental STW mark-sweep operation in small interruptible steps nogc One area: flat No GC cycles

Note: All OpenJ9 GC policies support compressed references on 64-bit platforms, which compresses heap pointers to 32 bits if the total heap size does not exceed the theoretical upper bound of 64 GB. Applications that require more heap space can select any heap size within the bounds imposed by the operating system and available system RAM, without using compressed references. For more information, see compressed references.

"},{"location":"gc/#policy-selection-and-tuning","title":"Policy selection and tuning","text":"

The default policy is the Generational Concurrent (gencon) GC policy, which suits a broad spectrum of applications. Choosing a different GC policy should be guided by the application dynamics and an observation of how the application interacts with the heap during startup and at steady state. To help with this analysis, all OpenJ9 GC policies are instrumented to collect a wide range of GC-related metric data for reporting in a GC log file.

To enable GC logging for the OpenJ9 Java runtime, include the -verbose:gc option on the command line. By default, this option prints output to stderr but you can send the output to a log file by using -Xverbosegclog. You can then visualize the output by loading the GC log into the Garbage Collector and Memory Visualizer (GCMV) plug-in for the Eclipse IDE. OpenJ9 Java GC logs can also be analyzed by some online services, such as GCEasy.

The following sections provide more information about each policy and when you might choose it for your application. To select a GC policy other than gencon, specify the -Xgcpolicy option on the command line. To adjust the initial and maximum size of the Java heap, use the -Xms and -Xmx command line options. For generational GC policies, you can also set the -Xmn, -Xmns, and -Xmnx options.

"},{"location":"gc/#gencon-policy-default","title":"gencon policy (default)","text":"

The Generational Concurrent GC policy (-Xgcpolicy:gencon) is probably best suited if you have a transactional application, with many short-lived objects. This policy aims to minimize GC pause times without compromising throughput. This is the default policy employed by the VM, so if you want to use it you don't need to specify it on the command line when you start your application.

If your application requires the allocation of objects of very different sizes and liveness on the Java heap, you might experience heap fragmentation, which in turn might lead to global heap compaction. In these circumstances, the Balanced GC policy might be more appropriate.

"},{"location":"gc/#gc-processing","title":"GC processing","text":"

With the gencon policy, the Java heap is divided into two main areas, the nursery area, where new objects are created and the tenure area, where objects are moved if they have reached tenure age.

The nursery area is subdivided into two further areas, the allocate space and the survivor space. A partial GC cycle that involves a GC scavenge operation is used to reclaim memory from the nursery area. This process is illustrated in the following diagram, which shows a sequence of four main events:

  1. Objects are created in the allocate space.
  2. The allocate space is full.
  3. A local GC scavenge process runs and reachable objects are either evacuated (copied) into the survivor space or into the tenure area if they have reached tenure age. Any objects that can't be reached are left untouched and subsequently cleared.
  4. The allocate and survivor spaces swap roles. The original survivor space becomes the allocate space where new objects are created, and the original allocate space becomes the survivor space ready for the next local GC scavenge process.

The relative sizes of the allocate and survivor spaces are dynamically adjusted by a technique called tilting. When the nursery area is first created, it is evenly divided between the allocate and survivor spaces. If, after a GC scavenge operation runs, the amount of space required for the survivor area is comparatively small, the boundary between the two spaces is adjusted by tilting. For example, if the survivor space requires only 10% of the nursery area, the tilt ratio is adjusted to give 90% of the nursery area to the allocate space. With more space available for new objects, the frequency of scavenge cycles is reduced.

The tenure age of an object is determined by the VM and reflects the number of times that an object has been copied between the allocate space and the survivor space. The age is in the range 1 - 14 and is adjusted dynamically by the VM depending on the object survival rate at particular ages. For example, if an object has a tenure age of 5, it has been copied backwards and forwards between allocate and survivor spaces five times. If the VM sets a tenure age of 5 based on the percentage of space remaining in the nursery area, the next scavenge moves the object from the nursery to the tenure area. You can set an initial tenure age with the -Xgc:scvTenureAge option. You can also prevent the VM dynamically adjusting the tenure age by setting the Xgc:scvNoAdaptiveTenure option so that the initial age is maintained throughout the run time of the VM.

Within the tenure area, new objects are allocated into the small object area (SOA), which is illustrated in the earlier diagram (see item 3). A large object area (LOA) is set aside for objects greater than 64 KB that cannot be allocated into the SOA to minimize fragmentation. The LOA is allocated by default but is reduced and removed after a few GC cycles if it isn't populated. To prevent the creation of an LOA, you can specify the -Xnoloa option on the command line when you start your application. When the tenure area is close to full a global GC cycle is triggered.

The partial GC cycle (scavenge) reduces pause times by frequently reclaiming memory in the nursery area which, for a transactional application with many short-lived objects, has the most recyclable space. While most of the objects stay in the nursery area after the scavenge operation is complete, a small fraction are moved to the tenure area. Over time the tenure area might become full. So, whilst a partial GC cycle is operating on the nursery area, a concurrent global GC cycle also runs alongside normal program execution to mark and remove unreachable objects from the tenure area. These two GC approaches combine to provide a good trade-off between shorter pause times and consistent throughput.

"},{"location":"gc/#concurrent-scavenge","title":"Concurrent Scavenge","text":"

A special mode of the gencon policy is known as Concurrent Scavenge. This mode aims to further reduce the average time spent in STW pauses by collecting garbage from the nursery area in parallel with running application threads. Whilst aiming to reduce the average time, this mode does not improve the worst case pause time when compared to running gencon without Concurrent Scavenge enabled.

To enable Concurrent Scavenge, see -Xgc:concurrentScavenge.

This mode can be enabled with hardware-based support and software-based support:

More information about Concurrent Scavenge mode can be found in the blog post Concurrent Scavenge Garbage Collection Policy.

"},{"location":"gc/#balanced-policy","title":"balanced policy","text":"

(64-bit only)

The Balanced GC policy (-Xgcpolicy:balanced) evens out pause times and reduces the overhead of some of the costlier operations that are typically associated with garbage collection, such as compaction and class unloading. The Java heap is divided into a large number of regions (1,000 - 2,000), which are managed individually by an incremental generational collector to reduce the maximum pause time on large heaps and increase the efficiency of garbage collection. The aim of the policy is to avoid global garbage collections by matching object allocation and survival rates.

"},{"location":"gc/#when-to-use","title":"When to use","text":"

The Balanced policy might be a good alternative for applications that experience unacceptable pause times with gencon.

However, even though pause times are typically evened out across GC operations, actual pause times are affected by object allocation rates, object survival rates, and fragmentation levels within the heap, and cannot therefore be bound to a certain maximum nor can a certain utilization level be guaranteed.

"},{"location":"gc/#gc-processing_1","title":"GC processing","text":"

During VM startup, the GC divides the heap memory into regions of equal size. These regions remain static for the lifetime of the VM and are the basic unit of garbage collection and allocation operations. For example, when the heap is expanded or contracted, the memory committed or released corresponds to a certain number of regions. Although the Java heap is a contiguous range of memory addresses, any region within that range can be committed or released from a pool as required. This enables the Balanced GC to contract the heap more dynamically and aggressively than other garbage collectors, which typically require the committed portion of the heap to be contiguous.

Regions impose a maximum object size. Objects are always allocated within the bounds of a single region and are never permitted to span regions. The region size is always a power of two; for example, 512 KB, 1 MB, and so on (where KB is 210 bytes and MB is 220 bytes). The region size is selected at startup based on the maximum heap size. The collector chooses the smallest power of two which will result in less than 2048 regions, with a minimum region size of 512 KB. Except for small heaps (less than about 512 MB) the VM aims to have between 1024 and 2047 regions.

Object ages are tracked for each region with a maximum of 24 possible generations. The following diagram illustrates the structure of the object heap:

The eden space is a set of regions of age 0, which contain the newest objects allocated. The size of the eden space is determined by the number of regions that it contains. When the region count for the eden space reaches a predetermined threshold (taxation threshold), a partial GC cycle runs to reduce the number of used regions, typically by using a copy forward operation. Empty regions can then be assigned to the eden space from the pool. In specific cases, mark and compact operations might be used, for example, when there are not enough free survivor regions available. The partial GC cycle is a STW operation that always includes the eden space, but might include older regions. Objects from collectible regions of age N are moved into another region of the same age N or to an empty region that is assigned an age of N. Then, the ages of all regions across the heap are incremented by 1, except for the maximum age 24 regions. Regions of age 24 are included in partial GC collection sets in order to defragment them.

Partial GC cycles work to reclaim free regions in the heap for allocating new objects. Because some objects from eden regions always survive, a partial GC cycle can reclaim only about 90% of this memory. To keep up with object allocation, partial GC cycles also reclaim free regions by defragmenting older regions. For example, a partial GC cycle that moves objects from 5 fragmented older regions into 2 empty regions, reclaims 3 regions for new object allocation. However, over time the overall amount of fragmented memory decreases and records about object liveness in older regions become less accurate. Eventually, the work done by partial GC cycles to reclaim memory cannot keep pace with memory consumption. Free regions become so scarce that a global mark operation (GMP), which is triggered by another taxation threshold, is required to build a new record of object liveness across the heap. A sweep operation uses this record to measure the amount of free memory in fragmented older regions, which later partial GC cycles can act upon to move objects and reclaim free regions.

A global sweep operation also runs to reclaim memory so that it can create empty regions. The global sweep operation, while logically associated with the global mark operation, runs in the same STW increment as the first partial GC cycle after the mark operation completes. Because the GC cycle responsible for the global mark operation runs concurrently, it might overlap and interleave with a few partial GC cycles.

With the balanced policy, a global GC cycle is sometimes required in addition to the global mark operations and partial GC cycle. This global GC cycle is rare, occurring only in very tight memory conditions when other GC cycles cannot free enough memory on the heap.

Most objects are easily contained within the minimum region size of 512 KB. However, to support large arrays, which cannot be contained in a region, the balanced GC policy uses an arraylet representation in the heap. For more information about structure and layout, see Arraylets.

Note: With arraylets, JNI access to array data might involve reconstituting arraylets as contiguous arrays, which can significantly slow down processing.

To learn about the default heap size and the tuning options that can be used with the balanced policy, see -Xgcpolicy:balanced.

"},{"location":"gc/#optavgpause-policy","title":"optavgpause policy","text":"

The optimize for pause time policy (-Xgcpolicy:optavgpause) uses a global GC to manage a flat heap comprised of a single area and to compact the heap if the heap becomes fragmented. The global GC cycle starts preemptively so that the cycle finishes before the heap is exhausted. By anticipating global collections and initiating some mark operations ahead of collection, the optavgpause policy reduces GC pause times when compared to optthruput. However, the reduction in pause time comes at the expense of some performance throughput.

"},{"location":"gc/#when-to-use_1","title":"When to use","text":"

Consider using this policy if you have a large heap size (available on 64-bit platforms), because this policy limits the effect of increasing heap size on the length of the GC pause.

Although optavgpause uses a write barrier to support concurrent mark operations, it does not use a generational write barrier. For some application workloads, such as those that frequently change large and old reference arrays, this strategy might be of greater benefit. However, in many situations, the default gencon policy offers better performance.

By using a flat heap, optavgpause avoids potential issues with very large objects. With gencon, the heap is divided into areas (nursery and tenure) in order to manage generations of objects. Although there might be sufficient free space on the overall Java heap for a very large object, it might not fit into the nursery area. If the allocator does succeed in allocating a very large object, further GC cycles might be required to create enough contiguous free space.

Overall, optavgpause, along with optthruput, is best suited to short-lived applications and to long-running services that involve concurrent sessions with short lifespans. Short-lived applications with adequate heap sizes usually complete without compaction. The flat heap fragments more slowly when session-bound objects are allocated and drop out of the live set in short overlapping clusters.

"},{"location":"gc/#gc-processing_2","title":"GC processing","text":"

The optavgpause policy requires a flat Java heap. A global GC cycle runs concurrent mark-sweep operations, optionally followed by compact operations. By running most operations concurrently with application threads, this strategy aims to reduce GC pause times as much as possible.

"},{"location":"gc/#optthruput-policy","title":"optthruput policy","text":"

The optimize for throughput policy (-Xgcpolicy:optthruput) uses a global GC cycle to manage a flat heap that is comprised of a single area and to compact the heap if the heap becomes fragmented. The global collector runs mark and sweep operations that are triggered by an allocation failure when the heap is exhausted. As a result, applications stop for long pauses while garbage collection takes place.

"},{"location":"gc/#when-to-use_2","title":"When to use","text":"

You might consider using this policy when a large heap application can tolerate longer GC pauses to obtain better overall throughput. Unlike gencon, the optthruput policy does not use object access barriers. In some workloads, the cost of these barriers might be high enough to make optthruput preferable. However, in many situations, the default gencon policy offers better performance.

By using a flat heap, optthruput avoids potential issues with very large objects. With gencon, the heap is divided into areas (nursery and tenure) in order to manage generations of objects. Although there might be sufficient free space on the overall Java heap for a very large object, it might not fit into the nursery area. If the allocator does succeed in allocating a very large object, further GC cycles might be required to create enough contiguous free space.

Overall, optthruput, along with optavgpause, is best suited to short-lived applications and to long-running services that involve concurrent sessions with short lifespans. Short-lived applications with adequate heap sizes usually complete without compaction. The flat heap fragments more slowly when session-bound objects are allocated and drop out of the live set in short overlapping clusters.

"},{"location":"gc/#gc-processing_3","title":"GC processing","text":"

The optthruput policy requires a flat Java heap. A global GC cycle runs mark-sweep operations, optionally followed by compact operations. The cycle requires exclusive access to the heap, causing application threads to halt while operations take place. As such, long pauses can occur.

"},{"location":"gc/#metronome-policy","title":"metronome policy","text":"

(Linux on x86-64 and AIX platforms only)

The metronome policy (-Xgcpolicy:metronome) is an incremental, deterministic garbage collector with short pause times. Applications that are dependent on precise response times can take advantage of this technology by avoiding potentially long delays from GC activity.

"},{"location":"gc/#when-to-use_3","title":"When to use","text":"

metronome is designed for applications that require a precise upper bound on collection pause times as well as specified application utilization: the proportion of time that the application is permitted to use, with the remainder being devoted to GC. The metronome GC runs in short interruptible bursts to avoid long STW pauses.

"},{"location":"gc/#gc-processing_4","title":"GC processing","text":"

The Java heap is allocated as a contiguous range of memory, partitioned into small regions of equal size (~64 KB). The metronome policy does not dynamically resize the heap; the heap is always fully expanded, even if -Xms is not set to -Xmx.

Each region of the heap is either empty, or contains only objects in one of 16 size classes. The heap also supports Arraylets for dealing with large arrays. This organization improves the use of available heap space, reducing the need for heap compaction and defragmentation, and providing more precise control over the incremental sweep operation.

Note: With arraylets, JNI access to array data might involve reconstituting arraylets as contiguous arrays, which can significantly slow down processing.

Although high application utilization is desirable for optimal throughput, the GC must be able to keep up with the application's memory allocation rate.

A higher utilization typically requires a larger heap because the GC isn't allowed to run as much as a lower utilization would permit. The relationship between utilization and heap size is highly application dependent, and striking an appropriate balance requires iterative experimentation with the application and VM parameters. You might need to adjust heap size or pause time or target utilization to achieve an acceptable runtime configuration.

To learn about default options and tuning options that can be used with the metronome policy, see -Xgcpolicy:metronome.

"},{"location":"gc/#nogc-policy","title":"nogc policy","text":"

-Xgcpolicy:nogc handles only memory allocation and heap expansion, but doesn't reclaim any memory. The GC impact on runtime performance is therefore minimized, but if the available Java heap becomes exhausted, an OutOfMemoryError exception is triggered and the VM stops.

"},{"location":"gc/#when-to-use_4","title":"When to use","text":"

This policy is not suited to the majority of Java applications. However, the following use cases apply:

Note: You should be especially careful when using any of the following techniques with nogc because memory is never released under this policy:

"},{"location":"gc/#troubleshooting","title":"Troubleshooting","text":"

You can diagnose problems with garbage collection operations by turning on verbose GC logging. By default, the information is printed to STDERR but can be redirected to a file by specifying the -Xverbosegclog option. The log files contain detailed information about all operations, including initialization, STW processing, finalization, reference processing, and allocation failures. For more information, see Verbose GC logs.

If verbose logs do not provide enough information to help you diagnose GC problems, you can use GC trace to analyze operations at a more granular level. For more information, see -Xtgc.

"},{"location":"gc_overview/","title":"Garbage Collection (GC)","text":""},{"location":"gc_overview/#garbage-collection","title":"Garbage collection","text":"

To prevent applications running out of memory, objects in the Java heap that are no longer required must be reclaimed. This process is known as garbage collection (GC). When garbage is collected, the garbage collector must obtain exclusive access to the heap, which causes an application to pause while the cleanup is done. This pause is often referred to as a stop-the-world (STW) pause because an application must halt until the process completes. In general, the first step in the GC process is to mark the objects that are reachable, which means they are still in use. The next step is to sweep away the unmarked objects to reclaim memory. The final step is to compact the heap if the heap is badly fragmented.

A GC cycle is a repeatable process that involves a set of GC operations. These operations process all or parts of the Java heap. When operating on the whole of the Java heap, the cycle is referred to as a global GC cycle; When operating on part of the heap, the cycle is referred to as a partial GC cycle.

A global GC cycle can be triggered explicitly or implicitly according to the following rules:

The System.gc() call triggers the GC cycle twice internally to clear unreachable objects that were not identified during the first GC cycle. This call also triggers finalization to release resources that were used by the unreachable objects so that the resources can be reused.

Partial GC cycles are triggered only implicitly under the control of a particular GC policy. For more information about the GC policies available with Eclipse OpenJ9\u2122, see Garbage collection policies.

The GC process is designed to operate without intervention from an application. Developers should not attempt to predict GC behavior, for example, by making calls to System.gc() to trigger a cycle or by using finalizers to clean up objects in memory. Such actions might degrade the performance of an application.

"},{"location":"gc_overview/#gc-operations","title":"GC operations","text":"

GC operations run discrete functions on the Java heap. For example, a mark operation traces all objects in the heap to determine which ones are reachable. A sweep operation runs to clear away unreachable objects. Together, a mark and sweep operation are capable of reclaiming used memory as part of a GC cycle. Not all GC cycles include operations to reclaim memory. For example, the balanced GC policy involves a global cycle that includes only a mark operation; reclaiming the memory with a sweep operation occurs as part of a separate partial GC cycle that evacuates younger regions and defragments older regions.

A GC operation might complete in one step, or it might involve multiple steps. For example, a mark operation consists of three steps, as described in the following section.

"},{"location":"gc_overview/#gc-mark-operation","title":"GC mark operation","text":"

A mark operation identifies which objects on the Java heap are reachable from outside of the heap and which objects are unreachable. Reachable objects are in use and must be retained, whereas unreachable objects are not in use and can be cleared away as garbage.

The process of marking involves a bit array called a mark map that is allocated by the VM at startup, based on the maximum heap size setting. Each bit in the mark map corresponds to 8 bytes of heap space. When an object is marked, its location in the heap is recorded by setting the appropriate bit in the mark map.

A mark operation can be broken down into the following steps:

  1. Initial

    A root object is an object that is accessible from outside of the heap such as a stack, class static field, or JNI reference. For other objects in the heap to be reachable, they must retain a connection from a root object. In the initial step, tracing identifies all root objects by running a root scan. Root objects are pushed onto a work stack for processing in the next step.

  2. Main

    The list of reachable root objects in the work stack is recursively traced for references to other objects in the heap. Objects that are not marked are new objects and these are added to the work stack. If an object is reachable, the appropriate bit is set in the mark map.

  3. Final

    The final step processes weakly reachable roots such as finalizable objects, weak references, monitor sets, and string sets. For more information about the processing of soft, weak, and phantom references, see Weak reference processing.

In general, helper threads are used in parallel to speed up mark operations on the heap. The helper threads share the work stack with the application thread and are involved in identifying root objects, tracing objects in the heap, and updating the mark map. By default, the number of helper threads is based on the number of CPUs reported by the operating system. You can control the number of helper threads available by specifying the -Xgcthreads command line option when starting your application.

In a verbose GC log, this operation is shown by the <gc-op type=\"mark\"> XML element. For more information, see Verbose GC logs.

"},{"location":"gc_overview/#concurrent-mark-processing","title":"Concurrent mark processing","text":"

A mark operation can run with exclusive access to the heap, which requires application threads to pause while processing takes place. Alternatively, it can run concurrently with application threads to avoid pauses in application processing.

With concurrent mark, the process of root scanning is handed over to application stack threads, which populate the work stack with root objects in their stack. The root objects in the work stack are then traced by a background thread and by each application thread during a heap lock allocation to find reachable objects and update the mark map. Because the mark operation runs concurrently with application threads, any changes to objects that are already traced must be updated. This process works by using a write barrier that can flag the update and trigger a further scan of part of the heap.

To track updates to objects, concurrent mark operations use single-byte cards in a card table. Each card corresponds to a 512-byte section of the Java heap. When an object is updated, the start address for the object in the heap is marked on the appropriate card. These cards are used to determine what must be retraced later in the GC cycle.

A GC cycle that includes concurrent mark operations aims to trace all reachable objects and complete processing at the same time as the heap is exhausted. Continuous adjustments are made to the start time of each cycle to get as close to heap exhaustion as possible. When the heap is exhausted a sweep operation is able to reclaim memory. This operation requires a STW pause. Before sweep operations start, the root objects are rescanned and the cards are checked to determine which areas of memory must be retraced.

An advantage of concurrent mark operations over STW mark operations is reduced pause times, because the garbage collector is able to identify garbage without halting application threads. Pause times are also more consistent because the collector is able to tune start times to maximize heap usage.

Disadvantages of concurrent mark operations include the additional CPU for operating the write barrier and additional work for application threads to trace objects when requesting a heap lock.

Concurrent mark operations are used by the gencon GC policy and the optavgpause GC policy.

"},{"location":"gc_overview/#incremental-concurrent-mark-processing","title":"Incremental concurrent mark processing","text":"

Incremental concurrent mark processing evens out pause times by avoiding global STW garbage collections. This type of marking is also known as the global mark phase, whereby mark operations take place incrementally across the entire heap. The global mark operations are interleaved with a partial GC cycle that is responsible for moving objects and clearing unreachable objects in the heap.

These operations also use mark map in a card table to manage updates to objects that occur whilst mark operations are in progress. However, unlike the concurrent mark operations used by other policies, application threads are not involved in tracing objects; only background threads are used to trace objects and update the mark map.

Incremental concurrent mark operations are used by the balanced GC policy.

"},{"location":"gc_overview/#gc-sweep-operation","title":"GC sweep operation","text":"

The purpose of a sweep operation is to identify memory that can be reclaimed for object allocation and update a central record, known as the freelist.

sweep operations occur in 2 steps:

  1. Initial

    This step analyzes the mark map for free memory.

  2. Final

    Based on the analysis, the sections of the heap are connected to the freelist.

As with mark operations, multiple helper threads can be used to sweep the Java heap in parallel to speed up processing times. Because these helper threads are the same ones that are used for parallel mark operations, the number of threads can be controlled by using the -Xgcthreads option.

Parallel sweep operations run on 256 KB sections of the heap. Each helper thread scans a section at a time. The results are stored and used to generate a freelist of empty regions.

In a verbose GC log, this operation is shown by the <gc-op type=\"sweep\"> XML element. For more information, see Verbose GC logs.

"},{"location":"gc_overview/#concurrent-sweep-processing","title":"Concurrent sweep processing","text":"

Concurrent sweep processing works in tandem with concurrent mark processing and uses the same mark map. Concurrent sweep operations start after a STW collection and complete a section of the heap before concurrent mark operations continue.

Concurrent sweep is used by the optavgpause GC policy.

"},{"location":"gc_overview/#gc-scavenge-operation","title":"GC scavenge operation","text":"

A GC scavenge operation is triggered by an allocation failure in the nursery area of the heap. The operation occurs in the following 3 steps:

  1. Initial

    A root object is an object that is accessible from outside of the heap such as a stack, class static field, or JNI reference. For other objects in the heap to be reachable, they must retain a connection from a root object. In the initial step, tracing identifies all root objects by running a root scan. Root objects are pushed onto a work stack for processing in the next step.

  2. Main

    The list of reachable root objects in the work stack is recursively traced for references to other objects in the heap by using the hierarchical scan ordering mode (-Xgc:hierarchicalScanOrdering). If new objects are found, they are added to the work stack. If an object is reachable, it is copied from the allocate space to the survivor space in the nursery area or to the tenure area if the object has reached a particular age.

  3. Final

    The final step processes weakly reachable roots such as finalizable objects, weak references, monitor sets, and string sets. For more information about the processing of soft, weak, and phantom references, see Weak reference processing.

In a verbose GC log, this operation is shown by the <gc-op type=\"scavenge\"> XML element. For more information, see Verbose GC logs.

The scavenge operation is used by the gencon GC policy.

"},{"location":"gc_overview/#gc-copy-forward-operation","title":"GC copy forward operation","text":"

A GC copy forward operation is similar to a scavenge operation but is triggered by a taxation threshold being reached. The operation occurs in the following 3 steps:

  1. Initial

    A root object is an object that is accessible from outside of the heap such as a stack, class static field, or JNI reference. For other objects in the heap to be reachable, they must retain a connection from a root object. In the initial step, tracing identifies all root objects by running a root scan. Root objects are pushed onto a work stack for processing in the next step.

  2. Main

    The list of reachable root objects in the work stack is recursively traced for references to other objects in the heap by using dynamic breadth first scan ordering mode (-Xgc:dynamicBreadthFirstScanOrdering). If new objects are found, they are added to the work stack. If an object is reachable, it is moved to another region of the same age or to an empty region of the same age in the heap. The age of all regions in the heap is then incremented by 1, except for the oldest region (age 24).

  3. Final

    The final step processes weakly reachable roots such as finalizable objects, weak references, monitor sets, and string sets. For more information about the processing of soft, weak, and phantom references, see Weak reference processing.

The operation aims to empty or evacuate fragmented regions that can then be reclaimed for new object allocation.

In a verbose GC log, this operation is shown by the <gc-op type=\"copy forward\"> XML element. For more information, see Verbose GC logs.

The copy forward operation is used by the balanced GC policy.

"},{"location":"gc_overview/#gc-classunloading-operation","title":"GC classunloading operation","text":"

The classunloading operation is single threaded, not parallel threaded.

In a verbose GC log, this operation is shown by the <gc-op type=\"classunload\"> XML element. For more information, see Verbose GC logs.

"},{"location":"gc_overview/#gc-compact-operation","title":"GC compact operation","text":"

Compaction of the heap is an expensive operation because when objects are moved to defragment the heap, the references to each object change. Therefore, compact operations do not occur by default but only when the following triggers occur:

The following two options can be used to control compaction:

In a verbose GC log, this operation is shown by the <gc-op type=\"compact\"> XML element. For more information, see Verbose GC logs.

"},{"location":"gc_overview/#weak-reference-processing","title":"Weak reference processing","text":"

Weak reference processing includes soft references, weak references, and phantom references. These references are created by the user for specific use cases and allow some level of interaction with the garbage collector. For example, a soft reference to an object allows that object to persist in memory for a longer period of time before being cleared. For example, a software cache. The garbage collector handles the reference types in the order shown and with the behavior detailed in the following table:

Reference type Class Garbage collector behavior soft java.lang.ref.SoftReference A soft reference is cleared only when its referent is not marked for a number of GC cycles or if space on the heap is likely to cause an out of memory error. Use the -Xsoftrefthreshold option to control the collection of soft reference objects. weak java.lang.ref.WeakReference A weak reference is cleared as soon as its referent is not marked by a GC cycle. phantom java.lang.ref.PhantomReference A phantom reference is cleared automatically as soon as its referent is not marked by a GC cycle. The cleared reference is then added to the associated reference queue at the same time or later.

If your application uses the Java Native Interface (JNI) to interact with other application types, you can also create weak JNI object references. These references have a similar life cycle to a weak Java reference. The garbage collector processes weak JNI references after all other Java reference types.

"},{"location":"interface_dtfj/","title":"DTFJ","text":""},{"location":"interface_dtfj/#diagnostic-tool-framework-for-java","title":"Diagnostic Tool Framework for Java","text":"

The Diagnostic Tool Framework for Java\u2122 (DTFJ) is a Java application programming interface (API) that is used to support the building of Java diagnostic tools. DTFJ works with data from a system dump or a Java dump.

On Linux and AIX\u00ae operating systems, you can get more information from a system dump if you also have copies of executable files and libraries. You can run the jpackcore utility to collect these files into a single archive for use in subsequent problem diagnosis. For more information, see Dump extractor.

The DTFJ API helps diagnostic tools access the following information:

If your DTFJ application requests information that is not available in the Java dump, the API will return null or throw a DataUnavailable exception. You might need to adapt DTFJ applications written to process system dumps to make them work with Java dumps.

DTFJ is implemented in pure Java and tools written using DTFJ can be cross-platform. Therefore, you can analyze a dump taken from one workstation on another (remote and more convenient) machine. For example, a dump produced on an AIX\u00ae Power\u00ae system can be analyzed on a Windows laptop.

See the DTFJ API documentation.

Note: If the code that loads DTFJ is in a module, the module must require the openj9.dtfj module. For example:

module MyModule {\n  requires openj9.dtfj;\n}\n
"},{"location":"interface_dtfj/#using-the-dtfj-interface","title":"Using the DTFJ interface","text":"

To create applications that use DTFJ, you must use the DTFJ interface. Implementations of this interface have been written that work with system dumps and Java dumps.

The diagram that follows illustrates the DTFJ interface. The starting point for working with a dump is to obtain an Image instance by using the ImageFactory class supplied with the concrete implementation of the API.

"},{"location":"interface_dtfj/#working-with-a-system-dump","title":"Working with a system dump","text":"

The following example shows how to work with a system dump. In this example, the only section of code that ties the dump to a particular implementation of DTFJ is the generation of the factory class. Change the factory if you want to use a different implementation.

If there is a problem with the file that is passed to the getImage() method, an IOException is thrown and an appropriate message is issued. If a missing file is passed to the example shown, the following output is produced:

Could not find/use required file(s)\njava.io.FileNotFoundException: core_file.xml (The system cannot find the file specified.)\n        at java.io.FileInputStream.open(Native Method)\n        at java.io.FileInputStream.<init>(FileInputStream.java:135)\n        at com.ibm.dtfj.image.j9.ImageFactory.getImage(ImageFactory.java:47)\n        at com.ibm.dtfj.image.j9.ImageFactory.getImage(ImageFactory.java:35)\n        at DTFJEX1.main(DTFJEX1.java:23)Copy\n

In this case, the DTFJ implementation is expecting a dump file to exist. Different errors are caught if the file existed but was not recognized as a valid dump file.

Example of working with a system dump
import java.io.File;\nimport java.util.Iterator;\nimport java.io.IOException;\n\nimport com.ibm.dtfj.image.CorruptData;\nimport com.ibm.dtfj.image.Image;\nimport com.ibm.dtfj.image.ImageFactory;\n\npublic class DTFJEX1 {\n    public static void main(String[] args) {\n        Image image = null;\n        if (args.length > 0) {\n            File f = new File(args[0]);\n            try {\n                Class factoryClass = Class.forName(\"com.ibm.dtfj.image.j9.ImageFactory\");\n                ImageFactory factory = (ImageFactory) factoryClass.newInstance();\n                image = factory.getImage(f);\n            } catch (ClassNotFoundException e) {\n                System.err.println(\"Could not find DTFJ factory class\");\n                e.printStackTrace(System.err);\n            } catch (IllegalAccessException e) {\n                System.err.println(\"IllegalAccessException for DTFJ factory class\");\n                e.printStackTrace(System.err);\n            } catch (InstantiationException e) {\n                System.err.println(\"Could not instantiate DTFJ factory class\");\n                e.printStackTrace(System.err);\n            } catch (IOException e) {\n                System.err.println(\"Could not find/use required file(s)\");\n                e.printStackTrace(System.err);\n            }\n        } else {\n            System.err.println(\"No filename specified\");\n        }\n        if (image == null) {\n            return;\n        }\n\n        Iterator asIt = image.getAddressSpaces();\n        int count = 0;\n        while (asIt.hasNext()) {\n            Object tempObj = asIt.next();\n            if (tempObj instanceof CorruptData) {\n                System.err.println(\"Address Space object is corrupt: \"\n                        + (CorruptData) tempObj);\n            } else {\n                count++;\n            }\n        }\n        System.out.println(\"The number of address spaces is: \" + count);\n    }\n}\n
"},{"location":"interface_dtfj/#working-with-a-java-dump","title":"Working with a Java dump","text":"

To work with a Java dump, change the factory class to com.ibm.dtfj.image.javacore.JCImageFactory and pass the Java dump file to the getImage() method.

Example of working with a Java dump
import java.io.File;\nimport java.util.Iterator;\nimport java.io.IOException;\n\nimport com.ibm.dtfj.image.CorruptData;\nimport com.ibm.dtfj.image.Image;\nimport com.ibm.dtfj.image.ImageFactory;\n\npublic class DTFJEX2 {\n    public static void main(String[] args) {\n        Image image=null;\n\n        if (args.length > 0) {\n            File javacoreFile = new File(args[0]);\n\n            try {\n                Class factoryClass = Class.forName(\"com.ibm.dtfj.image.javacore.JCImageFactory\");\n                ImageFactory factory = (ImageFactory) factoryClass.newInstance();\n                image = factory.getImage(javacoreFile);\n            } catch (ClassNotFoundException e) {\n                System.err.println(\"Could not find DTFJ factory class\");\n                e.printStackTrace(System.err);\n            } catch (IllegalAccessException e) {\n                System.err.println(\"IllegalAccessException for DTFJ factory class\");\n                e.printStackTrace(System.err);\n            } catch (InstantiationException e) {\n                System.err.println(\"Could not instantiate DTFJ factory class\");\n                e.printStackTrace(System.err);\n            } catch (IOException e) {\n                System.err.println(\"Could not find/use required file(s)\");\n                e.printStackTrace(System.err);\n            }\n        } else {\n            System.err.println(\"No filename specified\");\n        }\n        if (image == null) {\n            return;\n        }\n\n        Iterator asIt = image.getAddressSpaces();\n        int count = 0;\n        while (asIt.hasNext()) {\n            Object tempObj = asIt.next();\n            if (tempObj instanceof CorruptData) {\n                System.err.println(\"Address Space object is corrupt: \"\n                        + (CorruptData) tempObj);\n            } else {\n                count++;\n            }\n        }\n        System.out.println(\"The number of address spaces is: \" + count);\n    }\n}\n
"},{"location":"interface_dtfj/#analyze-the-dump","title":"Analyze the dump","text":"

After you have obtained an Image instance, you can begin analyzing the dump. The Image instance is the second instance in the class hierarchy for DTFJ illustrated by the following diagram:

Some things to note from the diagram:

"},{"location":"interface_dtfj/#dtfj-example-application","title":"DTFJ example application","text":"

This example is a fully working DTFJ application. Many DTFJ applications will follow a similar model.

Sample DTFJ application
import java.io.File;\nimport java.util.Iterator;\nimport com.ibm.dtfj.image.CorruptData;\nimport com.ibm.dtfj.image.CorruptDataException;\nimport com.ibm.dtfj.image.DataUnavailable;\nimport com.ibm.dtfj.image.Image;\nimport com.ibm.dtfj.image.ImageAddressSpace;\nimport com.ibm.dtfj.image.ImageFactory;\nimport com.ibm.dtfj.image.ImageProcess;\nimport com.ibm.dtfj.java.JavaRuntime;\nimport com.ibm.dtfj.java.JavaThread;\nimport com.ibm.dtfj.image.ImageThread;\n\npublic class DTFJEX2\n{\n   public static void main( String[] args )\n   {\n      Image image = null;\n      if ( args.length > 0 )\n      {\n         File f = new File( args[0] );\n         try\n         {\n            Class factoryClass = Class\n                  .forName( \"com.ibm.dtfj.image.j9.ImageFactory\" );\n            ImageFactory factory = (ImageFactory) factoryClass.newInstance( );\n            image = factory.getImage( f );\n         }\n         catch ( Exception ex )\n         { /*\n             * Should use the error handling as shown in DTFJEX1.\n             */\n            System.err.println( \"Error in DTFJEX2\" );\n            ex.printStackTrace( System.err );\n         }\n      }\n      else\n      {\n         System.err.println( \"No filename specified\" );\n      }\n\n      if ( null == image )\n      {\n         return;\n      }\n\n      MatchingThreads( image );\n   }\n\n   public static void MatchingThreads( Image image )\n   {\n      ImageThread imgThread = null;\n\n      Iterator asIt = image.getAddressSpaces( );\n      while ( asIt.hasNext( ) )\n      {\n         System.out.println( \"Found ImageAddressSpace...\" );\n\n         ImageAddressSpace as = (ImageAddressSpace) asIt.next( );\n\n         Iterator prIt = as.getProcesses( );\n\n         while ( prIt.hasNext( ) )\n         {\n            System.out.println( \"Found ImageProcess...\" );\n\n            ImageProcess process = (ImageProcess) prIt.next( );\n\n            Iterator runTimesIt = process.getRuntimes( );\n            while ( runTimesIt.hasNext( ) )\n            {\n               System.out.println( \"Found Runtime...\" );\n               JavaRuntime javaRT = (JavaRuntime) runTimesIt.next( );\n\n               Iterator javaThreadIt = javaRT.getThreads( );\n\n               while ( javaThreadIt.hasNext( ) )\n               {\n                  Object tempObj = javaThreadIt.next( );\n                  /*\n                   * Should use CorruptData handling for all iterators\n                   */\n                  if ( tempObj instanceof CorruptData )\n                  {\n                     System.out.println( \"We have some corrupt data\" );\n                  }\n                  else\n                  {\n                     JavaThread javaThread = (JavaThread) tempObj;\n                     System.out.println( \"Found JavaThread...\" );\n                     try\n                     {\n                        imgThread = (ImageThread) javaThread.getImageThread( );\n\n                        // Now we have a Java thread we can iterator\n                        // through the image threads\n                        Iterator imgThreadIt = process.getThreads( );\n\n                        while ( imgThreadIt.hasNext( ) )\n                        {\n                           ImageThread imgThread2 = (ImageThread) imgThreadIt\n                                 .next( );\n                           if ( imgThread.equals( imgThread2 ) )\n                           {\n                              System.out.println( \"Found a match:\" );\n                              System.out.println( \"\\tjavaThread \"\n                                    + javaThread.getName( )\n                                    + \" is the same as \" + imgThread2.getID( ) );\n                           }\n                        }\n                     }\n                     catch ( CorruptDataException e )\n                     {\n                        System.err.println( \"ImageThread was corrupt: \"\n                              + e.getMessage( ) );\n                     }\n                     catch ( DataUnavailable e )\n                     {\n                        System.out.println( \"DataUnavailable: \"\n                              + e.getMessage( ) );\n                     }\n                  }\n               }\n            }\n         }\n      }\n   }\n}\n

For clarity, the example does not perform full error checking when constructing the main Image object and does not perform CorruptData handling in all of the iterators. In a production environment, you use the techniques illustrated in the previous examples under Working with a system dump and Working with a Java dump.

In the example, the program iterates through every available Java thread and checks whether it is equal to any of the available image threads. When they are found to be equal, the program displays the following message: \"Found a match\".

The example demonstrates:

"},{"location":"interface_jvmti/","title":"JVMTI","text":""},{"location":"interface_jvmti/#java-virtual-machine-tool-interface","title":"Java Virtual Machine Tool Interface","text":"

The Java\u2122 Virtual Machine Tool Interface (JVMTI) is a two-way interface that allows communication between the VM and a native agent. It replaces both the Java Virtual Machine Debug Interface (JVMDI) and Java Virtual Machine Profiler Interface (JVMPI).

"},{"location":"interface_jvmti/#overview","title":"Overview","text":"

The JVMTI allows third parties to develop debugging, profiling, and monitoring tools for the VM. The interface contains mechanisms for the agent to notify the VM about the kinds of information it requires, and also provides a means of receiving relevant notifications.

Several agents can be attached to a VM at any one time.

JVMTI agents can be loaded at startup using short or long forms of the command-line option:

-agentlib:<agent-lib-name>=<options>\n

or

-agentpath:<path-to-agent>=<options>\n

In the example that follows (see Sample JVMTI agent), the directory containing the jdwp library is assumed to be on the library path. If you require a specific library, such as jdwp, with your JVMTI agent, you can specify the path at startup, for example:

-agentlib:jdwp=<options>\n

For more information about JVMTI, see https://docs.oracle.com/javase/8/docs/technotes/guides/management/index.html.

For a guide about writing a JVMTI agent, see http://www.oracle.com/technetwork/articles/javase/jvmti-136367.html.

"},{"location":"interface_jvmti/#eclipse-openj9-extensions","title":"Eclipse OpenJ9 extensions","text":"

Eclipse OpenJ9\u2122 extensions to the JVMTI allow a JVMTI agent to query or automatically trigger operations in the VM, including the following tasks:

Task OpenJ9 extensions Get the OS thread ID GetOSThreadID Query, set, and reset the VM dump options QueryVmDump, SetVmDump, ResetVmDump Trigger a VM dump, and monitor JVMTI event functions when VM dumps start and end TriggerVmDump, VMDumpStart, VMDumpEnd Set VM trace options SetVmTrace Subscribe to and unsubscribe from VM tracepoints RegisterTracePointSubscriber, DeregisterTracePointSubscriber Query runtime environment native memory categories GetMemoryCategories Query and set VM log options QueryVmLogOptions, SetVmLogOptions Search for and remove a shared classes cache IterateSharedCaches, DestroySharedCache Subscribe to and unsubscribe from verbose garbage collection (GC) data logging RegisterVerboseGCSubscriber, DeregisterVerboseGCSubscriber

The definitions that you need when you write a JVMTI agent are provided in the header files jvmti.h and ibmjvmti.h, in the include directory.

"},{"location":"interface_jvmti/#sample-jvmti-agent","title":"Sample JVMTI agent","text":"

The following sample shows you how to write a simple JVMTI agent that uses OpenJ9 extensions to the JVMTI.

Sample JVMTI agent written in C/C++, which uses the OpenJ9 extensions
/*\n * tiSample.c\n *\n * Sample JVMTI agent to demonstrate the OpenJ9 JVMTI dump extensions\n */\n\n#include \"jvmti.h\"\n#include \"ibmjvmti.h\"\n\n/* Forward declarations for JVMTI callback functions */\nvoid JNICALL VMInitCallback(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread);\nvoid JNICALL DumpStartCallback(jvmtiEnv *jvmti_env, char* label, char* event, char* detail, ...);\n\n\n/*\n * Agent_Onload()\n *\n * JVMTI agent initialisation function, invoked as agent is loaded by the VM\n */\nJNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {\n\n  jvmtiEnv *jvmti = NULL;\n  jvmtiError rc;\n  jint extensionEventCount = 0;\n  jvmtiExtensionEventInfo *extensionEvents = NULL;\n  jint extensionFunctionCount = 0;\n  jvmtiExtensionFunctionInfo *extensionFunctions = NULL;\n  int i = 0, j = 0;\n\n  printf(\"tiSample: Loading JVMTI sample agent\\n\");\n\n    /* Get access to JVMTI */\n    (*jvm)->GetEnv(jvm, (void **)&jvmti, JVMTI_VERSION_1_0);\n\n     /* Look up all the JVMTI extension events and functions */\n   (*jvmti)->GetExtensionEvents(jvmti, &extensionEventCount, &extensionEvents);\n   (*jvmti)->GetExtensionFunctions(jvmti, &extensionFunctionCount, &extensionFunctions);\n\n    printf(\"tiSample: Found %i JVMTI extension events, %i extension functions\\n\", extensionEventCount, extensionFunctionCount);\n\n   /* Find the JVMTI extension event we want */\n   while (i++ < extensionEventCount) {\n\n        if (strcmp(extensionEvents->id, COM_IBM_VM_DUMP_START) == 0) {\n            /* Found the dump start extension event, now set up a callback for it */\n            rc = (*jvmti)->SetExtensionEventCallback(jvmti, extensionEvents->extension_event_index, &DumpStartCallback);\n            printf(\"tiSample: Setting JVMTI event callback %s, rc=%i\\n\", COM_IBM_VM_DUMP_START, rc);\n            break;\n        }\n        extensionEvents++; /* move on to the next extension event */\n    }\n\n    /* Find the JVMTI extension function we want */\n    while (j++ < extensionFunctionCount) {\n        jvmtiExtensionFunction function = extensionFunctions->func;\n\n        if (strcmp(extensionFunctions->id, COM_IBM_SET_VM_DUMP) == 0) {\n            /* Found the set dump extension function, now set a dump option to generate javadumps on\n          thread starts */\n            rc = function(jvmti, \"java:events=thrstart\");\n            printf(\"tiSample: Calling JVMTI extension %s, rc=%i\\n\", COM_IBM_SET_VM_DUMP, rc);\n            break;\n        }\n        extensionFunctions++; /* move on to the next extension function */\n     }\n\n     return JNI_OK;\n}\n\n\n/*\n * DumpStartCallback()\n * JVMTI callback for dump start event (IBM JVMTI extension)  */\nvoid JNICALL\nDumpStartCallback(jvmtiEnv *jvmti_env, char* label, char* event, char* detail, ...) {\n      printf(\"tiSample: Received JVMTI event callback, for event %s\\n\", event);\n}\n

The sample JVMTI agent consists of two functions, Agent_OnLoad() and DumpStartCallback():

"},{"location":"interface_jvmti/#agent_onload","title":"Agent_OnLoad()","text":"

This function is called by the VM when the agent is loaded at VM startup, which allows the JVMTI agent to modify VM behavior before initialization is complete. The sample agent obtains access to the JVMTI interface by using the JNI Invocation API function GetEnv(). The agent calls the APIs GetExtensionEvents() and GetExtensionFunctions() to find the JVMTI extensions that are supported by the VM. These APIs provide access to the list of extensions available in the jvmtiExtensionEventInfo and jvmtiExtensionFunctionInfo structures. The sample uses an extension event and an extension function in the following way:

Extension event: The sample JVMTI agent searches for the extension event VmDumpStart in the list of jvmtiExtensionEventInfo structures, by using the identifier COM_IBM_VM_DUMP_START provided in ibmjvmti.h. When the event is found, the JVMTI agent calls the JVMTI interface SetExtensionEventCallback() to enable the event, providing a function DumpStartCallback() that is called when the event is triggered.

Extension function: Next, the sample JVMTI agent searches for the extension function SetVMDump in the list of jvmtiExtensionFunctionInfo structures, by using the identifier COM_IBM_SET_VM_DUMP provided in ibmjvmti.h. The JVMTI agent calls the function by using the jvmtiExtensionFunction pointer to set a VM dump option java:events=thrstart. This option requests the VM to trigger a Java dump every time a VM thread is started.

"},{"location":"interface_jvmti/#dumpstartcallback","title":"DumpStartCallback()","text":"

This callback function issues a message when the associated extension event is called. In the sample code, DumpStartCallback() is used when the VmDumpStart event is triggered.

"},{"location":"interface_jvmti/#using-the-sample-jvmti-agent","title":"Using the sample JVMTI agent","text":""},{"location":"interface_jvmti/#api-reference","title":"API reference","text":"

The following sections provide reference information for the OpenJ9 extensions to the JVMTI.

"},{"location":"interface_jvmti/#getosthreadid","title":"GetOSThreadID","text":"

You can get the OS thread ID by using the GetOSThreadID() API:

jvmtiError GetOSThreadID(jvmtiEnv* jvmti_env, jthread thread, jlong * threadid_ptr);\n

Parameters

Returns

JVMTI_ERROR_NONE: Success JVMTI_ERROR_NULL_POINTER: The threadid_ptr parameter is null. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is invalid. JVMTI_ERROR_INVALID_THREAD: The thread is not valid. JVMTI_ERROR_THREAD_NOT_ALIVE: The VM state of the thread is not started or has died. JVMTI_ERROR_UNATTACHED_THREAD: The current thread is not attached to the VM. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI start or live phase.

Identifiers

JVMTI Extension Function identifier: com.ibm.GetOSThreadID Macro declaration in the ibmjvmti.h file: COM_IBM_GET_OS_THREAD_ID

"},{"location":"interface_jvmti/#queryvmdump","title":"QueryVmDump","text":"

You can query the VM dump options that are set for a VM by using the QueryVmDump() API:

jvmtiError QueryVmDump(jvmtiEnv* jvmti_env, jint buffer_size, void* options_buffer, jint* data_size_ptr)\n

This extension returns a set of dump option specifications as ASCII strings. The syntax of the option string is the same as the -Xdump command-line option, with the initial -Xdump: omitted. See -Xdump. The option strings are separated by newline characters. If the memory buffer is too small to contain the current VM dump option strings, you can expect the following results:

Parameters

Returns

JVMTI_ERROR_NONE: Success JVMTI_ERROR_NULL_POINTER: The options_buffer or data_size_ptr parameters are null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is invalid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_NOT_AVAILABLE: The dump configuration is locked because a dump is in progress. JVMTI_ERROR_ILLEGAL_ARGUMENT: The supplied memory buffer in options_buffer is too small.

Identifiers

JVMTI Extension Function identifier: com.ibm.QueryVmDump Macro declaration in the ibmjvmti.h file: COM_IBM_QUERY_VM_DUMP

"},{"location":"interface_jvmti/#setvmdump","title":"SetVmDump","text":"

You can set VM dump options by using the SetVmDump() API:

jvmtiError SetVmDump(jvmtiEnv* jvmti_env, char* option)\n

The dump option is passed in as an ASCII character string. Use the same syntax as the -Xdump command-line option, with the initial -Xdump: omitted. See -Xdump.

When dumps are in progress, the dump configuration is locked, and calls to SetVmDump() fail with a return value of JVMTI_ERROR_NOT_AVAILABLE.

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_NULL_POINTER: The parameter option is null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is invalid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_NOT_AVAILABLE: The dump configuration is locked because a dump is in progress. JVMTI_ERROR_ILLEGAL_ARGUMENT: The parameter option contains an invalid -Xdump string.

Identifiers

JVMTI Extension Function identifier: com.ibm.SetVmDump Macro declaration in the ibmjvmti.h file: COM_IBM_SET_VM_DUMP

"},{"location":"interface_jvmti/#triggervmdump","title":"TriggerVmDump","text":"

You can trigger a VM dump and specify the type of dump you want by using the TriggerVmDump() API:

jvmtiError TriggerVmDump(jvmtiEnv* jvmti_env, char* option)\n

Choose the type of dump required by specifying an ASCII string that contains one of the supported dump agent types. See -Xdump. JVMTI events are provided at the start and end of the dump.

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_NULL_POINTER: The option parameter is null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is invalid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_NOT_AVAILABLE: The dump configuration is locked because a dump is in progress.

Identifiers

JVMTI Extension Function identifier: com.ibm.TriggerVmDump Macro declaration in the ibmjvmti.h file: COM_IBM_TRIGGER_VM_DUMP

"},{"location":"interface_jvmti/#resetvmdump","title":"ResetVmDump","text":"

You can reset VM dump options to the values at VM initialization by using the ResetVmDump() API:

jvmtiError ResetVmDump(jvmtiEnv* jvmti_env)\n

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is invalid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_NOT_AVAILABLE: The dump configuration is locked because a dump is in progress.

Identifiers

JVMTI Extension Function identifier: com.ibm.ResetVmDump Macro declaration in the ibmjvmti.h file: COM_IBM_RESET_VM_DUMP

"},{"location":"interface_jvmti/#vmdumpstart","title":"VMDumpStart","text":"

The following JVMTI event function is called when a VM dump starts:

void JNICALL VMDumpStart(jvmtiEnv *jvmti_env, JNIEnv* jni_env, char* label, char* event, char* detail)\n

The event function provides the dump file name, the name of the JVMTI event, and the detail string from the dump event. The detail string provides additional information about the event that triggered the dump. This information is the same as the information detailed in the JVMDUMP039I message. For example:

JVMDUMP039I Processing dump event \"systhrow\", detail \"java/lang/OutOfMemoryError\" at 2014/10/17 13:31:03 - please wait.\"\n

Parameters

Returns

None

"},{"location":"interface_jvmti/#vmdumpend","title":"VMDumpEnd","text":"

The following JVMTI event function is called when a VM dump ends:

void JNICALL VMDumpEnd(jvmtiEnv *jvmti_env, JNIEnv* jni_env, char* label, char* event, char* detail)\n

The event function provides the dump file name, the name of the JVMTI event, and the detail string from the dump event. The detail string provides additional information about the event that triggered the dump. This information is the same as the information detailed in the JVMDUMP039I message. For example:

JVMDUMP039I Processing dump event \"systhrow\", detail \"java/lang/OutOfMemoryError\" at 2014/10/17 13:31:03 - please wait.\n

Parameters

Returns

None

"},{"location":"interface_jvmti/#setvmtrace","title":"SetVmTrace","text":"

You can set VM trace options by using the SetVmTrace() API:

jvmtiError SetVmTrace(jvmtiEnv* jvmti_env, char* option)\n

The trace option is passed in as an ASCII character string. Use the same syntax as the -Xtrace command-line option, with the initial -Xtrace: omitted. See -Xtrace.

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_NULL_POINTER: The option parameter is null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is invalid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_ILLEGAL_ARGUMENT: The option parameter contains an invalid -Xtrace string.

Identifiers

JVMTI Extension Function identifier: com.ibm.SetVmTrace Macro declaration in the ibmjvmti.h file: COM_IBM_SET_VM_TRACE

"},{"location":"interface_jvmti/#registertracepointsubscriber","title":"RegisterTracePointSubscriber","text":"

You can subscribe to VM tracepoints by using the RegisterTracePointSubscriber() API:

jvmtiError RegisterTracePointSubscriber(jvmtiEnv* jvmti_env, char *description, jvmtiTraceSubscriber subscriber, jvmtiTraceAlarm alarm, void *userData, void **subscriptionID)\n

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_NULL_POINTER: One of the supplied parameters is null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is not valid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_NOT_AVAILABLE: VM trace is not available. JVMTI_ERROR_INTERNAL: An internal error occurred.

Identifiers

JVMTI Extension Function identifier: com.ibm.RegisterTracePointSubscriber Macro declaration in the ibmjvmti.h file: COM_IBM_REGISTER_TRACEPOINT_SUBSCRIBER

"},{"location":"interface_jvmti/#jvmtitracesubscriber-function","title":"jvmtiTraceSubscriber function","text":"

The subscriber function type is defined as follows:

typedef jvmtiError (*jvmtiTraceSubscriber)(jvmtiEnv *jvmti_env, void *record, jlong length, void *user_data);\n

The subscriber function must be of type jvmtiTraceSubscriber, which is declared in ibmjvmti.h.

This function is called with each tracepoint record that is selected through the -Xtrace:external option.

The tracepoint record that is supplied to the subscriber function is valid only for the duration of the function. If the subscriber wants to save the data, the data must be copied elsewhere.

If the subscriber function returns an error, the alarm function is called, the subscription is disconnected, and no further tracepoints are sent to the subscriber.

Subscriber function parameters

"},{"location":"interface_jvmti/#jvmtitracealarm-function","title":"jvmtiTraceAlarm function","text":"

The alarm function type is defined as follows:

typedef jvmtiError (*jvmtiTraceAlarm)(jvmtiEnv *jvmti_env, void *subscription_id, void *user_data);\n

The alarm function must be of type jvmtiTraceAlarm, which is declared in ibmjvmti.h. This function is called if the subscriber function returns an error.

Alarm function parameters

"},{"location":"interface_jvmti/#deregistertracepointsubscriber","title":"DeregisterTracePointSubscriber","text":"

You can unsubscribe from VM tracepoints by using the DeregisterTracePointSubscriber() API:

jvmtiError DeregisterTracePointSubscriber(jvmtiEnv* jvmti_env, void *userData, void *subscription_id)\n

After the DeregisterTracePointSubscriber() API is called, no further calls are made to the subscriber function.

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_NULL_POINTER: The subscription_id parameter is null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is not valid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase.

Identifiers

JVMTI Extension Function identifier: com.ibm.DeregisterTracePointSubscriber Macro declaration in the ibmjvmti.h file: COM_IBM_DEREGISTER_TRACEPOINT_SUBSCRIBER

"},{"location":"interface_jvmti/#getmemorycategories","title":"GetMemoryCategories","text":"

You can query runtime environment native memory categories by using the GetMemoryCategories() API:

jvmtiError GetMemoryCategories(jvmtiEnv* env, jint version, jint max_categories, jvmtiMemoryCategory * categories_buffer, jint * written_count_ptr, jint * total_categories_ptr);\n

You can query the total native memory consumption of the runtime environment for each memory category by using this API. Native memory is memory requested from the operating system using library functions such as malloc() and mmap(). Runtime environment native memory use is grouped under high-level memory categories, as described in the NATIVEMEMINFO section of the Java dump topic. The data returned by the GetMemoryCategories() API is consistent with this format. See Java dump: NATIVEMEMINFO.

The extension writes native memory information to a memory buffer specified by the user. Each memory category is recorded as a jvmtiMemoryCategory structure, whose format is defined in ibmjvmti.h.

You can use the GetMemoryCategories() API to work out the buffer size you must allocate to hold all memory categories defined inside the VM. To calculate the size, call the API with a null categories_buffer argument and a non-null total_categories_ptr argument.

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_UNSUPPORTED_VERSION: Unrecognized value passed for version. JVMTI_ERROR_ILLEGAL_ARGUMENT: Illegal argument; categories_buffer, count_ptr, and total_categories_ptr all have null values. JVMTI_ERROR_INVALID_ENVIRONMENT: The env parameter is invalid. JVMTI_ERROR_OUT_OF_MEMORY: Memory category data is truncated because max_categories is not large enough.

Identifiers

JVMTI Extension Function identifier: com.ibm.GetMemoryCategories Macro declaration in the ibmjvmti.h file: COM_IBM_GET_MEMORY_CATEGORIES

"},{"location":"interface_jvmti/#queryvmlogoptions","title":"QueryVmLogOptions","text":"

You can query VM log options by using the QueryVmLogOptions() API:

jvmtiError QueryVmLogOptions(jvmtiEnv* jvmti_env, jint buffer_size, void* options, jint* data_size_ptr)\n

This extension returns the current log options as an ASCII string. The syntax of the string is the same as the -Xsyslog command-line option, with the initial -Xsyslog: omitted. For example, the string \"error,warn\" indicates that the VM is set to log error and warning messages only. For more information, see -Xsyslog.

Parameters

Returns

JVMTI_ERROR_NONE: Success JVMTI_ERROR_NULL_POINTER: The options or data_size_ptr parameters are null. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is invalid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_ILLEGAL_ARGUMENT: The supplied memory buffer is too small.

Identifiers

JVMTI Extension Function identifier: com.ibm.QueryVmLogOptions Macro declaration in the ibmjvmti.h file: COM_IBM_QUERY_VM_LOG_OPTIONS

"},{"location":"interface_jvmti/#setvmlogoptions","title":"SetVmLogOptions","text":"

You can set VM log options by using the SetVmLogOptions() API:

jvmtiError SetVmLogOptions(jvmtiEnv* jvmti_env, char* options_buffer)\n

The log option is passed in as an ASCII character string. Use the same syntax as the -Xsyslog command-line option, with the initial -Xsyslog: omitted. For example, to set the VM to log error and warning messages, pass in a string containing \"error,warn\". For more information, see -Xsyslog.

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_NULL_POINTER: The parameter option is null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is invalid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_ILLEGAL_ARGUMENT: The parameter option contains an invalid -Xsyslog string.

Identifiers

JVMTI Extension Function identifier: com.ibm.SetVmLogOptions Macro declaration in the ibmjvmti.h file: COM_IBM_SET_VM_LOG_OPTIONS

"},{"location":"interface_jvmti/#iteratesharedcaches","title":"IterateSharedCaches","text":"

You can search for shared classes caches that exist in a specified cache directory by using the IterateSharedCaches() API:

jvmtiError IterateSharedCaches(jvmtiEnv* env, jint version, const char *cacheDir, jint flags, jboolean useCommandLineValues, jvmtiIterateSharedCachesCallback callback, void *user_data);\n

Information about the caches is returned in a structure that is populated by a user-specified callback function. You can specify the search directory in two ways:

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The env parameter is not valid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_UNSUPPORTED_VERSION: The version parameter is not valid. JVMTI_ERROR_NULL_POINTER: The callback parameter is null. JVMTI_ERROR_NOT_AVAILABLE: The shared classes feature is not enabled in the VM. JVMTI_ERROR_ILLEGAL_ARGUMENT: The flags parameter is not valid. JVMTI_ERROR_INTERNAL: This error is returned when the jvmtiIterateSharedCachesCallback returns JNI_ERR.

Identifiers

JVMTI Extension Function identifier: com.ibm.IterateSharedCaches Macro declaration in the ibmjvmti.h file: COM_IBM_ITERATE_SHARED_CACHES

"},{"location":"interface_jvmti/#jvmtiiteratesharedcachescallback-function","title":"jvmtiIterateSharedCachesCallback function","text":"

Callback function parameters

Callback function returns

JNI_OK: Continue iterating. JNI_ERR: Stop iterating, which causes IterateSharedCaches to return JVMTI_ERROR_INTERNAL

"},{"location":"interface_jvmti/#jvmtisharedcacheinfo-structure","title":"jvmtiSharedCacheInfo structure","text":"

The structure of jvmtiSharedCacheInfo

typedef struct jvmtiSharedCacheInfo {\nconst char *name;      // the name of the shared cache\njboolean isCompatible; // if the shared cache is compatible with this VM\njboolean isPersistent; // true if the shared cache is persistent, false if its non-persistent\njint os_shmid;         // the OS shared memory ID associated with a non-persistent cache, -1 otherwise\njint os_semid;         // the OS shared semaphore ID associated with a non-persistent cache, -1 otherwise\njint modLevel;         // one of:\n                       //   COM_IBM_SHARED_CACHE_MODLEVEL_JAVA5\n                       //   COM_IBM_SHARED_CACHE_MODLEVEL_JAVA6\n                       //   COM_IBM_SHARED_CACHE_MODLEVEL_JAVA7\n                       //   COM_IBM_SHARED_CACHE_MODLEVEL_JAVA8\n                       //   COM_IBM_SHARED_CACHE_MODLEVEL_JAVA9\n                       //   from Java 10: the version number of the Java level on which the shared cache is created\njint addrMode;         // the address mode of the VM creating the shared cache: includes additional\n                       // information on whether it is a 64-bit compressedRefs cache when\n                       // COM_IBM_ITERATE_SHARED_CACHES_VERSION_3 or later is specified.\njboolean isCorrupt;    // if the cache is corrupted\njlong cacheSize;       // the total usable shared classes cache size, or -1 when isCompatible is false\njlong freeBytes;       // the number of free bytes in the shared classes cache, or -1 when isCompatible is false\njlong lastDetach;      // the last detach time specified in milliseconds since 00:00:00 on 1 January 1970 UTC,\n                       // or -1 when the last detach time is not available\njint cacheType;        // the type of the cache\njlong softMaxBytes;    // the soft limit for the available space in the cache\njint layer;            // the shared cache layer number\n} jvmtiSharedCacheInfo;\n

Notes:

To get the address mode, use:

COM_IBM_ITERATE_SHARED_CACHES_GET_ADDR_MODE(jvmtiSharedCacheInfo.addrMode)\n

This macro returns one of the following values: COM_IBM_SHARED_CACHE_ADDRMODE_32 COM_IBM_SHARED_CACHE_ADDRMODE_64

To get the compressed references mode, use:

COM_IBM_ITERATE_SHARED_CACHES_GET_CMPRSSREF_MODE(jvmtiSharedCacheInfo.addrMode)\n

This macro returns one of the following values: COM_IBM_ITERATE_SHARED_CACHES_UNKNOWN_COMPRESSED_POINTERS_MODE COM_IBM_ITERATE_SHARED_CACHES_COMPRESSED_POINTERS_MODE COM_IBM_ITERATE_SHARED_CACHES_NON_COMPRESSED_POINTERS_MODE

"},{"location":"interface_jvmti/#destroysharedcache","title":"DestroySharedCache","text":"

You can remove a shared classes cache by using the DestroySharedCache() API:

jvmtiError DestroySharedCache(jvmtiEnv *env, const char *cacheDir, const char *name, jint persistence, jboolean useCommandLineValues, jint *internalErrorCode);\n

This extension removes a named shared classes cache of a given persistence type, in a given directory. You can specify the cache name, persistence type, and directory in one of these ways:

Parameters

Returns

JVMTI_ERROR_NONE: Success. No cache exists or all existing caches of all generations are removed. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The env parameter is not valid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_NOT_AVAILABLE: The shared classes feature is not enabled in the VM. JVMTI_ERROR_ILLEGAL_ARGUMENT: The persistence parameter is not valid. JVMTI_ERROR_INTERNAL: Failed to remove any existing cache with the given name. See the value of the internalErrorCode parameter for more information about the failure.

Identifiers

JVMTI Extension Function identifier: com.ibm.DestroySharedCache Macro declaration in the ibmjvmti.h file: COM_IBM_DESTROY_SHARED_CACHE

"},{"location":"interface_jvmti/#registerverbosegcsubscriber","title":"RegisterVerboseGCSubscriber","text":"

You can subscribe to verbose garbage collection (GC) data logging by using the RegisterVerboseGCSubscriber() API:

jvmtiError RegisterVerboseGCSubscriber(jvmtiEnv* jvmti_env, char *description, jvmtiVerboseGCSubscriber subscriber, jvmtiVerboseGCAlarm alarm, void *user_data, void **subscription_id)\n

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_NULL_POINTER: One of the supplied parameters is null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is not valid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase. JVMTI_ERROR_NOT_AVAILABLE: GC verbose logging is not available. JVMTI_ERROR_INTERNAL: An internal error has occurred.

Identifiers

JVMTI Extension Function identifier: com.ibm.RegisterVerboseGCSubscriber Macro declaration in the ibmjvmti.h file: COM_IBM_REGISTER_VERBOSEGC_SUBSCRIBER

"},{"location":"interface_jvmti/#jvmtiverbosegcsubscriber-function","title":"jvmtiVerboseGCSubscriber function","text":"

The subscriber function type is defined as follows:

typedef jvmtiError (*jvmtiVerboseGCSubscriber)(jvmtiEnv *jvmti_env, const char *record, jlong length, void *user_data);\n

The subscriber function must be of type jvmtiVerboseGCSubscriber, which is declared in ibmjvmti.h.

This function is called with each record of verbose logging data produced by the VM.

This function runs under the same restrictions as the GarbageCollectionStart and GarbageCollectionFinish events in the standard JVMTI specification. For more information about these events, see the JVMTI Event Index for your OpenJDK version.

The verbose logging record supplied to the subscriber function is valid only for the duration of the function. If the subscriber wants to save the data, the data must be copied elsewhere.

If the subscriber function returns an error, the alarm function is called, and the subscription is deregistered.

Subscriber function parameters

"},{"location":"interface_jvmti/#jvmtiverbosegcalarm-function","title":"jvmtiVerboseGCAlarm function","text":"

The alarm function type is defined as follows:

typedef jvmtiError (*jvmtiVerboseGCAlarm)(jvmtiEnv *jvmti_env, void *subscription_id, void *user_data);\n

The alarm function must be of type jvmtiVerboseGCAlarm, which is declared in ibmjvmti.h. This function is called if the subscriber function returns an error.

This function runs under the same restrictions as the GarbageCollectionStart and GarbageCollectionFinish events in the standard JVMTI specification. For more information about these events, see the JVMTI Event Index for your OpenJDK version.

Alarm function parameters

"},{"location":"interface_jvmti/#deregisterverbosegcsubscriber","title":"DeregisterVerboseGCSubscriber","text":"

You can unsubscribe from verbose Garbage Collection (GC) data logging by using the DeregisterVerboseGCSubscriber() API:

jvmtiError DeregisterVerboseGCSubscriber(jvmtiEnv* jvmti_env, void *userData, void *subscription_id)\n

After the DeregisterVerboseGCSubscriber() API is called, no further calls are made to the previously registered subscriber function.

Parameters

Returns

JVMTI_ERROR_NONE: Success. JVMTI_ERROR_NULL_POINTER: The subscription_id parameter is null. JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request. JVMTI_ERROR_INVALID_ENVIRONMENT: The jvmti_env parameter is not valid. JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase.

Identifiers

JVMTI Extension Function identifier: com.ibm.DeregisterVerboseGCSubscriber Macro declaration in the ibmjvmti.h file: COM_IBM_DEREGISTER_VERBOSEGC_SUBSCRIBER

"},{"location":"interface_lang_management/","title":"Language Management","text":""},{"location":"interface_lang_management/#language-management-interface","title":"Language management interface","text":"

Eclipse OpenJ9\u2122 provides MXBean extensions to the standard java.lang.management API, which can be used to monitor and manage the Java\u2122 virtual machine. These extensions provide access to information about the state of the OpenJ9 VM and the environment in which it is running. The following tables list the MXBeans by package and describe the monitoring or management capabilities.

Package: com.ibm.lang.management

MXBean Description GarbageCollectorMXBean Discovers Garbage Collection (GC) operations (collection times, compactions, heap memory usage, and freed memory). JvmCpuMonitorMXBean Discovers CPU consumption by category (GC, JIT, or other threads). MemoryMXBean Discovers memory usage (minimum and maximum heap sizes, and shared classes cache sizes). MemoryPoolMXBean Discovers memory pool usage for specific GC policies. OperatingSystemMXBean Discovers information about the operating system (memory, CPU capacity/utilization). RuntimeMXBean Discovers information about the runtime environment (CPU load, Java process ID, and VM state) ThreadMXBean Discovers information about native thread IDs. UnixOperatingSystemMXBean Discovers information for Unix operating systems (memory, file descriptors, processors, processor usage, and hardware)

Package: com.ibm.virtualization.management

MXBean Description GuestOSMXBean Discovers CPU and memory statistics of a virtual machine or logical partition as seen by the Hypervisor. HypervisorMXBean Discovers whether the operating system is running on a hypervisor and provides information about the hypervisor.

Package: openj9.lang.management

MXBean Description OpenJ9DiagnosticsMXBean Configures and dynamically triggers dump agents.

For more information about using these MXBeans, read the API documentation. For Java 8, see the OpenJ9 Language Management API documentation.

"},{"location":"introduction/","title":"Getting started","text":""},{"location":"introduction/#getting-started-with-eclipse-openj9","title":"Getting started with Eclipse OpenJ9","text":"

Eclipse OpenJ9\u2122 is a high performance, scalable, Java\u2122 virtual machine (VM) implementation that is fully compliant with the Java Virtual Machine Specification.

At run time, the VM interprets the Java bytecode that is compiled by the Java compiler. The VM acts as a translator between the language and the underlying operating system and hardware. A Java program requires a specific VM to run on a particular platform, such as Linux\u00ae, z/OS\u00ae, or Windows\u2122.

This material provides information about the VM configuration and tuning options, together with the default settings. Follow the links provided for more detailed information.

"},{"location":"introduction/#configuring-your-system","title":"Configuring your system","text":"

Most Java applications should run on an OpenJDK that contains the OpenJ9 VM without changing anything on the underlying system. However, to get the most out of your system you might want to consider some configuration options. Read Configuring your system to learn more about the following options:

"},{"location":"introduction/#performance-tuning","title":"Performance tuning","text":"

OpenJ9 is configured to start with a set of default options that provide the optimal runtime environment for Java applications with typical workloads. However, if your application is atypical, you can improve performance by tuning the OpenJ9 VM. You can also improve performance by enabling hardware features or using specific APIs in your application code.

"},{"location":"introduction/#garbage-collection-policies","title":"Garbage collection policies","text":"

OpenJ9 includes several garbage collection policies. To learn more about these policies and the types of application workload that can benefit from them, see Garbage collection policies.

"},{"location":"introduction/#class-data-sharing","title":"Class data sharing","text":"

You can share class data between running VMs, which can reduce the startup time for a VM after the cache has been created. For more information, see Introduction to class data sharing.

"},{"location":"introduction/#native-data-operations","title":"Native data operations","text":"

If your Java application manipulates native data, consider writing your application to take advantage of methods in the Data Access Accelerator (DAA) API.

The following functions are provided:

You can gain a number of benefits by using the APIs provided:

For more information, see the API documentation.

"},{"location":"introduction/#cloud-optimizations","title":"Cloud optimizations","text":"

To improve the performance of applications that run in containers, try setting the following tuning options:

The OpenJ9 VM automatically detects when it is running in a docker container and uses a mechanism to detect when the VM is idle. When an idle state is detected, OpenJ9 runs a garbage collection cycle and releases free memory pages back to the operating system. The object heap is also compacted to make best use of the available memory for further application processing. Compaction is triggered by internal heuristics that look into the number of fragmented pages. Typically there is no need to force a compaction.

For cloud services that charge based on memory usage, maintaining a small footprint can generate cost savings. For more information about tuning options that control this process, see -XX:IdleTuningMinIdleWaitTime.

"},{"location":"introduction/#cryptographic-operations","title":"Cryptographic operations","text":"

OpenJDK uses the in-built Java cryptographic implementation by default. However, native cryptographic implementations typically provide better performance. OpenSSL is a native open source cryptographic toolkit for Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols, which is well established and used with many enterprise applications. For more information, see OpenSSL.

"},{"location":"introduction/#exploiting-gpus","title":"Exploiting GPUs","text":"

OpenJ9 provides both the CUDA4J API and the GPU API, which enables you to develop applications that can take advantage of graphics processing unit (GPU) processing for suitable functions, such as sorting arrays. You can also enable the JIT compiler to offload certain processing tasks to a GPU by specifying the -Xjit:enableGPU option on the command line. When enabled, the JIT compiler determines when to offload tasks based on performance heuristics.

GPU processing is supported only on Linux little-endian systems, such as x86-64 and IBM Power LE, and Windows x86-64 systems. For more information about enabling GPU processing, see Exploiting graphics processing units.

Special consideration is needed when using the WDDM driver model for GPUs on Windows. Using the WDDM driver model means the GPU is also used as a display device and as such is subject to the Timeout Detection and Recovery (TDR) mechanism of Windows. If you are running demanding GPU workloads, you should increase the timeout from the default 2 seconds. More detail may be found in NVIDIA's Installation Guide for Windows.

"},{"location":"introduction/#hardware-acceleration","title":"Hardware acceleration","text":"

On AIX\u00ae systems that contain the Nest accelerator (NX) co-processor, OpenJ9 can take advantage of the zlibNX library. This library is an enhanced version of the zlib compression library that supports hardware-accelerated data compression and decompression. The zlibNX library is supported on AIX version 7.2 TL4 and later and must be installed on the system. The Nest accelerator (NX) co-processor is available on IBM POWER9\u00ae systems. To learn more about zlibNX, see Data compression by using the zlibNX library.

"},{"location":"introduction/#runtime-options","title":"Runtime options","text":"

Runtime options are specified on the command line and include system properties, standard options, nonstandard (-X) options, and -XX options. For a detailed list of runtime options, see OpenJ9 command-line options

"},{"location":"introduction/#default-settings","title":"Default settings","text":"

If you do not specify any options on the command line at run time, the OpenJ9 VM starts with default settings that define how it operates. For more information about these settings, see Default settings for the OpenJ9 VM.

"},{"location":"introduction/#using-jlink","title":"Using jlink","text":"

On Java 11 and later, you can use the jlink utility to create a custom OpenJ9 runtime image, which allows you to optimize image size. If you do not require translations from the English language, the translation files can be removed to further optimize the size. You can achieve this by specifying the --exclude-files=**java_**.properties option when you run jlink. The default English java.properties file is unaffected.

"},{"location":"introduction/#using-jpackage","title":"Using jpackage","text":"

(Linux, macOS, and Windows only)

You can use the jpackage utility to package a Java application into a platform-specific package that includes all of the necessary dependencies. Full details of the tool are available at JEP 392: Packaging Tool. Instructions for using it and the various options available, are documented in the Oracle Tool Specifications: The jpackage Command.

"},{"location":"introduction/#troubleshooting","title":"Troubleshooting","text":"

The OpenJ9 diagnostic component contains extensive features to assist with problem determination. Diagnostic data is produced under default conditions, but can also be controlled by starting the VM with the -Xdump option or using the com.ibm.jvm.Dump API. You can also trace Java applications, methods, and VM operations by using the -Xtrace option.

To get started, read Diagnostic tools and data.

"},{"location":"jit/","title":"JIT Compiler","text":""},{"location":"jit/#the-jit-compiler","title":"The JIT compiler","text":"

The Just-In-Time (JIT) compiler is a key component of the Eclipse OpenJ9\u2122 VM that improves the performance of Java applications by compiling platform-neutral Java bytecode into native machine code at run time. Without the JIT, the VM has to interpret the bytecodes itself - a process that requires extra CPU and memory.

The JIT compiler doesn't compile every method that gets called because thousands of methods can be called at startup. Instead, OpenJ9 records the number of times a method is called. When the count reaches a pre-defined invocation threshold, JIT compilation is triggered. Once a method has been compiled by the JIT, the VM can call the compiled method rather than interpreting it.

"},{"location":"jit/#optimization-levels","title":"Optimization levels","text":"

The JIT compiler can compile a method at different optimization levels: cold, warm, hot, very hot (with profiling), or scorching. The hotter the optimization level, the better the expected performance, but the higher the cost in terms of CPU and memory.

For higher optimization levels, the VM uses a sampling thread to identify methods that continue to take a lot of time. Methods that consume more than 1% are compiled at hot. Methods that consume more than 12.5% are scheduled for a scorching compilation. However, before that happens the methods are compiled at very hot with profiling to collect detailed profile data that is used by the scorching compilation.

The higher optimization levels use special techniques such as escape analysis and partial redundancy elimination, or loop through certain optimization sequences more times. Although these techniques use more CPU and memory, the improved performance that is delivered by the optimizations can make the tradeoff worthwhile.

"},{"location":"jit/#troubleshooting","title":"Troubleshooting","text":"

The JIT compiler is enabled by default to optimize performance. However, if you experience a problem running your application, temporarily turning off the JIT will tell you whether the JIT is at fault.

Because JIT starts at the same time as the VM, you can only modify JIT behavior at startup.

There are a number of ways to disable the JIT:

Note: java.lang.Compiler is deprecated for removal in Java SE 9.

If turning off the JIT solves your problem, you can investigate JIT operations in more detail by using a number of options to control behavior.

Turning on verbose logging with the verbose suboption causes the JIT to record all compiler operations. However, the log file can be difficult to read because there are so many complex operations occuring in rapid succession. Follow these steps to simplify operations, which helps you pinpoint the root cause:

Turn off multiple compilation threads

The JIT compiler can use more than one compilation thread, which typically improves startup performance. The number of threads is determined by the VM, depending on the system configuration. You can turn off multiple threads by using the -XcompilationThreads option, which simplifies the output in the verbose log.

Lower the invocation threshold

When the invocation count is set to 0, the JIT compiles every method and your application will fail immediately when the method causing the problem is reached. You can alter the threshold with the count suboption.

Turn off inlining

Inlining is a complex process that generates larger and more complex code. To eliminate errors caused by these operations, use the disableInlining suboption.

Decrease the optimization levels

Use the optlevel suboption to gradually decrease the compiler optimization levels to see whether you can isolate the level at which your problem occurs.

More information about these suboptions and the command line syntax is covered in -Xjit.

"},{"location":"jit/#understanding-jit-verbose-logs","title":"Understanding JIT verbose logs","text":"

At first glance, a JIT verbose log can look very complex. To help you understand the log we'll look at JIT compiler operations when you run the java -version command.

The following option turns on verbose logging and directs output to a log file called vlogfile:

java -Xjit:verbose,vlog=vlogfile -version\n

The first section of the log includes lines that start with #INFO:, which provides information about the environment that the JIT is operating in. You can determine the version of the JIT and VM that you are using, and the type and number of processors that the JIT has access to.

#INFO:  _______________________________________\n#INFO:  Version Information:\n#INFO:       JIT Level  - e24e8aa9\n#INFO:       JVM Level  - 20180315_120\n#INFO:       GC Level   - e24e8aa9\n#INFO:  \n#INFO:  Processor Information:\n#INFO:       Platform Info:X86 Intel P6\n#INFO:       Vendor:GenuineIntel\n#INFO:       numProc=1\n#INFO:  \n#INFO:  _______________________________________\n#INFO:  AOT\n#INFO:  options specified:\n#INFO:       samplingFrequency=2\n#INFO:  \n#INFO:  options in effect:\n#INFO:       verbose=1\n#INFO:       vlog=vlogfile\n#INFO:       compressedRefs shiftAmount=0\n#INFO:       compressedRefs isLowMemHeap=1\n#INFO:  _______________________________________\n#INFO:  JIT\n#INFO:  options specified:\n#INFO:       verbose,vlog=vlogfile\n#INFO:  \n#INFO:  options in effect:\n#INFO:       verbose=1\n#INFO:       vlog=vlogfile\n#INFO:       compressedRefs shiftAmount=0\n#INFO:       compressedRefs isLowMemHeap=1\n#INFO:  StartTime: Apr 23 09:49:10 2018\n#INFO:  Free Physical Memory: 996188 KB\n#INFO:  CPU entitlement = 100.00\n

This section also shows the AOT and JIT options that are in force. The last few lines detail the start time of the compilation activity, how much free physical memory is available to the process, and the CPU entitlement.

The information section is followed by a sequence of lines that describe the methods that are being compiled, as well as other events significant to the operation of the JIT compiler.

Here is a typical line from the verbose log:

+ (cold) sun/reflect/Reflection.getCallerClass()Ljava/lang/Class; @ 00007FCACED1303C-00007FCACED13182 OrdinaryMethod - Q_SZ=0 Q_SZI=0 QW=1 j9m=00000000011E7EA8 bcsz=2 JNI compThread=0 CpuLoad=2%(2%avg) JvmCpu=0%\n

In this example:

Each line of output represents a method that is compiled.

The following example requests information about the performance of JIT compiler threads, with output written to vlogfile.

java -Xjit:verbose={compilePerformance},vlog=vlogfile -version\n

The output generated by using this command adds the values time and mem into each line, as shown in the following example:

+ (cold) java/lang/System.getEncoding(I)Ljava/lang/String; @ 00007F29183A921C-00007F29183A936D OrdinaryMethod - Q_SZ=0 Q_SZI=0 QW=1 j9m=0000000000F13A70 bcsz=3 JNI time=311us mem=[region=704 system=16384]KB compThread=0 CpuLoad=2%(2%avg) JvmCpu=0%\n

The following example can be used to create verbose output that includes lines to show when compilation for a method starts and ends, and any methods that are inlined during the compilation.

java '-Xjit:verbose={compileStart|compileEnd|inlining},count=5,vlog=vlogfile' -XcompilationThreads1 -version\n

Note: The suboptions count and -XcompilationThreads1 are included only to simplify the output for this example and are not recommended for production.

The following section is taken from the output and describes the compilation and inlining of one method java/lang/String.equals:

(warm) Compiling java/lang/String.equals(Ljava/lang/Object;)Z  OrdinaryMethod j9m=0000000001300B30 t=90 compThread=0 memLimit=262144 KB freePhysicalMemory=969 MB\n#INL: 7 methods inlined into 4dce72bd java/lang/String.equals(Ljava/lang/Object;)Z @ 00007F53190A3E40\n#INL: #0: 4dce72bd #-1 inlined 4dce72bd@22 -> 81670d20 bcsz=37 java/lang/String.lengthInternal()I\n#INL: #1: 4dce72bd #-1 inlined 4dce72bd@28 -> 81670d20 bcsz=37 java/lang/String.lengthInternal()I\n#INL: #2: 4dce72bd #-1 inlined 4dce72bd@104 -> bf62dcaf bcsz=182 java/lang/String.regionMatchesInternal(Ljava/lang/String;Ljava/lang/String;[C[CIII)Z\n#INL: #3: 4dce72bd #2 inlined bf62dcaf@121 -> bbb5af92 bcsz=39 java/lang/String.charAtInternal(I[C)C\n#INL: #4: 4dce72bd #2 inlined bf62dcaf@131 -> bbb5af92 bcsz=39 java/lang/String.charAtInternal(I[C)C\n#INL: #5: 4dce72bd #2 inlined bf62dcaf@156 -> bbb5af92 bcsz=39 java/lang/String.charAtInternal(I[C)C\n#INL: #6: 4dce72bd #2 inlined bf62dcaf@166 -> bbb5af92 bcsz=39 java/lang/String.charAtInternal(I[C)C\n#INL: 4dce72bd called 4dce72bd@120 -> f734b49c bcsz=233 java/lang/String.deduplicateStrings(Ljava/lang/String;Ljava/lang/String;)V\n#INL: 4dce72bd coldCalled 4dce72bd@104 -> bf62dcaf bcsz=182 java/lang/String.regionMatchesInternal(Ljava/lang/String;Ljava/lang/String;[C[CIII)Z\n#INL: 4dce72bd coldCalled 4dce72bd@104 -> bf62dcaf bcsz=182 java/lang/String.regionMatchesInternal(Ljava/lang/String;Ljava/lang/String;[C[CIII)Z\n+ (warm) java/lang/String.equals(Ljava/lang/Object;)Z @ 00007F53190A3E40-00007F53190A40D0 OrdinaryMethod - Q_SZ=277 Q_SZI=277 QW=1667 j9m=0000000001300B30 bcsz=127 GCR compThread=0 CpuLoad=2%(2%avg) JvmCpu=0%\n

The first line is included as a result of setting the compileStart suboption and shows the start of the warm method compilation:

(warm) Compiling java/lang/String.equals(Ljava/lang/Object;)Z OrdinaryMethod j9m=0000000001300B30 t=90 compThread=0 memLimit=262144 KB freePhysicalMemory=969 MB\n

Similarly, the last line shows the successful compilation of this method, as denoted by the +:

+ (warm) java/lang/String.equals(Ljava/lang/Object;)Z @ 00007F53190A3E40-00007F53190A40D0 OrdinaryMethod - Q_SZ=277 Q_SZI=277 QW=1667 j9m=0000000001300B30 bcsz=127 GCR compThread=0 CpuLoad=2%(2%avg) JvmCpu=0%\n

The lines inbetween that start with #INL describe the inlining operations that took place. A total of 7 methods were inlined into java/lang/String.equals:

The first three methods (#0, #1, #2) are inlined into the top level method, denoted as #-1:

#INL: #0: 4dce72bd #-1 inlined 4dce72bd@22 -> 81670d20 bcsz=37 java/lang/String.lengthInternal()I\n#INL: #1: 4dce72bd #-1 inlined 4dce72bd@28 -> 81670d20 bcsz=37 java/lang/String.lengthInternal()I\n#INL: #2: 4dce72bd #-1 inlined 4dce72bd@104 -> bf62dcaf bcsz=182 java/lang/String.regionMatchesInternal(Ljava/lang/String;Ljava/lang/String;[C[CIII)Z\n

The next four methods (#3, #4, #5, #6) are inlined into the method denoted by #2.

#INL: #3: 4dce72bd #2 inlined bf62dcaf@121 -> bbb5af92 bcsz=39 java/lang/String.charAtInternal(I[C)C\n#INL: #4: 4dce72bd #2 inlined bf62dcaf@131 -> bbb5af92 bcsz=39 java/lang/String.charAtInternal(I[C)C\n#INL: #5: 4dce72bd #2 inlined bf62dcaf@156 -> bbb5af92 bcsz=39 java/lang/String.charAtInternal(I[C)C\n#INL: #6: 4dce72bd #2 inlined bf62dcaf@166 -> bbb5af92 bcsz=39 java/lang/String.charAtInternal(I[C)C\n

Here's how to interpret the line for #INL: #0::

The method is inlined into 4dce72bd, where 4dce72bd is an internal pointer that corresponds to this method (in this case, java/lang/String.equals(Ljava/lang/Object;)Z). The value @22 at the end of the pointer is a bytecode index, which describes the bytecode index of the call that is being inlined. The call is 81670d20 bcsz=37 java/lang/String.lengthInternal()I, which shows the corresponding internal pointer, bytecode size (bcsz) and the name of the method that got inlined. Going through the #INL output line by line then:

java/lang/String.lengthInternal()I got inlined into its caller 4dce72bd at bytecode index @22.\njava/lang/String.lengthInternal()I also got inlined into its caller 4dce72bd at bytecode index @28.\njava/lang/String.regionMatchesInternal(...) got inlined at call reference 4dce72bd at bytecode index @104.\n

Then 4 distinct calls to java/lang/String.charAtInternal(I[C)C were also inlined into java/lang/String.regionMatchesInternal(...) :

#3 at bytecode index @121 of regionMatchesInternal\n#4 at bytecode index @131 of regionMatchesInternal\n#5 at bytecode index @156 of regionMatchesInternal\n#6 at bytecode index @166 of regionMatchesInternal\n

These were all the calls that the inliner decided to inline into the method being compiled. There is some additional output that describes calls to methods that weren't inlined:

#INL: 4dce72bd called 4dce72bd@120 -> f734b49c bcsz=233 java/lang/String.deduplicateStrings(Ljava/lang/String;Ljava/lang/String;)V\n#INL: 4dce72bd coldCalled 4dce72bd@104 -> bf62dcaf bcsz=182 java/lang/String.regionMatchesInternal(Ljava/lang/String;Ljava/lang/String;[C[CIII)Z\n#INL: 4dce72bd coldCalled 4dce72bd@104 -> bf62dcaf bcsz=182 java/lang/String.regionMatchesInternal(Ljava/lang/String;Ljava/lang/String;[C[CIII)Z\n

While the output does not specifically say why these methods were not inlined, the relatively larger bytecode size (bcsz=233) probably prevented the first method from being inlined. It's possible that, at a higher optimization level than cold, this deduplicateStrings method may get inlined. The coldCalled label on the last two lines, however, indicate that these calls are located in a part of the method that has not ever been executed, so the JIT decided that inlining those last two methods will probably increase compile time without much promise that it will improve performance.

By reading the log in this way you can reconstruct the tree of inlines that are taking place as the compilation proceeds. You can see which methods are being inlined and which methods are not being inlined.

"},{"location":"jit/#see-also","title":"See also","text":""},{"location":"jitserver/","title":"JITServer technology","text":""},{"location":"jitserver/#jitserver-technology","title":"JITServer technology","text":"

Linux\u00ae on x86, Linux on IBM Power\u00ae systems, Linux on AArch64 and Linux on IBM Z\u00ae systems (64-bit only)

JITServer technology decouples the JIT compiler from the VM and lets the JIT compiler run remotely in its own process. This mechanism prevents your Java\u2122 application suffering possible negative effects due to CPU and memory consumption caused by JIT compilation.

This technology can improve quality of service, robustness, and performance of Java applications. You might want to try this technology if the following criteria are met:

For more details about JITServer technology, including its advantages and disadvantages and when best to use it, see blog posts such as the following:

For a more in-depth description of the JITServer design and implementation, see the following research paper:

"},{"location":"jitserver/#using-jitserver-technology","title":"Using JITServer technology","text":"

JITServer technology is not enabled by default: you must explicitly invoke it. Running OpenJ9 without either of the following options launches it as a regular VM with embedded JIT compilation.

"},{"location":"jitserver/#launch-eclipse-openj9-in-client-mode","title":"Launch Eclipse OpenJ9 in client mode","text":"

Use the following command-line option to launch Eclipse OpenJ9\u2122 in client mode. In this mode, the VM sends compilation requests to an available JITServer. The client operates as a regular VM with its own JIT compiler if a server is not available.

 -XX:+UseJITServer\n
"},{"location":"jitserver/#launch-openj9-in-server-mode","title":"Launch OpenJ9 in server mode","text":"

Use the following command to start a JITServer process that listens for incoming compilation requests:

jitserver\n
"},{"location":"jitserver/#configuring-jitserver-technology","title":"Configuring JITServer technology","text":"

You can use command line options to further configure the JITServer and the client VM processes. For example:

If a JITServer server crashes, the client is forced to perform compilations locally. You can change this behavior by using the -XX:[+|-]RequireJITServer option so that the client crashes with an assert when it detects that the server is unavailable. This feature is useful when you are running a test suite with JITServer enabled and you want the server crash to cause the test to fail.

"},{"location":"jitserver/#security","title":"Security","text":"

You can encrypt network communication between the client VM and JITServer by using OpenSSL 1.0.x, 1.1.x, or 3.x. To enable encryption, you specify the private key and the certificate at the server and use the certificate at the client. For more information, see -XX:JITServerSSLCert / -XX:JITServerSSLKey / -XX:JITServerSSLRootCerts.

"},{"location":"jitserver/#tuning-jitserver","title":"Tuning JITServer","text":"

For best practices regarding JITServer configuration and tuning, see the document JITServer tuning and practical considerations.

"},{"location":"jitserver/#building-a-jdk-with-jitserver-technology","title":"Building a JDK with JITServer technology","text":"

If you want to build a JDK with JITServer technology, see Appendix A of Free your JVM from the JIT with JITServer Technology.

"},{"location":"jitserver/#see-also","title":"See also","text":""},{"location":"jitserver_tuning/","title":"JITServer tuning","text":""},{"location":"jitserver_tuning/#jitserver-tuning-and-practical-considerations","title":"JITServer tuning and practical considerations","text":""},{"location":"jitserver_tuning/#server-caches","title":"Server caches","text":""},{"location":"jitserver_tuning/#client-session-caches","title":"Client-session caches","text":"

Multiple client JVMs can be connected at the same time to a single JIT server. For each client, the server maintains a client-session cache with information about the environment the client is running in (Java classes, class hierarchy, profiling information, JVM options, and so on). Typically, the information in these caches is kept separately per client. However, if you specify the -XX:+JITServerShareROMClasses option, the read-only part of the Java classes (ROMClasses in Eclipse OpenJ9\u2122 parlance) is shared between the different clients. This option can generate memory savings at the server when the connected clients run identical or similar Java applications.

The client-session caches are deleted when the clients terminate, but this can happen only if the clients are shutdown gracefully, giving them the opportunity to send a termination message to the server. To address the scenario of clients ending abruptly, the server also deletes the cache for a client that hasn\u2019t issued a compilation request for 1000 minutes, or 5 minutes under memory pressure. If needed, you can change these values with the following options:

-Xjit:oldAge=<time-in-ms>,oldAgeUnderLowMemory=<time-in-ms>\n
"},{"location":"jitserver_tuning/#jitserver-aot-cache","title":"JITServer AOT cache","text":"

The JITServer technology can cache AOT compiled methods at the server. The JITServer can, therefore, avoid carrying out an AOT compilation when a compatible AOT method body already exists in the cache, thereby saving CPU resource and improving remote compilation latency. This mechanism uses the dynamic AOT technology, but does not require a shared class cache at the client.

When the JITServer receives an AOT compilation request, it checks its AOT cache for a compatible compiled method body. If one is not found, the server performs the AOT compilation, sends the response to the client JVM, then serializes the compiled method and stores it in its local AOT cache, for future use. If a compatible compiled method is found, the server sends the client the serialized compiled method from its cache, thus avoiding a compilation. The client deserializes the response and loads the compiled method as a regular dynamic AOT code.

This JITServer AOT caching feature is by default enabled at the server but disabled for the JITServer clients. To enable this feature for the JITServer clients, specify the -XX:+JITServerUseAOTCache command-line option for each client.

A JITServer instance can have several AOT caches, each with its own name. These named AOT caches address the situation when client JVMs with significantly different profiles of execution use the same JITServer instance. A client JVM can indicate a specific AOT cache that it wants to use by providing its name with the following command-line option -XX:JITServerAOTCacheName=<cache_name>. If the client doesn't specify a name for the AOT cache, the server uses a cache named default.

The maximum amount of memory that all the AOT cache instances combined can use at the server is 300 MB, by default. You can change this value by using the -XX:JITServerAOTmx=<size> option. When the cache size reaches the specified limit, new clients cannot create new AOT cache instances or add new compiled methods to the existing AOT cache instances.

Typically, each JITServer server populates its own AOT caches independently of other existing servers. To help with JITServer auto-scaling, and in particular with scaling down to zero, JITServer instances can save their AOT caches to files by setting the -XX:+JITServerAOTCachePersistence command-line option. Other JITServer instances that are started later can load the existing AOT cache files into their memory, and then continue to gradually add new AOT compiled methods. Saving an AOT cache to a file is performed periodically based on the following conditions:

Current limitation:

"},{"location":"jitserver_tuning/#number-of-concurrent-clients","title":"Number of concurrent clients","text":"

The amount of CPU and memory resources consumed by the server is expected to increase with the number of connected clients. Finding the appropriate number of clients to connect to a server is a tricky proposition that depends on many factors, such as the number of methods that need to be compiled by the clients, optimization levels for these compilations, how clients are started (staggered or not), and how clients are shutdown (gracefully or not).

Generally, you should have 10-20 JVMs simultaneously connected to a server with 1-2 GB of memory. With respect to CPU resources, in Kubernetes you might want to set a low \"request\" value at the server (1-2 vCPUs) and a larger \"limit\" value (4-8 vCPUs) in order to soak all those idle cycles. It is possible to connect even more clients to one server instance if memory and CPU resources are increased, but in general, two medium-sized server instances that are placed on different nodes are better than a single, larger server.

"},{"location":"jitserver_tuning/#alleviating-cpu-congestion-at-the-server","title":"Alleviating CPU congestion at the server","text":"

When too many clients connect to the server, the server can become flooded with compilation requests, leading to increased compilation times and slower start-up/ramp-up for applications. A client JVM issues most of its compilation requests during the start-up phase and ramp-up phase of an application, when load is first applied to it. Thus, from the CPU consumption point of view what matters is the number of clients that start-up or ramp-up concurrently. To alleviate the CPU strain on the server, you can start the client JVMs in a staggered fashion, rather than all at the same time. Sometimes the staggering happens naturally; for instance, when using Kubernetes horizontal pod auto-scaling, additional application instances are started gradually as the load increases.

Another idea is to use the -Xjit:enableJITServerHeuristics command-line option at the clients. When this option is present, the client JVMs share some of the compilation burden by performing the cheap compilations locally and send only expensive compilations to the server. What constitutes a cheap compilation is determined by JIT heuristics that look at the method size, optimization level and the amount of CPU and memory available to the JVM.

"},{"location":"jitserver_tuning/#avoiding-memory-shortages-at-the-server","title":"Avoiding memory shortages at the server","text":"

Roughly speaking, the server uses two types of memory: 1. \"Scratch\" memory. This memory is allocated during a compilation (for JIT internal data structures) and released to the operating system at the end of the compilation. 2. \"Persistent\" memory. This memory is used for client-session caches and gets deleted only when a client terminates gracefully (or when the JITServer purging mechanism is triggered).

The total amount of scratch memory at any particular moment depends on how many compilations are in progress and how expensive those compilations are. To reduce this amount, you can start the clients in a staggered fashion as suggested previously, or reduce the number of compilation threads per client. Note that the latter already happens automatically: when the server senses that it is about to run out of memory, it provides feedback to the connected clients to reduce their number of active compilation threads.

To reduce the amount of persistent memory, you can use the techniques that are described in section Server caches.

"},{"location":"jitserver_tuning/#traffic-encryption","title":"Traffic encryption","text":"

Enabling network encryption can increase the CPU overhead, both at the client and at the server. For this reason, you should turn on encryption only if needed. Note that some technologies like Istio, Weave, Linkerd, Calico, Cilium already encrypt all network traffic, so using JITServer encryption might be redundant.

"},{"location":"jitserver_tuning/#minimizing-application-stalls","title":"Minimizing application stalls","text":"

Usually, the compilation threads in OpenJ9 JVM execute in parallel with Java application threads. However, for correctness reasons a small number of compilations are performed synchronously, meaning that Java application threads have to wait for the compilation result before being allowed to execute the method being compiled. Since remote compilations typically take longer to complete due to network latency, application stalls that are caused by synchronous compilations can be more severe in a JITServer setting. If this becomes a problem, you should add the following command line option at the client:

-XX:+JITServerLocalSyncCompiles\n

This option instructs the client JVM to perform the synchronous compilations locally, at a low optimization level (thus the compilation is relatively quick), and to follow-on with remote asynchronous recompilations at a higher optimization level to avoid any performance loss.

"},{"location":"jitserver_tuning/#session-affinity","title":"Session affinity","text":"

For technical reasons, a client JVM must use a single JITServer at a time. In a Kubernetes environment, where a JITServer service can be backed up by several server instances, you can satisfy this requirement by using session affinity. Note that if a server crashes (or gets terminated by the Kubernetes controller) the clients can connect to another server instance. This scenario imposes some performance penalty because the client-session caches that the server maintains need to be built anew. Following is an example of a Kubernetes service definition that uses sessionAffinity:

apiVersion: v1\nkind: Service\nmetadata:\n  name: jitserver\nspec:\n  type: ClusterIP\nselector:\n    app: jitserver\n  ports:\n    - protocol: TCP\n      port: 38400\n      targetPort: 38400\n  sessionAffinity: ClientIP\n  sessionAffinityConfig:\n    clientIP:\n      timeoutSeconds: 86400\n
"},{"location":"jitserver_tuning/#resilience","title":"Resilience","text":"

If the client JVM does not find a compatible server to connect to, compilations are performed locally, by the client itself. To account for the case where the server is temporarily unavailable (for example, server crash followed by Kubernetes launching another server instance), from time to time the client retries to connect to a server at the indicated address and port. The retry mechanism uses an exponential back-off where the retry interval is doubled with each unsuccessful attempt.

"},{"location":"jitserver_tuning/#monitoring","title":"Monitoring","text":""},{"location":"jitserver_tuning/#performance-metrics","title":"Performance metrics","text":"

You can enable the provision of performance metrics by specifying the -XX:+JITServerMetrics command-line option. After enabling this option, you can use a monitoring tool that follows the OpenMetrics standard, such as Prometheus, to collect the data by issuing an HTTP GET request to the following url: http://<jitserveraddress>:<port>/metrics.

Note: There is a limit of four concurrent GET requests at any given time.

You can use the -XX:JITServerMetricsSSLKey and -XX:JITServerMetricsSSLCert options to encrypt the data with TLS or SSL.

For more information, including the types of metrics that are provided, see the -XX:[+|-]JITServerMetrics topic.

"},{"location":"jitserver_tuning/#verbose-logging","title":"Verbose logging","text":"

You can inspect the behavior of a JITServer instance by using the OpenJ9 verbose logging facility. Note that if the name of the verbose log is not specified, the relevant information is printed to stderr. When you use the -XX:+JITServerLogConnections command-line option, the server prints a message to the verbose log every time a new client JVM connects to it or disconnects from it. This is an easy way to determine that the clients are able to reach the server. Example of output:

#JITServer: t= 74232 A new client (clientUID=14692403771747196083) connected. Server allocated a new client session.\n#JITServer: t= 74282 A new client (clientUID=2599593246759846167) connected. Server allocated a new client session.\n#JITServer: t= 86281 Client (clientUID=14692403771747196083) disconnected. Client session deleted\n

The server has a heart-beat thread that periodically prints to the verbose log information related to the number of clients connected, the number of active compilation threads, the amount of CPU used, the amount of available memory and the number of times the internal server caches have been cleared. This last bit of information is important for diagnosing performance problems. The heart-beat information is enabled with the following option:

-Xjit:statisticsFrequency=<period-in-ms>\n

Example of output:

#JITServer: CurrentTime: Aug 06 17:25:15 2021\n#JITServer: Compilation Queue Size: 0\n#JITServer: Number of clients : 2\n#JITServer: Total compilation threads : 63\n#JITServer: Active compilation threads : 2\n#JITServer: Physical memory available: 14299 MB\n#JITServer: CpuLoad 206% (AvgUsage 25%) JvmCpu 113%\n...\n

A value greater than 0 for the Compilation Queue Size is a sign that the server is overloaded. Compilation requests that wait in the compilation queue face greater delays and run the risk of exceeding network timeouts. To avoid this scenario, you can reduce the number of connected clients, use the techniques that are described in section Alleviating CPU congestion at the server, or increase the number of compilation threads at the server by using the -XcompilationThreads option.

Increasing the maximum number of client threads can improve performance in high network latency settings because there can be more in-progress concurrent compilation requests. Increasing the number of threads at the server can improve performance if the server has many CPU cores available and serves a large number of clients concurrently.

More detailed diagnostics can be obtained with the option -Xjit:verbose={JITServer},verbose={compilePerformance}, which is typically used for debugging server behavior.

"},{"location":"legal/","title":"Legal","text":""},{"location":"legal/#legal","title":"Legal","text":"

License agreement, notices, copyright, and trademark information for the user documentation.

"},{"location":"legal/#license-agreement","title":"License agreement","text":"

See License

"},{"location":"legal/#notices","title":"Notices","text":"

See Notices

"},{"location":"legal/#copyright-information","title":"Copyright information","text":"

Eclipse OpenJ9\u2122 documentation is subject to the following copyright:

Copyright (c) 2017, 2024 IBM Corp.\n
"},{"location":"legal/#trademarks","title":"Trademarks","text":"

IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at \"Copyright and trademark information\" here.

Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates.

Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.

Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both.

"},{"location":"messages_intro/","title":"OpenJ9 messages","text":""},{"location":"messages_intro/#eclipse-openj9-vm-messages","title":"Eclipse OpenJ9 VM messages","text":"

Messages are issued by the Eclipse OpenJ9\u2122 virtual machine (VM) in response to certain conditions. Understanding what the messages mean can help you with problem determination.

"},{"location":"messages_intro/#message-categories","title":"Message categories","text":"

There are three main categories of message:

Information Information messages provide information about VM processing. For example, a dump information message is typically issued when a dump agent requests a dump. Warning Warning messages are issued by the VM to indicate conditions that might need user intervention. Error Error messages are issued by the VM when normal processing cannot proceed, because of unexpected conditions.

OpenJ9 virtual machine messages have the following format:

    JVM<type><number><code>\n

where:

These messages can help you with problem determination.

By default, all error and some information messages are routed to the system log and also written to stderr or stdout. The specific information messages are JVMDUMP039I, JVMDUMP032I, and JVMDUMP033I, which provide valuable additional information about dumps produced by the VM. To route additional message types to the system log, or turn off message logging to the system log, use the -Xsyslog option. The -Xsyslog option does not affect messages written to the standard error stream (stderr). See OpenJ9 command-line options.

Note: The -Xsyslog option replaces the -Xlog option in OpenJ9 version 0.24.0.

"},{"location":"messages_intro/#finding-logged-messages","title":"Finding logged messages","text":"

Logged messages can be found in different locations, according to platform.

"},{"location":"messages_intro/#finding-aix-messages","title":"Finding AIX messages","text":"

On AIX\u00ae, messages are logged by the syslog daemon (/usr/sbin/syslogd). Logged messages are written to the syslog file that is configured in /etc/syslog.conf. If the syslog daemon is not running, logged messages are lost.

You can redirect messages from the syslog daemon to the AIX error log facility by performing the following configuration steps:

  1. Set up a redirect in the file syslog.conf so that syslog messages are sent to the error log, by adding the following line:
        user.debug errlog\n
  1. If syslogd is already running, reload the updated configuration by running the following command:
        refresh -s syslogd\n
  1. The updated configuration is used each time syslogd starts. 4. Use the AIX errpt command or the System Management Interface Tool (SMIT) to read the messages sent to the error log.

For more information about AIX logging, see: Error-logging overview.

"},{"location":"messages_intro/#finding-linux-messages","title":"Finding Linux messages","text":"

On Linux\u00ae, messages are logged by the syslog daemon. To find where messages are logged, check the syslog configuration file.

"},{"location":"messages_intro/#finding-macos-messages","title":"Finding macOS messages","text":"

On macOS\u00ae, messages are logged by the syslog daemon. However, on Sierra and High Sierra, syslog does not work. If /var/log/system.log is not available, Console.app can be used instead.

"},{"location":"messages_intro/#finding-windows-messages","title":"Finding Windows messages","text":"

On Windows\u2122, messages are logged in the application events section of the event viewer.

"},{"location":"messages_intro/#finding-zos-messages","title":"Finding z/OS messages","text":"

On z/OS\u00ae, messages are sent to the operator console. To see the messages, go from the ispf panel to the sdsf panel, then open the log panel.

"},{"location":"messages_intro/#obtaining-detailed-message-descriptions","title":"Obtaining detailed message descriptions","text":"

Detailed message information is available to help with problem diagnosis.

Understanding the warning or error message issued by the VM can help you diagnose problems. All warning and error messages issued by the VM are listed by type in the messages guide: IBM\u00ae VM messages.

The messages, error codes, and exit codes in this guide apply to multiple versions of the VM.

Note: If the VM fills all available memory, the message number might be produced without a description for the error that caused the problem. Look for the message number in the relevant section of the J9 VM Messages guide to see the message description and the additional information provided.

"},{"location":"migrating11to17/","title":"Migrating from Java 11 to Java 17","text":""},{"location":"migrating11to17/#migrating-from-java-11-to-java-17","title":"Migrating from Java 11 to Java 17","text":"

Support for OpenJDK 17 was added in Eclipse OpenJ9\u2122 version 0.29.1.

The following new OpenJ9 changes apply when OpenJ9 is built with Java SE 17 class libraries. This information exists elsewhere in the documentation but is summarized here for convenience.

"},{"location":"migrating11to17/#support-for-jdk-enhancement-proposals-jep","title":"Support for JDK enhancement proposals (JEP)","text":"

The new JEPs that are supported are listed in the following topics:

"},{"location":"migrating11to17/#new-openj9-features-and-changes","title":"New OpenJ9 features and changes","text":"

The following table lists the new OpenJ9 features and notable changes with the OpenJ9 release in which they were added:

Features and changes OpenJ9 release Linux builds for all platforms use gcc 10.3 instead of gcc 7.5. See the list of build environments. 0.33.0 The default operating system stack size on x64 platforms is increased from 256 KB to 512 KB to accommodate vector support. You can change the operating system stack size by using the -Xmso option. 0.33.0"},{"location":"migrating17to21/","title":"Migrating from Java 17 to Java 21","text":""},{"location":"migrating17to21/#migrating-from-java-17-to-java-21","title":"Migrating from Java 17 to Java 21","text":"

Support for OpenJDK 21 was added in Eclipse OpenJ9\u2122 version 0.42.0.

The following new OpenJ9 changes apply when OpenJ9 is built with Java\u00ae SE 21 class libraries. This information exists elsewhere in the documentation but is summarized here for convenience.

"},{"location":"migrating17to21/#support-for-jdk-enhancement-proposals-jep","title":"Support for JDK enhancement proposals (JEP)","text":"

The new JEPs that are supported are listed in the following topics:

"},{"location":"migrating17to21/#new-openj9-features-and-changes","title":"New OpenJ9 features and changes","text":"

The following table lists the new OpenJ9 features and notable changes with the OpenJ9 release in which they were added:

Features and changes OpenJ9 release The OpenJ9 jextract tool is removed. 0.41.0 New -XX:[+\\|-]ShowCarrierFrames option added. You can use the -XX:+ShowCarrierFrames option to add the stack trace of the carrier thread in addition to the virtual thread stack trace to the Throwable.getStackTrace() method, if an exception occurs. 0.41.0 New -XX:ContinuationCache option added. You can optimize the virtual thread performance by tuning the continuation tier 1 and 2 cache size with the -XX:ContinuationCache option 0.41.0 Warnings are issued when the agents are loaded dynamically into a running VM after startup without specifying the -XX:+EnableDynamicAgentLoading option and the same agents were not loaded before. 0.41.0 Linux\u00ae builds for all platforms, except for the AArch64 64-bit, use gcc 11.2 instead of gcc 10.3. Linux AArch64 64-bit continues to use gcc 10.3. The Windows Visual Studio compiler is also changed from Microsoft Visual Studio 2019 to Microsoft Visual Studio 2022. See the list of build environments. 0.42.0"},{"location":"migrating8to11/","title":"Migrating from Java 8 to Java 11","text":""},{"location":"migrating8to11/#migrating-from-java-8-to-java-11","title":"Migrating from Java 8 to Java 11","text":"

Support for OpenJDK 11 was added in Eclipse OpenJ9\u2122 version 0.10.0.

The following new OpenJ9 features and notable changes apply when OpenJ9 is built with Java SE 11 class libraries. This information exists elsewhere in the documentation but is summarized here for convenience.

"},{"location":"migrating8to11/#support-for-jdk-enhancement-proposals-jep","title":"Support for JDK enhancement proposals (JEP)","text":"

The new JEPs that are supported are listed in the following topics:

"},{"location":"migrating8to11/#new-openj9-features-and-changes","title":"New OpenJ9 features and changes","text":"

The following table lists the new OpenJ9 features and notable changes with the OpenJ9 release in which they were added:

Features and changes OpenJ9 release The path that is specified by the default -Xoptionsfile value is the <java_home>/lib directory, where <java_home> is the directory for your runtime environment. For Java 8, the path is the VM directory that is listed in Directory conventions. First release Low-overhead heap profiling is supported. JEP 331 provides a mechanism for sampling Java heap allocations with a low overhead via the JVM Tool Interface (JVMTI). Restrictions: JEP 331 is implemented for OpenJ9 with the following limitations: 0.15.0 OpenSSL support for the ChaCha20 and ChaCha20-Poly1305 algorithms is available. The version of OpenSSL must be version 1.1.x or later. For more information, see -Djdk.nativeChaCha20. 0.15.0 The -verbose:module option, which writes information to stderr for each module that is loaded and unloaded, is now supported. 0.25.0 The default value of the -XX:MaxDirectMemorySize option, which limits the amount of heap memory that is used for direct byte buffers, is the same as the maximum heap size. For JDK 8, the VM default value is 87.5% of the maximum heap size. 0.32.0 OpenSSL support is added for the following algorithms:The version of OpenSSL must be version 1.1.1 or later for the -Djdk.nativeXDHKeyAgreement and -Djdk.nativeXDHKeyGen algorithms. 0.40.0"},{"location":"openj9_defaults/","title":"Default settings","text":""},{"location":"openj9_defaults/#default-settings-for-the-eclipse-openj9-vm","title":"Default settings for the Eclipse OpenJ9\u2122 VM","text":"

The following tables provide a quick reference to the default settings for the VM when it is first installed.

The last 2 columns show whether the default setting can be changed by a command-line parameter or an environment variable. Note that if both are set, the command-line parameter always takes precedence.

VM setting Default Command line Env. variable Javadump Enabled yes yes Heapdump Disabled yes yes System dump Enabled yes yes Snap traces Enabled yes yes JIT dump Enabled yes yes Verbose output Disabled yes no Compressed references (See Note 1) yes yes Boot classpath search Disabled yes no JNI checks Disabled yes no Remote debugging Disabled yes no Strict conformance checks Disabled yes no Quickstart Disabled yes no Remote debug info server Disabled yes no Reduced signaling Disabled yes no Signal handler chaining Enabled yes no Classpath Not set yes yes Class data sharing Disabled yes no Accessibility support Enabled no yes JIT compiler Enabled yes yes AOT compiler (See Note 2) Enabled yes no JIT debug options Disabled yes no Java2D max size of fonts with algorithmic bold 14 point no yes Java2D use rendered bitmaps in scalable fonts Enabled no yes Java2D freetype font rasterizing Enabled no yes Java2D use AWT fonts Disabled no yes

Notes:

  1. On AIX\u00ae, Linux\u00ae, macOS\u00ae x86, and Windows\u2122: Enabled for -Xmx values \u2264 57 GB, otherwise disabled.

    On z/OS\u00ae: Enabled for -Xmx values \u2264 25 GB, otherwise disabled. With APAR OA49416, enabled for -Xmx values \u2264 57 GB.

    On macOS AArch64 (Apple silicon): Disabled.

  2. AOT is not used by the VM unless shared classes are also enabled.

VM setting AIX Linux macOS Windows z/OS Command line Env. variable Default locale None None None N/A None no yes Time to wait before starting plug-in N/A Zero N/A N/A N/A no yes Temporary directory /tmp /tmp /tmp c:\\temp /tmp no yes Plug-in redirection None None None N/A None no yes IM switching Disabled Disabled Disabled N/A Disabled no yes IM modifiers Disabled Disabled Disabled N/A Disabled no yes Thread model N/A N/A N/A N/A Native no yes Initial stack size for Java Threads (32/64-bit). Use -Xiss<size> 2 KB 2 KB 2 KB 2 KB 2 KB yes no Maximum stack size for Java Threads (32-bit). Use -Xss<size> 320 KB 320 KB N/A 320 KB 320 KB yes no Maximum stack size for Java Threads (64-bit). Use -Xss<size> 1024 KB 1024 KB 1024 KB 1024 KB 1024 KB yes no Stack size for OS Threads (32-bit). Use -Xmso<size> 256 KB 256 KB N/A 32 KB 256 KB yes no Stack size for OS Threads (64-bit). Use -Xmso<size> 512 KB 512 KB (256 KB on IBM Z\u00ae) Earlier Java versions: 256 KB (512 KB on PPC) Architecture: x86: 512 KB, AArch64 (Apple silicon): 256 KB Earlier Java versions: 256 KB 512 KB Earlier Java versions: 256 KB 1 MB yes no Initial heap size. Use -Xms<size> 8 MB 8 MB 8 MB 8 MB 8 MB yes no Maximum Java heap size. Use -Xmx<size> See Notes See Notes See Notes See Notes See Notes yes no Page size for the Java object heap and code cache (For restrictions, see the -Xlp:codecache and -Xlp:objectheap options). Operating system default Architecture: x86: 2 MB, IBM Z: 1 MB, Other architectures: Operating system default Architecture: x86: 4 KB, AArch64 (Apple silicon): 16 KB Operating system default 1M pageable yes no

Notes:

The default value of -Xmx :

Available memory is defined as being the smallest of two values: The real or physical memory or the RLIMIT_AS value.

"},{"location":"openj9_directories/","title":"Directory conventions","text":""},{"location":"openj9_directories/#directory-conventions","title":"Directory conventions","text":"

The following tables provide a quick reference to the Eclipse OpenJ9\u2122 VM directory location on different Java\u2122 versions and different platform architectures. Some pages refer to the VM directory location as <vm_dir>.

Operating system Java 8 Java 11 and later AIX\u00ae <install_dir>/jre/lib/ppc[64]/default <install_dir>/ Linux\u00ae <install_dir>/jre/lib/<arch>/default <install_dir>/ macOS\u00ae <install_dir>/jre/lib/default <install_dir>/ Windows\u2122 <install_dir>\\jre\\bin\\default <install_dir>\\ z/OS\u00ae <install_dir>/jre/lib/s390[x]/default <install_dir>/

Where:

Architecture Value of <arch> x86 32-bit i386 x86 64-bit x86-64 IBM POWER\u00ae 32-bit (Big Endian) ppc IBM POWER 64-bit (Big Endian) ppc64 IBM POWER 64-bit (Little Endian) ppc64le IBM Z\u00ae 31-bit s390 IBM Z 64-bit s390x"},{"location":"openj9_newuser/","title":"New to OpenJ9?","text":""},{"location":"openj9_newuser/#new-to-eclipse-openj9","title":"New to Eclipse OpenJ9?","text":"

The Eclipse OpenJ9\u2122 virtual machine (VM) implements the Java Virtual Machine Specification. Most Java applications should run on an OpenJDK that contains the OpenJ9 VM without changing anything. However, because it is an independent implementation there are some differences compared to the HotSpot VM, which is the default OpenJDK VM and is also included in an Oracle JDK.

"},{"location":"openj9_newuser/#command-line-options","title":"Command-line options","text":"

Although OpenJ9 implements its own command-line interface, many HotSpot options are recognized and accepted by the VM for compatibility. Any -XX: options that are not recognized by the VM are ignored by default, which prevents an application failing to start. You can turn off this behavior with the -XX:-IgnoreUnrecognizedXXColonOptions option.

For a list of compatible options, equivalent options, and options that need to be set for compatibility, see Switching to OpenJ9.

"},{"location":"openj9_newuser/#garbage-collection-policies","title":"Garbage collection policies","text":"

Eclipse OpenJ9 has a number of garbage collection (GC) policies designed around different types of applications and workloads. By default, OpenJ9 uses the Generational Concurrent (gencon) GC policy, which is best suited for transactional applications that have many short-lived objects. The policy aims to minimize GC pause times without compromising throughput. If you are using Java 8, the gencon policy is similar to the HotSpot CMS (concurrent mark sweep). If you are using Java 11, the OpenJ9 balanced (balanced) policy is most similar to the default HotSpot policy.

If you have a different type of workload, you might want to select a different GC policy. For details about the available policies and when to choose them, see Garbage collection.

"},{"location":"openj9_newuser/#operational-tooling","title":"Operational tooling","text":"

If you are a Java application developer or you are responsible for managing large server or desktop deployments of a Java runtime environment, you probably use a number of tools for monitoring, management, and troubleshooting. Because OpenJ9 is an independent implementation, it has evolved with its own approach for these areas and, in some cases, its own unique tools.

In other cases, tools have been added for compatibility with the reference implementation, but these tools might differ in behavior from equivalent tools in HotSpot. For a list of these tools, see Switching to OpenJ9 in the Tools section.

"},{"location":"openj9_newuser/#dumps-logs-and-trace-files","title":"Dumps, logs, and trace files","text":"

OpenJ9 contains extensive trace and debugging capabilities to help identify, isolate, and solve run time problems.

If you are familiar with using HotSpot as part of an Oracle JDK or OpenJDK, you probably make use of the monitoring and diagnostic tools that are provided with the VM. OpenJ9 has implemented a different approach to providing similar data; rather than running a number of different tools to obtain a different piece of information, the Java dump file provides a comprehensive set of information in one place. You can find the following information in an OpenJ9 Java dump:

For more information, see Java dump.

"},{"location":"openj9_newuser/#tools","title":"Tools","text":"

OpenJ9 provides support for a number of monitoring and diagnostic tools that can be found in the Eclipse marketplace. Each tool provides a graphical user interface to help you visualize data and, in some cases, can provide tuning or debugging recommendations.

If you are familiar with using HotSpot as part of an Oracle JDK or OpenJDK, the Java VisualVM utility is functionally similar to Health Center. Most of the other tools provided with HotSpot are not officially supported, but equivalent functionality is available in OpenJ9 through command-line options, dump agents, and AttachAPI.

"},{"location":"openj9_newuser/#interfaces","title":"Interfaces","text":"

OpenJ9 provides the following interfaces, which can be used for monitoring and diagnostic purposes:

If you are familiar with using HotSpot as part of an Oracle JDK or OpenJDK, you might make use of certain com.sun.management interfaces. Although OpenJ9 implements some of these interfaces, a few are specific to the HotSpot VM. The following table indicates alternative classes or mechanisms that you can use for equivalent function in OpenJ9:

HotSpot-specific classes Alternatives for OpenJ9 HotSpotDiagnosticMXBean OpenJ9DiagnosticsMXBean (for heap dumps) MissionControl Use Health Center MissionControlMXBean Use Health Center ThreadMXBean JvmCpuMonitorMXBean (for thread time) VMOption OpenJ9 Java dump (option -Xdump:java) DiagnosticCommandMBean None

Note: OpenJ9 implements the following com.sun.management interfaces: GarbageCollectorMXBean, GarbageCollectionNotificationInfo, GcInfo, OperatingSystemMXBean, UnixOperatingSystemMXBean.

For information about OpenJ9 application programming interfaces, see API documentation.

"},{"location":"openj9_newuser/#other-differences","title":"Other differences","text":"

This topic describes the differences between the HotSpot VM and the Eclipse OpenJ9 VM. Therefore, if you are currently using an OpenJDK with the default HotSpot VM and you want to switch to using an OpenJDK with the OpenJ9 VM, these are the only differences you might be concerned about. If however, you are using an Oracle JDK, you might want to learn about differences between other components that make up an Oracle JDK or an OpenJDK from the AdoptOpenJDK community. For more information, read the Migration guide.

"},{"location":"openj9_releases/","title":"Overview","text":""},{"location":"openj9_releases/#overview","title":"Overview","text":"

New releases of Eclipse OpenJ9\u2122 are set to coincide with critical patch updates and new versions of the Java\u2122 SE class libraries. To learn more about when these releases take place, and the OpenJ9 support lifecycle, see Supported environments.

If you are interested in the content of future releases, plans are published in the Eclipse OpenJ9 project page.

High level information about the features and changes in final releases of OpenJ9 can be found in the topics that follow.

"},{"location":"openj9_signals/","title":"Signal handling","text":""},{"location":"openj9_signals/#signal-handling","title":"Signal handling","text":"

Signals used by the Eclipse OpenJ9\u2122 VM include the following types:

For exceptions and errors, if the VM cannot handle the condition and recover, dumps are produced and a controlled shut down sequence takes place. Interrupts also cause the VM to enter a controlled shut down sequence, but without generating dumps. The shutdown sequence is equivalent to calling System.exit(), which results in the following steps:

  1. The VM calls the equivalent application signal handler.
  2. The VM calls any hooks installed by the application (unexpected shutdown hooks for exceptions or errors, shutdown or exit hooks for interrupts).
  3. The VM does any final clean up.

Control signals are used for internal control purposes and do not cause the VM to end.

The VM takes control of any signals for Java\u2122 threads. For non-Java threads, the VM passes control to an application handler, if one is installed. If the application does not install a signal handler, or signal chaining is turned off, the signal is either ignored or the default action is taken. Signal chaining is controlled by the -Xsigchain / -Xnosigchain command-line option.

The signals relevant to each platform are detailed in the sections that follow.

When reading each table, a number supplied after the signal name is the standard numerical value for that signal.

Note that certain signals on VM threads cause OpenJ9 to shutdown. An application signal handler should not attempt to recover from these signals unless it no longer requires the VM.

"},{"location":"openj9_signals/#signals-on-linux","title":"Signals on Linux","text":"Signal Type Description Option to disable signal SIGBUS (7) Exc Incorrect memory access (data misalignment) -Xrs or -Xrs:sync SIGSEGV (11) Exc Incorrect memory access (write to inaccessible area) -Xrs or -Xrs:sync SIGILL (4) Exc Illegal instruction (attempt to call unknown machine instruction) -Xrs or -Xrs:sync SIGFPE (8) Exc Floating point exception (divide by zero) -Xrs or -Xrs:sync SIGABRT (6) Err Abnormal termination, raised by the VM when a VM fault is detected -Xrs or -Xrs:sync SIGINT (2) Int Interactive attention (CTRL-C), VM exits normally -Xrs SIGTERM (15) Int Termination request, VM exits normally -Xrs SIGHUP (1) Int Hang up, VM exits normally -Xrs SIGUSR2 (12) Int User-defined signal for triggering a dump agent -Xrs SIGQUIT (3) Con Quit signal from a terminal, which triggers a Java dump by default -Xrs SIGTRAP (5) Con Used by the JIT -Xrs or -Xrs:sync SIGRTMIN (34) Con Used by the VM for thread introspection - SIGRTMIN +1 (35) Con Used by the VM for Runtime Instrumentation (Linux for IBM Z\u00ae systems only) - SIGRTMAX -2 (62) Con Used by the java.net class library code - SIGCHLD (17) Con Used by the java.lang.Process implementation -

Notes:

"},{"location":"openj9_signals/#signals-on-macos","title":"Signals on macOS","text":"Signal Type Description Option to disable signal SIGBUS (10) Exc Incorrect memory access (data misalignment) -Xrs or -Xrs:sync SIGSEGV (11) Exc Incorrect memory access (write to inaccessible area) -Xrs or -Xrs:sync SIGILL (4) Exc Illegal instruction (attempt to call unknown machine instruction)) -Xrs or -Xrs:sync SIGFPE (8) Exc Floating point exception (divide by zero) -Xrs or -Xrs:sync SIGABRT (6) Err Abnormal termination, raised by the VM when a VM fault is detected -Xrs or -Xrs:sync SIGINT (2) Int Interactive attention (CTRL-C), VM exits normally -Xrs SIGTERM (15) Int Termination request, VM exits normally -Xrs SIGHUP (1) Int Hang up, VM exits normally -Xrs SIGUSR2 (31) Int User-defined signal for triggering a dump agent -Xrs SIGQUIT (3) Con Quit signal from a terminal, which triggers a Java dump by default -Xrs SIGTRAP (5) Con Used by the JIT -Xrs or -Xrs:sync SIGCHLD (20) Con Used by the java.lang.Process implementation - SIGUSR1 (30) Con Used by the VM for thread introspection - SIGIO (23) Con Used by the java.net class library code -

Note:

"},{"location":"openj9_signals/#signals-on-windows","title":"Signals on Windows","text":"Signal Type Description Option to disable signal SIGINT (2) Int Interactive attention (CTRL-C), VM exits normally -Xrs SIGTERM (15) Int Termination request, VM exits normally -Xrs SIGBREAK Con A break signal from a terminal. By default, this triggers a Java dump -Xrs

Notes:

The following mechanisms are used by OpenJ9 for signal handling:

All mechanisms can be disabled by using the -Xrs option. However, only structured exception handling and the use of the AddVectoredExceptionHandler() API can be disabled by using the -Xrs:sync option. The option -Xnosigchain, which turns off signal handler chaining, is ignored on Windows systems.

"},{"location":"openj9_signals/#signals-on-zos","title":"Signals on z/OS","text":"Signal Type Description Option to disable signal SIGBUS (10) Exc Incorrect memory access (data misalignment) -Xrs or -Xrs:sync SIGSEGV (11) Exc Incorrect memory access (write to inaccessible area) -Xrs or -Xrs:sync SIGILL (4) Exc Illegal instruction (attempt to call unknown machine instruction)) -Xrs or -Xrs:sync SIGFPE (8) Exc Floating point exception (divide by zero) -Xrs or -Xrs:sync SIGABRT (3) Err Abnormal termination, raised by the VM when a VM fault is detected -Xrs or -Xrs:sync SIGINT (2) Int Interactive attention (CTRL-C), VM exits normally -Xrs SIGTERM (15) Int Termination request, VM exits normally -Xrs SIGHUP (1) Int Hang up, VM exits normally -Xrs SIGUSR2 (17) Int User-defined signal for triggering a dump agent -Xrs SIGQUIT (24) Con Quit signal from a terminal, triggers a Java dump by default -Xrs SIGTRAP (26) Con Used by the JIT -Xrs or -Xrs:sync SIGCHLD (20) Con Used by the java.lang.Process implementation - SIGUSR1 (16) Con Used by the java.net class library code -

Note:

"},{"location":"openj9_signals/#signals-on-aix","title":"Signals on AIX","text":"Signal Type Description Option to disable signal SIGBUS (10) Exc Incorrect memory access (data misalignment) -Xrs or -Xrs:sync SIGSEGV (11) Exc Incorrect memory access (write to inaccessible area) -Xrs or -Xrs:sync SIGILL (4) Exc Illegal instruction (attempt to call unknown machine instruction)) -Xrs or -Xrs:sync SIGFPE (8) Exc Floating point exception (divide by zero) -Xrs or -Xrs:sync SIGABRT (6) Err Abnormal termination, raised by the VM when a VM fault is detected -Xrs or -Xrs:sync SIGINT (2) Int Interactive attention (CTRL-C), VM exits normally -Xrs SIGTERM (15) Int Termination request, VM exits normally -Xrs SIGHUP (1) Int Hang up, VM exits normally -Xrs SIGUSR2 (31) Int User-defined signal for triggering a dump agent -Xrs SIGQUIT (3) Con Triggers a Java dump by default -Xrs No Name (40) Con Used by the VM for control purposes -Xrs SIGRECONFIG (58) Con Reserved to detect changes to resources (CPUs, processing capacity, or physical memory) -Xrs SIGTRAP (5) Con Used by the JIT -Xrs or -Xrs:sync SIGRTMIN (50) Con Used by the VM for thread introspection - SIGRTMAX -1 (56) Con Used by the java.net class library code - SIGCHLD (20) Con Used by the java.lang.Process implementation -

Notes:

"},{"location":"openj9_signals/#signal-chaining","title":"Signal chaining","text":"

Signal chaining allows application code to interoperate with VM signal handling. By linking and loading a shared library, certain calls can be intercepted so that the application handlers do not replace the VM signal handlers already installed by the VM. Instead, the application handlers are chained behind the VM handlers. If signals that are raised do not target the VM, the application handlers take over. Signals that can be chained include signal(), sigset(), and sigaction().

The following table shows the shared library that must be linked with the application that creates or embeds a VM, and the command line syntax to use with the compiler, where available:

Operating system Shared library Method for linking Linux\u00ae, macOS\u00ae, and z/OS\u00ae libjsig.so gcc -L$JAVA_HOME/bin -ljsig -L$JAVA_HOME/lib/j9vm -ljvm <java_application>.c Windows jsig.dll Link the DLL with the application that creates or embeds a VM AIX libjsig.so cc_r [-q64] <other_compile/link_parameter> -L<java_install_dir> -ljsig -L<java_install_dir>/lib/j9vm -ljvm <java_application>.c

In the absence of signal chaining, the VM does not allow application signal handlers for certain signals that are used internally by the VM, including the SIGUSR2 signal. You can use the -XX:-HandleSIGUSR2 option instead, whereby the VM signal handler is not installed on VM startup. Therefore, the application signal handler, if available, takes over the handling of the SIGUSR2 signal. If there is no application signal handler, then the operating system's default signal handler is used.

For more information about this option that affects the handling of the SIGUSR2 signal, see -XX:[+|-]HandleSIGUSR2.

Note: On Linux, macOS, and z/OS systems, you can use the LD_PRELOAD environment variable as an alternative method to the command line for linking the shared library as shown in the following list:

"},{"location":"openj9_signals/#see-also","title":"See also","text":""},{"location":"openj9_support/","title":"Supported environments","text":""},{"location":"openj9_support/#supported-environments","title":"Supported environments","text":"

The Eclipse OpenJ9\u2122 project source code can be built against multiple JDK levels starting with JDK8, so the question of support has a more complicated answer than at OpenJDK. Our community is committed to supporting JDK levels as long as they are supported at the OpenJDK open source project with a significant user base. Currently, Eclipse OpenJ9 produces a new release every quarter that can build against all JDK levels that are currently supported by the OpenJDK community. We are committed to accepting problem reports when using Eclipse OpenJ9 against a supported OpenJDK level, with fixes being delivered in each release of Eclipse OpenJ9.

In order to track the OpenJDK 6-month release cadence, OpenJ9 also produces two releases a year that support only a single JDK level. These releases will occur in March and September with the intention of supporting only the corresponding new OpenJDK feature release.

The following table summarizes which JDK levels are expected to be supported by which Eclipse OpenJ9 releases, along with projected release dates. All future dates and support expectations are predictions that might change depending on how the OpenJDK and OpenJ9 projects evolve over time. To keep this table concise, some rows and columns will be removed over time.

"},{"location":"openj9_support/#eclipse-openj9-releases","title":"Eclipse OpenJ9 releases","text":"OpenJ9 release Release date JDK8 (LTS) JDK11 (LTS) JDK17 (LTS) JDK21 (LTS) JDK22 JDK23 0.42.0 Jan 2024 (3) no no no yes 0.43.0 Feb 2024 yes yes yes yes 0.44.0 May 2024 yes yes yes yes 0.45.0 Jun 2024 no no no no yes 0.46.0 Aug 2024 yes yes yes yes yes 0.47.0 Sep 2024 (1, 2) no no no no no yes

Notes:

  1. These future OpenJ9 releases are expected, in line with our support statement.
  2. These OpenJ9 releases are feature releases that support a new OpenJDK release only.
  3. These OpenJ9 releases support a new LTS OpenJDK release only.

For any issues or limitations of an Eclipse OpenJ9 release, read the release notes.

"},{"location":"openj9_support/#platform-support","title":"Platform support","text":"

The Eclipse OpenJ9 project is open to supporting any hardware or operating system platforms provided that we have community members available to maintain them. For practical reasons the Eclipse OpenJ9 JVM does not currently run on every platform.

"},{"location":"openj9_support/#openjdk-8","title":"OpenJDK 8","text":"

OpenJDK 8 binaries are expected to function on the minimum operating system levels shown in the following tables:

Linux\u00ae AArch64 x32 x64 ppc64le Z31 Z64 RHEL 8.8 yes no yes yes no yes RHEL 9.2 no no yes yes no yes SUSE Linux Enterprise Server (SLES) 12 SP5 no yes yes yes yes yes Ubuntu 20.04 yes no yes yes no yes Ubuntu 22.04 no no yes yes no yes

Notes:

Windows\u2122 x32 x64 Windows 10 yes yes Windows 11 yes yes Windows Server 2016 yes yes Windows Server 2019 yes yes Windows Server 2022 yes yes macOS\u00ae x64 OS X\u00ae 10.10.0+ yes macOS 11 yes macOS 12 yes macOS 13 yes macOS 14 yes AIX\u00ae ppc32 ppc64 AIX 7.2 TL5 yes yes

Important: AIX OpenJ9 builds require the XL C++ Runtime 16.1.0.7 or later.

When public support for an operating system version ends, OpenJ9 can no longer be supported on that level.

"},{"location":"openj9_support/#openjdk-11","title":"OpenJDK 11","text":"

OpenJDK 11 binaries are expected to function on the minimum operating system levels shown in the following tables:

Linux (Note 1) AArch64 x64 ppc64le Z64 RHEL 8.8 yes yes yes yes RHEL 9.2 no yes yes yes SUSE Linux Enterprise Server (SLES) 12 SP5 no yes yes yes Ubuntu 20.04 yes yes yes yes Ubuntu 22.04 no yes yes yes

Notes:

Windows x64 Windows 10 yes Windows 11 yes Windows Server 2016 yes Windows Server 2019 yes Windows Server 2022 yes macOS x64 AArch64 (Apple silicon) OS X 10.11+ yes no macOS 11 yes yes macOS 12 yes yes macOS 13 yes yes macOS 14 yes yes AIX ppc64 AIX 7.2 TL5 yes

Important: AIX OpenJ9 builds require the XL C++ Runtime 16.1.0.7 or later.

When public support for an operating system version ends, OpenJ9 can no longer be supported on that level.

"},{"location":"openj9_support/#openjdk-17","title":"OpenJDK 17","text":"

OpenJDK 17 binaries are expected to function on the minimum operating system levels shown in the following tables:

Linux (Note 1) AArch64 x64 ppc64le Z64 RHEL 8.8 yes yes yes yes RHEL 9.2 no yes yes yes SUSE Linux Enterprise Server (SLES) 12 SP5 no yes yes yes Ubuntu 20.04 yes yes yes yes Ubuntu 22.04 no yes yes yes

Note: Not all of these distributions are tested, but the following distributions are expected to function without problems:

Windows x64 Windows 10 yes Windows 11 yes Windows Server 2016 yes Windows Server 2019 yes Windows Server 2022 yes macOS x64 AArch64 (Apple silicon) macOS 10.14+ yes no macOS 11 yes yes macOS 12 yes yes macOS 13 yes yes macOS 14 yes yes AIX ppc64 AIX 7.2 TL5 yes

Important: AIX OpenJ9 builds require the XL C++ Runtime 16.1.0.7 or later.

When public support for an operating system version ends, OpenJ9 can no longer be supported on that level.

"},{"location":"openj9_support/#openjdk-21-and-later","title":"OpenJDK 21 and later","text":"

OpenJDK 21 and later binaries are expected to function on the minimum operating system levels shown in the following tables:

Linux (Note 1) AArch64 x64 ppc64le Z64 RHEL 8.8 yes yes yes yes RHEL 9.2 no yes yes yes SUSE Linux Enterprise Server (SLES) 12 SP5 no yes yes yes Ubuntu 20.04 yes yes yes yes Ubuntu 22.04 no yes yes yes

Note: Not all of these distributions are tested, but the following distributions are expected to function without problems:

Windows x64 Windows 10 yes Windows 11 yes Windows Server 2016 yes Windows Server 2019 yes Windows Server 2022 yes macOS x64 AArch64 (Apple silicon) macOS 11 yes yes macOS 12 yes yes macOS 13 yes yes macOS 14 yes yes

Note: OpenJDK 22 is supported only on macOS 12-14.

AIX ppc64 AIX 7.2 TL5 yes

Important: AIX OpenJ9 builds require the XL C++ Runtime 16.1.0.7 or later.

When public support for an operating system version ends, OpenJ9 can no longer be supported on that level.

"},{"location":"openj9_support/#build-environments","title":"Build environments","text":"

The project builds and tests OpenJDK with OpenJ9 on a number of platforms. The operating system and compiler levels for the build systems are shown in the following tables.

"},{"location":"openj9_support/#openjdk-8_1","title":"OpenJDK 8","text":"Platform Operating system Compiler Linux x86 64-bit CentOS 6.10 gcc 11.2 Linux on POWER\u00ae LE 64-bit CentOS 7.9 gcc 11.2 Linux on IBM Z\u00ae 64-bit RHEL 7.9 gcc 11.2 Linux AArch64 64-bit CentOS 7.9 gcc 10.3 Windows x86 32-bit Windows Server 2019 Microsoft Visual Studio 2022 Windows x86 64-bit Windows Server 2019 Microsoft Visual Studio 2022 macOS x86 64-bit OSX 10.15.7 xcode 12.4 and clang 12.0.0 AIX POWER BE 64-bit AIX 7.2 TL5 xlc/C++ 16.1.0.11"},{"location":"openj9_support/#openjdk-11_1","title":"OpenJDK 11","text":"Platform Operating system Compiler Linux x86 64-bit CentOS 6.10 gcc 11.2 Linux on POWER LE 64-bit CentOS 7.9 gcc 11.2 Linux on IBM Z 64-bit RHEL 7.9 gcc 11.2 Linux AArch64 64-bit CentOS 7.9 gcc 10.3 Windows x86 64-bit Windows Server 2019 Microsoft Visual Studio 2022 macOS x86 64-bit macOS 10.15.7 xcode 12.4 and clang 12.0.0 macOS AArch64 macOS 11.5.2 xcode 13.0 and clang 13.0.0 AIX POWER BE 64-bit AIX 7.2 TL5 xlc/C++ 16.1.0.11"},{"location":"openj9_support/#openjdk-17_1","title":"OpenJDK 17","text":"Platform Operating system Compiler Linux x86 64-bit CentOS 7.9 gcc 11.2 Linux on POWER LE 64-bit CentOS 7.9 gcc 11.2 Linux on IBM Z 64-bit RHEL 7.9 gcc 11.2 Linux AArch64 64-bit CentOS 7.9 gcc 10.3 Windows x86 64-bit Windows Server 2019 Microsoft Visual Studio 2022 macOS x86 64-bit macOS 10.15.7 xcode 12.4 and clang 12.0.0 macOS AArch64 macOS 11.5.2 xcode 13.0 and clang 13.0.0 AIX POWER BE 64-bit AIX 7.2 TL5 xlc/C++ 16.1.0.11"},{"location":"openj9_support/#openjdk-21-and-later_1","title":"OpenJDK 21 and later","text":"Platform Operating system Compiler Linux x86 64-bit CentOS 7.9 gcc 11.2 Linux on POWER LE 64-bit CentOS 7.9 gcc 11.2 Linux on IBM Z 64-bit RHEL 7.9 gcc 11.2 Linux AArch64 64-bit CentOS 7.9 gcc 10.3 Windows x86 64-bit Windows Server 2019 Microsoft Visual Studio 2022 macOS x86 64-bit macOS 10.15.7 xcode 12.4 and clang 12.0.0 macOS AArch64 macOS 11.5.2 xcode 13.0 and clang 13.0.0 AIX POWER BE 64-bit AIX 7.2 TL5 xlc/C++ 16.1.0.11"},{"location":"openssl/","title":"OpenSSL","text":""},{"location":"openssl/#openssl","title":"OpenSSL","text":"

OpenJDK uses the in-built Java\u2122 cryptographic implementation by default but Eclipse OpenJ9\u2122 also provides some support for the OpenSSL cryptographic library. OpenSSL is an open source cryptographic toolkit for Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols, which is well established and used with many enterprise applications. Because it is a native library, OpenSSL might provide better performance. To use OpenSSL cryptographic acceleration, install OpenSSL 1.0.x, 1.1.x, or 3.x on your system. The OpenSSL V1.0.x, V1.1.x, and V3.x implementations are currently supported for the Digest, CBC, GCM, RSA, ECDH key agreement, and EC key generation algorithms. The OpenSSL V1.1.x and V3.x implementations are also supported for the ChaCha20 and ChaCha20-Poly1305 algorithms. The OpenSSL V1.1.1 onwards implementations are supported for the XDH key agreement and XDH key generation algorithms.

On Linux\u00ae and AIX\u00ae operating systems, the OpenSSL 1.0.x, 1.1.x, or 3.x library is expected to be found on the system path. If you use a package manager to install OpenSSL, the system path will be updated automatically. On Windows\u2122 and MacOS\u00ae the OpenSSL 3.x library is bundled. Later levels of some Linux operating systems also bundle OpenSSL 3.x.

If you have multiple versions of OpenSSL on your system, the OpenJ9 VM uses the latest version.

Note: OpenSSL 3.x does not support initialization vector (IV) sizes above 16 Bytes for the GCM algorithm. (In earlier OpenSSL versions, you can use such sizes but they might cause unpredictable behavior.) If you need to use a larger size, disable OpenSSL support for the GCM algorithm.

OpenSSL support is enabled by default for all supported algorithms. If you want to limit support to specific algorithms, a number of system properties are available for tuning the implementation.

Each algorithm can be disabled individually by setting the following system properties on the command line:

You can turn off all the algorithms by setting the following system property on the command line:

-Djdk.nativeCrypto=false\n

To build a version of OpenJDK with OpenJ9 that includes OpenSSL support, follow the steps in our detailed build instructions:

Note: If you obtain an OpenJDK with OpenJ9 build that includes OpenSSL or build a version yourself that includes OpenSSL support, the following acknowledgments apply in accordance with the license terms:

"},{"location":"shrc/","title":"Introduction","text":""},{"location":"shrc/#introduction-to-class-data-sharing","title":"Introduction to class data sharing","text":"

Sharing class data between Eclipse OpenJ9\u2122 VMs improves start up performance and reduces memory footprint. Consider the following outcomes for two VMs that are running similar Java applications but sharing class data:

When class data sharing is enabled, OpenJ9 automatically creates shared memory that stores and shares the classes in memory between processes. This shared classes cache is updated dynamically; when an application loads new classes, the VM automatically stores them in the cache without any user intervention. By default, class data sharing is enabled for bootstrap classes, as described in Enabling class data sharing.

When class data sharing is enabled, Ahead-of-time (AOT) compilation is also enabled by default, which dynamically compiles certain methods into AOT code at runtime. By using these features in combination, startup performance is further improved because the cached AOT code can be used to quickly enable native code performance for subsequent runs of your application. For more information about AOT, see AOT Compiler. Further performance improvements are gained by storing JIT data and profiles in the shared classes cache.

The contents of a shared classes cache can include the following artifacts:

"},{"location":"shrc/#cache-utilities","title":"Cache utilities","text":"

Active caches can be managed by a set of cache utilities, which are invoked by specifying -Xshareclasses suboptions. These utilities control the following types of operations:

These cache utilities are discussed in more detail in the sections that follow.

"},{"location":"shrc/#enabling-class-data-sharing","title":"Enabling class data sharing","text":"

Class data sharing is enabled by default for bootstrap classes, unless your application is running in a container. Default behavior includes the following characteristics:

Shared class behavior is controlled by specifying the -Xshareclasses option on the command line when you start your application. The default settings are equivalent to specifying the following suboptions:

-Xshareclasses:bootClassesOnly,nonFatal,silent\n

You can enable class data sharing for non-bootstrap classes as well as bootstrap classes, by omitting the bootClassesOnly suboption. You can also disable all class data sharing by using the none suboption.

Further suboptions are available to configure a cache at startup, including name, location, and startup size. You can also use cache utilities to manage a shared classes cache after it is initialized and in use.

A shared classes cache can be persistent or non-persistent according to the following definition:

By default, a shared classes cache is persistent, except on the z/OS platform. Support for persistent shared class cache was added on z/OS in 0.40.0 release but the default cache type on z/OS is still nonpersistent.

If you are using a non-persistent cache, you can use a cache utility to create a snapshot of the cache, which can be reinitialized after a reboot. For more information see Saving a non-persistent shared classes cache.

If you have multiple VMs and you do not change the default shared classes behavior, the VMs share a single default cache, assuming that the VMs are from a single Java installation. If the VMs are from different Java installations, the cache might be deleted and re-created.

For a set of best practices when using class data sharing, see Creating a shared classes cache.

"},{"location":"shrc/#class-data-sharing-operations","title":"Class data sharing operations","text":"

When a VM loads a class and the class loader is enabled for class sharing, the VM looks in the shared classes cache to see if the class is already present. If the class is present and the classpath or URL to load the class is a match, the VM loads the class from the cache. Otherwise, it loads the class from the file system and writes it into the cache.

The VM detects file system updates by storing timestamp values into the cache and comparing the cached values with actual values. In this way, the VM detects when a class might be invalidated and can mark the class as stale. These operations happen transparently when classes are loaded, so users can modify and update as many classes as they like during the lifetime of a shared classes cache, knowing that the correct classes are always loaded. Stale classes are redeemed if the same class is subsequently fetched by the class loader from another VM and checked against the stale class in the cache.

Occasionally, caches that are created from one version of the VM might not be compatible with caches that are created from a different version. This situation typically occurs when an update is made in OpenJ9 that changes the internal cache data structure. If a VM detects an incompatible cache at start up, it creates a new cache that can coexist, even if it has the same name. The VM detects a conflict by checking an internal shared classes cache generation number.

Caches are not compatible between VMs that are using different object storage modes. For example, a 64-bit VM that uses compressed references to store 64-bit objects in a 32-bit representation, cannot share a cache with a 64-bit VM that is not using compressed references. For more information about object storage options, see Compressed references.

In the OpenJ9 implementation of java.net.URLClassLoader, classes are read from and written to the cache using the public Helper API. Therefore, any class loader that extends java.net.URLClassLoader gets class sharing support for free provided that it continues to use the methods in java.net.URLClassLoader to load classes. Custom class loaders that do not extend java.net.URLClassLoader must be adapted to share class data as described in Support for custom class loaders.

"},{"location":"shrc/#aot-code-and-jit-data","title":"AOT code and JIT data","text":"

OpenJ9 can automatically store small amounts of AOT code and JIT data, which helps improve performance in the following ways:

The default settings provide significant performance benefits. However, you can specify options on the command line to configure AOT code storage or JIT data storage in the shared classes cache, as shown in the following table:

Component Setting a minimum storage value Setting a maximum storage value Turning off storage AOT code -Xscminaot<size> -Xscmaxaot<size> -Xshareclasses:noaot JIT data -Xscminjitdata<size> -Xscmaxjitdata<size> -Xshareclasses:nojitdata

The following cache utilities are available to adjust the storage values when a cache is active:

Component Adjusting the minimum storage value Adjusting the maximum storage value AOT code -Xshareclasses:adjustminaot -Xshareclasses:adjustmaxaot JIT code -Xshareclasses:adjustminjit -Xshareclasses:adjustmaxjit

You can also use the -Xshareclasses:findAotMethods cache utility to list the AOT methods in a cache that match a method specification. This utility helps you identify methods that are causing a failure in an application. You can then invalidate the method without destroying the cache by using the -Xshareclasses:invalidateAotMethods cache utility. You can also revalidate an AOT method with the -Xshareclasses:revalidateAotMethods cache utility. To troubleshoot AOT problems, use the -Xshareclasses:verboseAOT suboption on the command line, which generates output about AOT code that is found or stored in the cache. For more information see -Xshareclasses.

"},{"location":"shrc/#creating-a-shared-classes-cache","title":"Creating a shared classes cache","text":"

The -Xshareclasses option is highly configurable, allowing you to specify where to create the cache, how much space to allocate, and more. The following best practices apply to using class data sharing:

"},{"location":"shrc/#creating-layer-caches","title":"Creating layer caches","text":"

Creating a layered cache might be useful when you are building a Docker image.

Normally, writing to an existing shared cache in a lower image layer results in Docker duplicating the shared cache to the top layer (following the Docker copy-on-write strategy). With a layered cache, you can instead write into a new cache in the top layer. The new cache builds on the existing cache, so space is saved in the image.

The following example shows a Docker container with four layers:

  1. The lowest layer is a Ubuntu Docker image.
  2. The next layer is an OpenJ9 Docker image that is built on the Ubuntu image. As part of this image, the -Xshareclasses:name=MyCache suboption is used to create a cache called MyCache. The layer number assigned to this cache is 0. The listAllCaches suboption shows the cache and the layer number:

    java -Xshareclasses:listAllCaches\n...\nCache name              level         cache-type      feature         layer       OS shmid       OS semid       last detach time\n\nCompatible shared caches\nMyCache                 Java8 64-bit  persistent      cr              0                                         Mon Sep 23 11:41:04 2019\n
  3. The next Docker layer up is a middleware image that is built on the OpenJ9 image. As part of this image, the -Xshareclasses:name=MyCache,layer=1 suboption is used to create another cache called MyCache. Because the layer=1 suboption is specified, this new cache is a layered cache, which builds on MyCache in the previous container layer. (Open Liberty starts two VMs, so if you instead use the createLayer suboption here, two layered caches are created, with layer numbers of 1 and 2.) Note that cache layers are different from, and independent of, container layers.

  4. In the same way, another Docker layer is added for an application, and another layered cache is created to add to MyCache. The listAllCaches suboption now shows all the caches and their layers:

    java -Xshareclasses:listAllCaches\n...\nCache name              level         cache-type      feature         layer       OS shmid       OS semid       last detach time\n\nCompatible shared caches\nMyCache                 Java8 64-bit  persistent      cr              0                                         Mon Sep 23 11:41:04 2019\nMyCache                 Java8 64-bit  persistent      cr              1                                         Mon Sep 23 11:46:25 2019\nMyCache                 Java8 64-bit  persistent      cr              2                                         In use\n

The caches are created in the same directory.

When you use the -Xshareclasses:name=MyCache suboption in future Java commands, all the caches are started. The top-layer cache is started in read/write mode, and lower-layer caches are started in read-only mode. Modifying a lower-layer cache will invalidate all the caches in the layers above.

The following options and cache utilities are available for creating, managing, and removing layered caches:

"},{"location":"shrc/#saving-a-non-persistent-shared-classes-cache","title":"Saving a non-persistent shared classes cache","text":"

As described in an earlier section, a shared classes cache can be persistent or non-persistent; persistent caches are memory-mapped files. By default, a cache is persistent on all platforms, except z/OS. Non-persistent caches are stored in shared memory and are removed when a system is rebooted. If you want to save a non-persistent cache beyond a reboot, you might want to consider taking a cache snapshot.

To create a snapshot of a non-persistent shared classes cache, use the -Xshareclasses:snapshotCache cache utility. The snapshot has the same name and location as the shared cache, as specified by the name and cacheDir suboptions. The shared cache can be in use when the snapshot is taken, but VMs are blocked when they try to write to the shared cache while the cache data is copied to the file.

Typically, after a system is reinitialized, the snapshot file is used to restore the copy of the non-persistent cache into shared memory, by using the -Xshareclasses:restoreFromSnapshot cache utility. Because this process removes all non-persistent caches from shared memory, restoring the cache from the snapshot file can result in better VM startup performance, because the contents of the shared cache, including classes and AOT code, do not have to be re-created.

The -Xshareclasses:listAllCaches cache utility can be used to identify snapshots on a system.

A snapshot can be created only if the user has sufficient permissions to create the destination snapshot file. If a snapshot of the same name exists already, it is overwritten. On platforms that support persistent caches, the nonpersistent suboption must be specified in order to create a snapshot. For information about removing snapshot files, see the destroySnapshot and destroyAllSnapshots cache utilities in Housekeeping.

Note: The snapshotCache and restoreFromCache cache utilities cannot be used on Windows systems.

"},{"location":"shrc/#housekeeping","title":"Housekeeping","text":"

Caches can be deleted if they contain many stale classes or if the cache is full and you want to create a bigger cache. Use one of the following utilities to remove unwanted caches:

Note: You must always use the utilities to remove non-persistent caches correctly from shared memory.

Caches can also be removed if they are unused for a specified amount of time. To configure time-based housekeeping, use the -Xshareclasses:expire option.

If you want to remove a cache but allow it to be re-created when the VM restarts, use the -Xshareclasses:reset option.

"},{"location":"shrc/#support-for-custom-class-loaders","title":"Support for custom class loaders","text":"

Classes are shared by the bootstrap class loader internally in the VM. The OpenJ9 implementation of java.net.URLClassLoader is modified to use SharedClassURLClasspathHelper and any class loaders that extend java.net.URLClassLoader can inherit this behavior. If you are using a custom class loader that does not extend java.net.URLClassLoader, you can use the Java Helper API to find and store classes in a shared classes cache.

If a running application uses its own class loader and you are using a SecurityManager, you must grant the class loader permission to SharedCachePermission before they can share classes. To grant permission, add shared class permissions to the java.policy file by specifying the ClassLoader class name. Permissions can be set for read, write, or read,write. For example:

permission com.ibm.oti.shared.SharedClassPermission\n        \"com.abc.customclassloaders.*\", \"read,write\";\n

If a running application is calling the com.ibm.oti.shared.SharedClassUtilities APIs getSharedCacheInfo() or destroySharedCache(), you must also grant the code calling these APIs the appropriate SharedClassesNamedPermission. For example:

permission com.ibm.oti.shared.SharedClassesNamedPermission \"getSharedCacheInfo\";\npermission com.ibm.oti.shared.SharedClassesNamedPermission \"destroySharedCache\";\n
"},{"location":"shrc/#the-java-shared-classes-helper-api","title":"The Java shared classes Helper API","text":"

The Java Helper API classes can be found in the com.ibm.oti.shared package.

Each class loader that wants to share classes must get a SharedClassHelper object from a SharedClassHelperFactory. The SharedClassHelper, when created, has a one to one relationship with the class loader. That is, it belongs to the class loader that requested it and can only store classes defined by that class loader. The SharedClassHelper gives the class loader a simple API for finding and storing classes in the class cache to which the VM is connected. If the class loader is garbage collected, its SharedClassHelper is also garbage collected.

The following main functions are available from the SharedClassHelper API:

You can also define partitions in a cache to store sets of classes separately from one another. For more information see SharedClassHelper cache partitions.

Each class loader that wants to share data must get a SharedDataHelper object from a SharedDataHelperFactory. A SharedDataHelperFactory provides an interface that can be used to create SharedDataHelpers, which are used for storing Java byte array data. A SharedDataHelper also has a one to one relationship with a class loader, although a class loader can exist without a SharedDataHelper.

"},{"location":"shrc/#the-java-shared-classes-utility-api","title":"The Java shared classes utility API","text":"

The following APIs are available for obtaining information about a shared classes cache:

"},{"location":"shrc/#support-for-bytecode-instrumentation","title":"Support for bytecode instrumentation","text":"

Modifying the bytecode of a set of classes at runtime is a useful mechanism for adding functions to a program, such as profiling or debugging. The JVM Tools Interface (JVMTI) includes hooks that allow you to instrument the byte code in this way. Alternatively, you can write your own Java agent that uses the java.lang.instrument API. Sharing classes that are changed before they are loaded adds complexity to the class sharing process.

By default, if OpenJ9 detects that a JVMTI agent or java.lang.instrument agent has registered to modify class bytes, modified classes are not stored in the cache. Instead, the VM stores original class byte data in the cache, which allows classes to be retransformed.

If you turn off bytecode instrumentation support by specifying -Xshareclasses:disableBCI and do not use a modification context to share modified classes safely, all bytecode is loaded from the file system for the agent to modify. When passed to the cache for storing, the VM compares the bytes with known classes of the same name. If a match is found, the class is reused. However, if a match is not found, the potentially modified class is stored in the cache in a way that prevents other VMs from loading it. In this situation, performance can be affected because the bytecode is always loaded from the file system and compared with existing classes in the cache. When bytecode instrumentation is turned off, classes loaded from the shared cache cannot be retransformed. For more information about using a modification context, see Sharing modified bytecode.

"},{"location":"shrc/#redefined-and-retransformed-classes","title":"Redefined and retransformed classes","text":"

The following rules exist for classes that are redefined or retransformed by JVMTI or java.lang.instrument agents:

"},{"location":"shrc/#sharing-modified-bytecode","title":"Sharing modified bytecode","text":"

Sharing modified bytecode can be advantageous for applications that use the same modifications because the transformation process needs to happen only once. OpenJ9 allows multiple VMs that are using the same or different types of class modifications to safely share the cache. However, when a class is modified and cached, it cannot be modified (retransformed) further.

Modified bytecode can be shared safely by using a modification context. Use the -Xshareclasses:disableBCI and -Xshareclasses:modified=<modified_context> suboptions when you start your application, where <modified_context> is a user-defined description. The cache is structured so that any VM that is started with the same modification context can share the classes in a private area. The following outcomes apply to VMs that do not want to share the modified classes:

"},{"location":"shrc/#sharedclasshelper-cache-partitions","title":"SharedClassHelper cache partitions","text":"

Another method of structuring and protecting classes in the shared classes cache can be implemented by using the SharedClassHelper API with a custom class loader. This mechanism creates partitions by using a string key to identify a set of classes, which can be stored and retrieved by the class loader. A use case for this mechanism is Aspect Oriented Programming (AOP) where aspects are woven in to bytecode when a class is loaded into the VM. Being able to partition the cache provides a suitable level of granularity when you want to use different aspect paths.

Although it is possible to combine partitions and modification contexts, this practice is not recommended because the cache will contain partitions within partitions.

Note: Partitions are not supported by the bootstrap class loader or the default application class loader.

"},{"location":"shrc/#see-also","title":"See also","text":""},{"location":"shrc_diag_util/","title":"Diagnosing problems","text":""},{"location":"shrc_diag_util/#diagnosing-problems-with-class-data-sharing","title":"Diagnosing problems with class data sharing","text":"

If you encounter problems with class data sharing, VM messages are typically generated that point to an underlying cause. In some situations, a cache might fail to initialize correctly. In other situations classes might not be found or stored in the shared classes cache. To provide more information about a problem, you can generate verbose output, use diagnostic cache utilities, or use the Eclipse OpenJ9\u2122 trace facility.

"},{"location":"shrc_diag_util/#initialization-problems","title":"Initialization problems","text":"

If you do not specify a directory for the shared classes cache by using the cacheDir suboption, the cache is created in the javasharedresources directory in the following default location:

Initialization problems can occur on systems other than Windows because caches are created with read/write access for the user only and subsequent users do not have permission to write to the home directory. If you specify the -Xshareclasses:groupAccess suboption, the cache is created in the /tmp directory instead where all users have permission to write to the cache.

For a persistent cache, initialization problems can also occur if there is insufficient disk space available or if you are attempting to locate the cache on a remote networked file system, which is not supported.

For a non-persistent cache, a shared memory area is required. Check that your system is configured with sufficient resources as described in Setting shared memory values. If initialization problems persist, try deleting the cache by using the -Xshareclasses:destroyAll cache utility, which removes all known shared memory areas and semaphores for caches in the cacheDir specified or the default directory. These actions force the VM to re-create the cache.

"},{"location":"shrc_diag_util/#problems-finding-or-storing-classes","title":"Problems finding or storing classes","text":"

The most common cause for classes not being stored in the cache is due to space constraints. Make sure that you set an appropriate size for the cache, as described in Creating a shared classes cache. Setting a soft maximum size is recommended, because you can adjust the soft maximum size that is set for the cache after it is created. See Setting a soft maximum size.

Storing classes can also be a problem if the cache is opened read-only or if the class does not exist on the file system because it is sourced from a URL location.

If you are attempting to share modified bytecode, you must use a modification context, as described in Sharing modified bytecode. Otherwise, classes are stored in a private area that is not accessible to other VMs.

If you are using a custom class loader, class path entries in the SharedClassURLClasspathHelper must be confirmed before classes can be found for these entries. More information about confirmed entries is available in the SharedClassURLClasspathHelper interface in the com.ibm.oti.shared API documentation.

If you are instrumenting bytecode by using a JVMTI agent or java.lang.instrument agent, the following rules apply:

If a running application uses its own class loader and you are using a SecurityManager, you must grant the class loader permission to SharedCachePermission before they can share classes. For more information, see Support for custom class loaders.

In very rare cases, problems with finding or storing classes might be due to cache corruption. If the VM detects that a cache is corrupt, it attempts to destroy the cache and re-create it. If the VM cannot re-create the cache, it starts only if the -Xshareclasses:nonfatal suboption is specified on the command line, but without using the shared cache. Try using the -Xshareclasses:destroy cache utility to remove the specific cache and re-create it. You might need to specify the cacheDir=<directory> and name=<cache_name> suboptions if the cache is not using the default settings.

"},{"location":"shrc_diag_util/#generating-verbose-output","title":"Generating verbose output","text":"

A number of -Xshareclasses suboptions are available for generating verbose output during class data sharing operations, which can help you identify the root cause of a problem.

"},{"location":"shrc_diag_util/#verbose","title":"verbose","text":"

The -Xshareclasses:verbose suboption provides basic output on cache usage. In the following example, a persistent cache is opened and attached to the VM for class sharing. Information is provided about the size of the cache, the unstored bytes due to the setting of a soft maximum size, and maximum AOT and JIT data size.

java -Xshareclasses:name=myCache,verbose HelloWorld\n[-Xshareclasses persistent cache enabled]\n[-Xshareclasses verbose output enabled]\nJVMSHRC237I Opened shared classes persistent cache myCache\nJVMSHRC246I Attached shared classes persistent cache myCache\nJVMSHRC765I Memory page protection on runtime data, string read-write data and partially filled pages is successfully enabled\nHello World\nJVMSHRC168I Total shared class bytes read=2532416. Total bytes stored=268156\nJVMSHRC818I Total unstored bytes due to the setting of shared cache soft max is 0. Unstored AOT bytes due to the setting of -Xscmaxaot is 0. Unstored JIT bytes due to the setting of -Xscmaxjitdata is 0.\n\n
"},{"location":"shrc_diag_util/#verboseio","title":"verboseIO","text":"

The -Xshareclasses:verboseIO suboption provides more detailed information about class sharing operations. In the following example, some classes are found when the cache is accessed. However, class openj9/internal/tools/attach/target/CommonDirectory is not found and is therefore stored for sharing.

java -Xshareclasses:name=myCache,verboseIO HelloWorld\n[-Xshareclasses verbose I/O output enabled]\nFound class java/lang/Object in shared cache for class-loader id 0.\nFound class java/lang/J9VMInternals in shared cache for class-loader id 0.\nFound class com/ibm/oti/vm/VM in shared cache for class-loader id 0.\nFound class java/lang/J9VMInternals$ClassInitializationLock in shared cache for class-loader id 0.\n...\nFailed to find class openj9/internal/tools/attach/target/CommonDirectory in shared cache for class-loader id 0.\nStored class openj9/internal/tools/attach/target/CommonDirectory in shared cache for class-loader id 0 with URL /root/sdk/jre/lib/amd64/compressedrefs/jclSC180/vm.jar (index 0).\n...\n

The bootstrap class loader has an ID of 0; other class loaders are given a unique ID. Class loaders follow the class loader hierarchy by asking the parent class loader for a class. If a parent fails to find the class in the cache, the child class loader stores the class in the cache.

In some situations, verbose output might not show classes being found. For example, classes are typically not found if the class is stale, as described in Class data sharing operations. Stale classes are redeemed if the same class is subsequently fetched by the class loader from another VM and checked against the stale class in the cache.

"},{"location":"shrc_diag_util/#verboseaot","title":"verboseAOT","text":"

To troubleshoot AOT problems, use the -Xshareclasses:verboseAOT suboption on the command line, which generates output about AOT code that is found or stored in the cache.

In the following example output, a populated cache is being accessed to look for compiled AOT code. Some AOT code is found, which can be shared, and some AOT code is stored for reuse.

java -Xshareclasses:name=myCache,verboseAOT HelloWorld\n[-Xshareclasses AOT verbose output enabled]\nFound AOT code for ROMMethod 0x00007F658005C180 in shared cache.\nFound AOT code for ROMMethod 0x00007F65800723EC in shared cache.\nFound AOT code for ROMMethod 0x00007F6580071D14 in shared cache.\nStored AOT code for ROMMethod 0x00007F65801847B8 in shared cache.\nStored AOT code for ROMMethod 0x00007F65800D38A4 in shared cache.\nStored AOT code for ROMMethod 0x00007F65800723CC in shared cache.\nFound AOT code for ROMMethod 0x00007F65800D38A4 in shared cache.\nStored AOT code for ROMMethod 0x00007F65800724C4 in shared cache.\n...\n
"},{"location":"shrc_diag_util/#verbosehelper","title":"verboseHelper","text":"

To troubleshoot problems with custom class loaders that use the Java SharedClassHelper API, specify the -Xshareclasses:verboseHelper suboption. Information messages and error messages are generated in the output, which can help you diagnose problems with finding or storing classes in the shared cache.

The following example output shows only information messages:

java -Xshareclasses:name=myCache,verboseHelper HelloWorld\n[-Xshareclasses Helper API verbose output enabled]\nInfo for SharedClassURLClasspathHelper id 1: Verbose output enabled for SharedClassURLClasspathHelper id 1\nInfo for SharedClassURLClasspathHelper id 1: Created SharedClassURLClasspathHelper with id 1\nInfo for SharedClassURLClasspathHelper id 2: Verbose output enabled for SharedClassURLClasspathHelper id 2\nInfo for SharedClassURLClasspathHelper id 2: Created SharedClassURLClasspathHelper with id 2\nInfo for SharedClassURLClasspathHelper id 1: There are no confirmed elements in the classpath. Returning null.\nInfo for SharedClassURLClasspathHelper id 2: There are no confirmed elements in the classpath. Returning null.\nInfo for SharedClassURLClasspathHelper id 2: setClasspath() updated classpath. No invalid URLs found\nInfo for SharedClassURLClasspathHelper id 2: Number of confirmed entries is now 1\nHello World\n
"},{"location":"shrc_diag_util/#diagnostic-cache-utilities","title":"Diagnostic cache utilities","text":"

These utilities display information about the contents of a shared classes cache. Run the utilities by specifying them as suboptions of -Xshareclasses. The utilities run on the default cache unless you specify a cache by adding the name=<cache_name> and cacheDir=<directory> suboptions.

"},{"location":"shrc_diag_util/#printstats","title":"printStats","text":"
-Xshareclasses:printStats\n-Xshareclasses:printStats,name=<cache_name>\n-Xshareclasses:printStats=<data_type1>[+<data_type2>][...],name=<cache_name>\n

Displays summary information about the cache. For layered caches, -Xshareclasses:printStats shows some information for the top layer cache, and summary information (bytes and counts only) for all layers combined. To see information for the top layer cache only, use printTopLayerStats.

You can request more detail about items of a specific data type that are stored in the shared cache by using printStats=<data_type>. Use the plus symbol (+) to separate the data types. For example, use printStats=romclass+url,name=myCache to see information about ROMClass and URL items in all the layer caches of the cache called Cache1. The valid data types are as follows (case insensitive):

Example output for a traditional cache (no cache layers: cache layer = 0), with summary information only:

Current statistics for cache \"Cache1\":\n\nCache created with:\n        -Xnolinenumbers                      = false\n        BCI Enabled                          = true\n        Restrict Classpaths                  = false\n        Feature                              = cr\n\nCache contains only classes with line numbers\n\nbase address                         = 0x00007F60B807A000\nend address                          = 0x00007F60B905E000\nallocation pointer                   = 0x00007F60B81BE3A8\n\ncache layer                          = 0\ncache size                           = 16776608\nsoftmx bytes                         = 16776608\nfree bytes                           = 12740572\nReserved space for AOT bytes         = -1\nMaximum space for AOT bytes          = -1\nReserved space for JIT data bytes    = -1\nMaximum space for JIT data bytes     = -1\nMetadata bytes                       = 30440\nMetadata % used                      = 0%\nClass debug area size                = 1331200\nClass debug area used bytes          = 189358\nClass debug area % used              = 14%\n\nROMClass bytes                       = 1328040\nAOT bytes                            = 98404\nJIT data bytes                       = 168\nZip cache bytes                      = 1133704\nStartup hint bytes                   = 0\nData bytes                           = 114080\n\n# ROMClasses                         = 452\n# AOT Methods                        = 2\n# Classpaths                         = 1\n# URLs                               = 0\n# Tokens                             = 0\n# Zip caches                         = 21\n# Startup hints                      = 0\n# Stale classes                      = 0\n% Stale classes                      = 0%\n\n\nCache is 24% full\n\nCache is accessible to current user = true\n

Example output for a cache with 2 layers (cache layer = 1), with summary information only:

Current statistics for top layer of cache \"Cache1\":\n\nCache created with:\n        -Xnolinenumbers                      = false\n        BCI Enabled                          = true\n        Restrict Classpaths                  = false\n        Feature                              = cr\n\n\nbase address                         = 0x00007FCAB2766000\nend address                          = 0x00007FCAB374A000\nallocation pointer                   = 0x00007FCAB2766000\n\ncache layer                          = 1\ncache size                           = 16776608\nsoftmx bytes                         = 16776608\nfree bytes                           = 15299372\nReserved space for AOT bytes         = -1\nMaximum space for AOT bytes          = -1\nReserved space for JIT data bytes    = -1\nMaximum space for JIT data bytes     = -1\nClass debug area size                = 1331200\nClass debug area used bytes          = 0\nClass debug area % used              = 0%\n\nCache is 8% full\n\nCache is accessible to current user = true\n---------------------------------------------------------\n\nCurrent statistics for all layers of cache \"Cache1\":\n\nROMClass bytes                       = 1328040\nAOT bytes                            = 128924\nJIT data bytes                       = 812\nZip cache bytes                      = 1133704\nStartup hint bytes                   = 0\nData bytes                           = 114080\n\n# ROMClasses                         = 452\n# AOT Methods                        = 20\n# Classpaths                         = 1\n# URLs                               = 0\n# Tokens                             = 0\n# Zip caches                         = 21\n# Startup hints                      = 0\n# Stale classes                      = 0\n% Stale classes                      = 0%\n

The Cache created with section indicates the options that were used when the cache was created. BCI Enabled relates to the -Xshareclasses:enableBCI option (enabled by default) and Restrict Classpaths relates to the -Xshareclasses:restrictClasspaths option. Feature = cr indicates that the cache is a 64-bit compressed references cache.

Line number information for classes in the cache is then shown with one of the following messages:

The following summary data is displayed:

"},{"location":"shrc_diag_util/#printallstats","title":"printAllStats","text":"
-Xshareclasses:printAllStats\n-Xshareclasses:printAllStats,name=<cache_name>\n

Displays the contents of the cache in chronological order. You can use this output to see the history of updates that were made to the cache. For layered caches, some information is shown for the top layer cache only, and some is shown for all layers combined. To see information for the top layer cache only, use printTopLayerStats=all.

Each entry in the output starts with a VM ID, so you can see which VM wrote the associated data. Here are example entries for various types of cache data, with explanations:

"},{"location":"shrc_diag_util/#class-paths","title":"Class paths","text":"

The following example shows one class path with 4 entries:

    1: 0x2234FA6C CLASSPATH\n            /myVM/Apps/application1.jar\n            /myVM/Apps/application2.jar\n            /myVM/Apps/application3.jar\n            /myVM/Apps/application4.jar\n
"},{"location":"shrc_diag_util/#romclasses","title":"ROMClasses","text":"

This example shows an entry for a single ROMClass:

    1: 0x2234F7DC ROMCLASS: java/lang/Runnable at 0x213684A8\n            Index 1 in class path 0x2234FA6C\n

Stale classes are marked with !STALE!. Any partition or modification context that is used when the class is stored is also shown.

"},{"location":"shrc_diag_util/#aot-methods","title":"AOT methods","text":"

This example shows an entry for one AOT-compiled method:

    1: 0x00007F841A800554 AOT: hashCode Signature: ()I Address: 0x00007F83F6859280\n            for ROMClass java/lang/Object at 0x00007F83F6859000.\n

Stale methods are marked with !STALE!.

"},{"location":"shrc_diag_util/#urls-and-tokens","title":"URLs and tokens","text":"

The output for these data types has the same format as that for class paths, but with a single entry. A Token is a string that is passed to the Java SharedClassHelper API.

"},{"location":"shrc_diag_util/#zip-entry-caches","title":"Zip entry caches","text":"

The following example shows 4 separate entries for zip entry caches:

    1: 0x042FE07C ZIPCACHE: luni-kernel.jar_347075_1272300300_1 Address: 0x042FE094 Size: 7898\n    1: 0x042FA878 ZIPCACHE: luni.jar_598904_1272300546_1 Address: 0x042FA890 Size: 14195\n    1: 0x042F71F8 ZIPCACHE: nio.jar_405359_1272300546_1 Address: 0x042F7210 Size: 13808\n    1: 0x042F6D58 ZIPCACHE: annotation.jar_13417_1272300554_1 Address: 0x042F6D70 Size: 1023\n
"},{"location":"shrc_diag_util/#jit-data","title":"JIT data","text":"

Information about JIT data is shown in JITPROFILE and JITHINT entries. For example:

    1: 0xD6290368 JITPROFILE: getKeyHash Signature: ()I Address: 0xD55118C0\n    for ROMClass java/util/Hashtable$Entry at 0xD5511640.\n    2: 0xD6283848 JITHINT: loadClass Signature: (Ljava/lang/String;)Ljava/lang/Class; Address: 0xD5558F98\n    for ROMClass com/ibm/oti/vm/BootstrapClassLoader at 0xD5558AE0.\n
"},{"location":"shrc_diag_util/#startup-hints","title":"Startup hints","text":"

Information about startup hints is shown in STARTUP HINTS KEY and STARTUP HINTS DETAIL. For example:

    1: 0x000000002237C6E0 STARTUP HINTS KEY: -Xoptionsfile=jre\\bin\\compressedrefs\\options.default -Xlockword:mode=default -Xjcl:jclse29 -Dcom.ibm.oti.vm.bootstrap.library.path=jre\\bin\\compressedrefs;jre\\bin -Djava.home=jre -Djava.ext.dirs=jre\\lib\\ext -Duser.dir=bin -Djava.class.path=. -Dsun.java.launcher=SUN_STANDARD Address: 0x000000002237C700 Size: 96\n    STARTUP HINTS DETAIL Flags: 1 DATA1: 1677721 DATA2: 5033165\n
"},{"location":"shrc_diag_util/#printtoplayerstats","title":"printTopLayerStats","text":"

Use this utility with a layered cache. This utility works in the same way as printStats. By default, this utility shows information for the top layer cache. To view statistics for a specific layer, use the layer=<number> option. For example, to show statistics for the second layer in a 2-layer cache, run printTopLayerStats,layer=1.

Example output:

Current statistics for cache \"Cache1\":\n\nCache created with:\n        -Xnolinenumbers                      = false\n        BCI Enabled                          = true\n        Restrict Classpaths                  = false\n        Feature                              = cr\n\n\nbase address                         = 0x00007F234C054000\nend address                          = 0x00007F234D038000\nallocation pointer                   = 0x00007F234C054000\n\ncache layer                          = 1\ncache size                           = 16776608\nsoftmx bytes                         = 16776608\nfree bytes                           = 15299372\nReserved space for AOT bytes         = -1\nMaximum space for AOT bytes          = -1\nReserved space for JIT data bytes    = -1\nMaximum space for JIT data bytes     = -1\nMetadata bytes                       = 792\nMetadata % used                      = 0%\nClass debug area size                = 1331200\nClass debug area used bytes          = 0\nClass debug area % used              = 0%\n\nROMClass bytes                       = 0\nAOT bytes                            = 30520\nJIT data bytes                       = 644\nZip cache bytes                      = 0\nStartup hint bytes                   = 0\nData bytes                           = 114080\n\n# ROMClasses                         = 0\n# AOT Methods                        = 18\n# Classpaths                         = 0\n# URLs                               = 0\n# Tokens                             = 0\n# Zip caches                         = 0\n# Startup hints                      = 0\n# Stale classes                      = 0\n% Stale classes                      = 0%\n\n\nCache is 8% full\n\nCache is accessible to current user = true\n
"},{"location":"shrc_diag_util/#using-the-trace-facility","title":"Using the trace facility","text":"

Trace output contains very detailed information that might be used by a VM developer to diagnose complex problems with class data sharing. Trace is configured by using the -Xtrace option and the binary output of the trace facility must be processed by the Trace formatter into a human-readable format.

The trace component for class data sharing is j9shr. Five levels of trace are available, starting from basic initialization and runtime information in level 1 up to the most detailed trace output in level 5.

To trace memory-mapped files, shared memory, and shared semaphores, include the j9prt trace component.

To trace operations with Java Helper API methods, include the j9jcl trace component.

"},{"location":"tool_builder/","title":"Option builder","text":""},{"location":"tool_builder/#option-builder-tools","title":"Option builder tools","text":"

You can modify many of the command-line options by specifying a number of parameters.

Several of the options have many available parameters that you can combine in numerous ways to achieve the effect you want.

Tools are available for the following options to help you select these parameters correctly, achieve the correct combinations, and avoid conflicts:

"},{"location":"tool_jcmd/","title":"Java command (jcmd) tool","text":""},{"location":"tool_jcmd/#java-diagnostic-command-jcmd-tool","title":"Java diagnostic command (jcmd) tool","text":"

Use the jcmd tool to run diagnostic commands on a specified VM.

Note: Running diagnostic commands can significantly affect the performance of the target VM.

The command syntax is as follows:

jcmd [<options>] [<vmid | display name | 0> <arguments>]\n

Where:

Examples:

jcmd 31452 Thread.print\njcmd 31452 help Dump.heap\njcmd 31452 Dump.heap myHeapDump\n

Restrictions: This tool is not supported and is subject to change or removal in future releases. Although similar in usage and output to the HotSpot tool of the same name, this tool is a different implementation that is specific to Eclipse OpenJ9\u2122. For information about the differences between these two implementations, see Switching to OpenJ9.

The tool uses the Attach API, and has the following limitations:

For more information about the Attached API, including how to enable and secure it, see Java Attach API.

"},{"location":"tool_jcmd/#see-also","title":"See Also","text":""},{"location":"tool_jdmpview/","title":"Dump viewer","text":""},{"location":"tool_jdmpview/#dump-viewer-jdmpview","title":"Dump viewer (jdmpview)","text":"

The dump viewer is a command-line tool that allows you to examine the contents of system dumps produced from the Eclipse OpenJ9\u2122 VM. The dump viewer allows you to view both Java\u2122 and native information from the time the dump was produced. You can run the dump viewer on one platform to work with dumps from another platform.

For long running tasks, the dump viewer can also be run in batch mode.

The dump viewer is useful for diagnosing OutOfMemoryError exceptions in Java\u2122 applications. For problems like general protection faults (GPFs), system abends, and SIGSEGVs, a system debugger such as gdb (Linux) provides more information.

"},{"location":"tool_jdmpview/#syntax","title":"Syntax","text":""},{"location":"tool_jdmpview/#starting-the-dump-viewer","title":"Starting the dump viewer","text":"

jdmpview [-J<vm option>] (-core <core file> | -zip <zip file>) [-notemp]

Input option Explanation -core <core file> Specifies a dump file. -zip <zip file> Specifies a compressed file containing the core file (produced by the dump extractor (jpackcore) tool on AIX\u00ae, Linux\u00ae, and macOS\u00ae systems). -notemp By default, when you specify a file by using the -zip option, the contents are extracted to a temporary directory before processing. Use the -notemp option to prevent this extraction step, and run all subsequent commands in memory. -J-Dcom.ibm.j9ddr.path.mapping=<mappings> The variable <mappings> is a list of native library mappings of the form old-path=new-path, using the usual path separator (a semi-colon (';') on Windows, and a colon (':') on other platforms). -J-Dcom.ibm.j9ddr.library.path=<path> The variable <path> is a list of paths to search for native libraries, using the usual path separator (a semi-colon (';') on Windows, and a colon (':') on other platforms).

Note: The -core option can be used with the -zip option to specify the core file in the compressed file. With these options, jdmpview shows multiple contexts, one for each source file that it identified in the compressed file.

Note: On AIX and Linux, some jdmpview commands must locate the executable and the native libraries that are referenced by the core. For example, commands that relate to call-sites. A common scenario involves using jdmpview to examine core files that originate on different systems. However, if the executable and the libraries are in their original locations, jdmpview might not consider them. Therefore, first check the executable and the list of native libraries by running jdmpview on a core with the info mod command.

On z/OS\u00ae, you can copy the dump to an HFS file and supply that as input to jdmpview, or you can supply a fully qualified MVS\u2122 data set name. For example:

> jdmpview -core USER1.JVM.TDUMP.SSHD6.D070430.T092211\nDTFJView version 4.29.5, using DTFJ version 1.12.29003\nLoading image from DTFJ...\n

MVS data set names may contain the dollar sign ($). Names that contain a dollar sign must be enclosed by single quotation marks ('). For example:

> jdmpview -core 'USER1.JVM.$TDUMP.SSH$D7.D141211.T045506'\n

After jdmpview processes the dump files, a session starts, showing this message:

For a list of commands, type \"help\"; for how to use \"help\", type \"help help\"\n>\n

If you run the jdmpview tool on a compressed file that contains multiple dumps, the tool detects and shows all the dump files, whether these are system dumps, Java dumps, or heap dumps. Because of this behavior, more than one context might be displayed when you start jdmpview. To switch context, type context <n>, where <n> is the context value for the dump you want to investigate.

On z/OS, a system dump can contain multiple address spaces and an address space can contain multiple VM instances. In this case, the context allows you to select the address space and VM instance within the dump file. The following z/OS example shows address spaces (ASID), with two JVMs occupying address space 0x73 (context 5 and 6). The current context is 5 (CTX:5>), shown with an asterisk. To view the JVM in context 6, you can switch by specifying context 6.

CTX:5> context\nAvailable contexts (* = currently selected context) :\n\n0 : ASID: 0x1 : No JRE : No JRE\n1 : ASID: 0x3 : No JRE : No JRE\n2 : ASID: 0x4 : No JRE : No JRE\n3 : ASID: 0x6 : No JRE : No JRE\n4 : ASID: 0x7 : No JRE : No JRE\n*5 : ASID: 0x73 EDB: 0x83d2053a0 : JRE 1.8.0 z/OS s390x-64 build 20181117_128845 (pmz6480-20181120_01)\n6 : ASID: 0x73 EDB: 0x8004053a0 : JRE 1.8.0 z/OS s390x-64 build 20181117_128845 (pmz6480-20181120_01)\n7 : ASID: 0x73 EDB: 0x4a7bd9e8 : No JRE\n8 : ASID: 0xffff : No JRE : No JRE\n

If you are using jdmpview to view Java dumps and heap dumps, some options do not produce any output. For example, a heap dump doesn't contain the information requested by the info system command, but does contain information requested by the info class command.

If you are viewing a dump where there are a large number of objects on the heap, you can speed up the performance of jdmpview by ensuring that your system has enough memory available and does not need to page memory to disk. To achieve this, start jdmpview with a larger heap size by specifying the -Xmx option. Use the -J option to pass the -Xmx command line option to the JVM. For example:

jdmpview -J-Xmx<n> -core <core file>\n

The options available to the dump viewer session are shown under Session parameters

"},{"location":"tool_jdmpview/#starting-in-batch-mode","title":"Starting in batch mode","text":"

For long running or routine jobs, jdmpview can be used in batch mode.

You can run a single command without specifying a command file by appending the command to the end of the jdmpview command line. For example:

jdmpview -core mycore.dmp info class\n

When specifying jdmpview commands that accept a wildcard parameter, you must replace the wildcard symbol with ALL to prevent the shell interpreting the wildcard symbol. For example, in interactive mode, the command info thread * must be specified in the following way:

jdmpview -core mycore.dmp info thread ALL\n

Batch mode is controlled with the following command line options:

Option Explanation -cmdfile <path to command file> A file that contains a series of jdmpview commands, which are read and run sequentially. -charset <character set name> The character set for the commands specified in -cmdfile (name must be a supported charset as defined in java.nio.charset.Charset. For example, US-ASCII) -outfile <path to output file> The file to record any output generated by commands. -overwrite If the file specified in -outfile exists, this option overwrites the file. -append If the file specified in -outfile exists, new output messages are appended to the end of that file. The -append and -overwrite options cannot be used at the same time.

The command file can have empty lines that contain spaces, or comment lines that start with // or #. These lines are ignored by jdmpview. Example command file:

// commands.txt\ninfo system\ninfo proc\n

To run jdmpview in batch mode, using this command file, specify:

jdmpview -outfile out.txt [-overwrite|-append] -cmdfile commands.txt -core <path to core file>\n

When the output file exists, you need to specify either the -overwrite option or the -append option. If you do not, an error message is generated.

"},{"location":"tool_jdmpview/#processing-output","title":"Processing output","text":"

You can redirect command output to a file, or pipe the command output to another command.

To redirect jdmpview command output to a file, use one of the following formats:

command > <target_file>\n

If the target file exists, this redirection overwrites the content within it.

command >> <target_file>\n

If the target file exists, this redirection appends the output to it.

Where <target_file> is the file name, which can include the full path to the file.

To pipe jdmpview command output to another command, use the vertical bar (|) character. For example:

command | grep string\n

You can chain more than two commands together by using multiple vertical bar characters.

The following commands can be used to interrogate the output:

"},{"location":"tool_jdmpview/#using-charsfrom","title":"Using CharsFrom","text":"

Use the charsFrom command after the vertical bar character to exclude all characters that come before a specified pattern in a resulting line.

charsFrom <options> pattern\n

Where <options>:

For example, the following command displays resulting lines that contain the pattern jre, and trims each line to exclude all characters that come before this pattern:

> info mod | charsFrom jre\njre/lib/ppc64/libzip.so @ 0x0, sections:\njre/lib/ppc64/libdbgwrapper80.so @ 0x0, sections:\njre/lib/ppc64/libverify.so @ 0x0, sections:\njre/lib/ppc64/libjava.so @ 0x0, sections:\njre/lib/ppc64/compressedrefs/libjclse7b_28.so @ 0x0, sections:\n
"},{"location":"tool_jdmpview/#using-charsto","title":"Using CharsTo","text":"

Use the CharsTo command after the vertical bar character to include the characters in a resulting line until a specific pattern is found.

charsTo <options> pattern\n

Where <options>:

For example, the following command displays lines that contain the pattern @, and trims each line to exclude all characters from @ onwards:

> info mod | charsTo @\nbin/java\n/usr/lib64/gconv/UTF-16.so\n/test/sdk/lib/ppc64le/libnet.so\n/test/sdk/lib/ppc64le/libnio.so\n/test/sdk/lib/ppc64le/libzip.so\n/test/sdk/lib/ppc64le/libjsig.so\nlibjsig.so\n

You can also use charsFrom and charsTo together, separated by a vertical bar character. For example, the following command displays lines that contain the pattern lib, and trims each line to exclude all characters that come before this pattern, as well as all characters from the pattern @ :

> info mod | charsFrom lib | charsTo @\nlib/ppc64le/libzip.so\nlib/ppc64le/libjsig.so\nlib/ppc64le/libverify.so\nlib/ppc64le/libjava.so\nlib/ppc64le/compressedrefs/libj9jit29.so\n

Note: The line will not be displayed if the charsFrom and charsTo are used together, but only one of the patterns are matched in a line. Furthermore, the line will not be displayed if both patterns are matched in a line, but the charsTo pattern appears before, and not after, the charsFrom pattern.

"},{"location":"tool_jdmpview/#using-grep","title":"Using grep","text":"

Use the grep command after the vertical bar character to show which lines match a specified pattern.

grep <options> pattern\n

Where <options>:

Pattern rules:

In the following example, the command displays the number of instances and total heap size for the java/lang/String class:

> info class | grep java/lang/String\n94 7688 [Ljava/lang/String;\n1822 58304 java/lang/String               \n1 16 java/lang/String$CaseInsensitiveComparator              \n0 0 java/lang/String$UnsafeHelpers\n

In the following example, the command uses two pipes in combination to display the number of instances and total heap size for the java/lang/StringCoding.StringDecoder class:

> info class | grep java/lang/String | grep -i decoder\n1 48 java/lang/StringCoding$StringDecoder\n
"},{"location":"tool_jdmpview/#using-tokens","title":"Using tokens","text":"

Use the tokens command after the vertical bar character to isolate specified tokens in the resulting lines.

tokens [options] range[,range][..range]\n

You can define range in the following formats:

A set of rules applies to these formats:

In this format, if x is omitted, it is assumed to be 1. If y is omitted, it is assumed to be -1.

For example, the following command displays the first and second token for each resulting line:

> info mmap | grep -r ^0x | tokens 1,2\n0x0000000000012fff 0x000000000000d000\n0x0000000000017fff 0x0000000000004000\n0x00000000009dafff 0x0000000000018000\n0x00000000009fffff 0x000000000001f000\n0x0000000000cbefff 0x0000000000002000\n0x0000000000d76fff 0x0000000000001000\n0x0000000003145fff 0x0000000000071000\n0x0000000003b93fff 0x0000000000003000\n
"},{"location":"tool_jdmpview/#session-parameters","title":"Session parameters","text":"

When jdmpview is started, many parameters can be used during the session to interrogate the system dump data, which are divided into general and expert parameters. The general parameters are documented in this section. To see a list of expert parameters, use the !j9help option.

"},{"location":"tool_jdmpview/#j9help","title":"!j9help","text":"
    !j9help\n
Lists all expert parameters that can be used in a session, with a brief description.

Note: The expert parameters are subject to change and not intended as a supported interface.

"},{"location":"tool_jdmpview/#cd","title":"cd","text":"
    cd <directory_name>\n
Changes the working directory to <directory_name>. The working directory is used for log files. Logging is controlled by the set logging command. Use the pwd command to query the current working directory."},{"location":"tool_jdmpview/#cmdfile","title":"cmdfile","text":"
    cmdfile <directory_name>\n
Runs all of the commands in a file. The commands are read line by line and run sequentially. Empty lines, and lines that start with // or #, are ignored. Use the option charset to identify the character set that is used in the chosen file. The character set must be supported, as defined in java.nio.charset.Charset, such as US-ASCII."},{"location":"tool_jdmpview/#deadlock","title":"deadlock","text":"

This command detects deadlock situations in the Java application that was running when the system dump was produced. Example output:

deadlock loop:\nthread: Thread-2 (monitor object: 0x9e32c8) waiting for =>\nthread: Thread-3 (monitor object: 0x9e3300) waiting for =>\nthread: Thread-2 (monitor object: 0x9e32c8)\n

In this example, the deadlock analysis shows that Thread-2 is waiting for a lock held by Thread-3, which is in turn waiting for a lock held earlier by Thread-2.

Threads are identified by their Java thread name, whereas object monitors are identified by the address of the object in the Java heap. You can obtain further information about the threads using the info thread * command. You can obtain further information about the monitors using the x/J <0xaddr> command.

"},{"location":"tool_jdmpview/#find","title":"find","text":"
    find <pattern>,<start_address>,<end_address>,<memory_boundary>, <bytes_to_print>,<matches_to_display>\n

This command searches for <pattern> in the memory segment from <start_address> to <end_address> (both inclusive), and shows the number of matching addresses you specify with <matches_to_display>. You can also display the next <bytes_to_print> bytes for the last match.

By default, the find command searches for the pattern at every byte in the range. If you know the pattern is aligned to a particular byte boundary, you can specify <memory_boundary> to search every <memory_boundary> bytes. For example, if you specify a <memory_boundary> of \"4\", the command searches for the pattern every 4 bytes.

"},{"location":"tool_jdmpview/#findnext","title":"findnext","text":"Finds the next instance of the last string passed to find or findptr. It repeats the previous find or findptr command, depending on which one was issued last, starting from the last match."},{"location":"tool_jdmpview/#findptr","title":"findptr","text":"
    findptr <pattern>,<start_address>,<end_address>,<memory_boundary>,<bytes_to_print>,<matches_to_display>\n

Searches memory for the given pointer. findptr searches for <pattern> as a pointer in the memory segment from <start_address> to <end_address> (both inclusive), and shows the number of matching addresses you specify with <matches_to_display>. You can also display the next <bytes_to_print> bytes for the last match.

By default, the findptr command searches for the pattern at every byte in the range. If you know the pattern is aligned to a particular byte boundary, you can specify <memory_boundary> to search every <memory_boundary> bytes. For example, if you specify a <memory_boundary> of \"4\", the command searches for the pattern every 4 bytes.

"},{"location":"tool_jdmpview/#help","title":"help","text":"
    help [<command_name>]\n
Shows information for a specific command. If you supply no parameters, help shows the complete list of supported commands."},{"location":"tool_jdmpview/#history","title":"history","text":"
    history|his [-r][<N>]\n
Recalls and displays the history of commands that you have run. The default behavior is to display the 20 most recent commands. If you use the argument <N>, then N commands are displayed. For example, if you run history 35, then the 35 most recent commands are displayed. You can also use the -r option with <N> to run the Nth most recent command in your history. Using the -r option alone runs the most recent command in your history."},{"location":"tool_jdmpview/#info-thread","title":"info thread","text":"
    info thread [*|all|<native_thread_ID>|<zos_TCB_address>]\n

Displays information about Java and native threads. The following information is displayed for all threads (\"*\"), or the specified thread:

If you supply no parameters, the command shows information about the current thread.

"},{"location":"tool_jdmpview/#info-system","title":"info system","text":"

Displays the following information about the system that produced the core dump:

"},{"location":"tool_jdmpview/#info-class","title":"info class","text":"
    info class [<class_name>] [-sort:<name>|<count>|<size>]\n
Displays the inheritance chain and other data for a given class.

If a class name is passed to info class, the following information is shown about that class:

If no parameters are passed to info class, the following information is shown:

The sort option allows the list of classes to be sorted by name (default), by number of instances of each class, or by the total size of instances of each class.

"},{"location":"tool_jdmpview/#info-proc","title":"info proc","text":"

Displays threads, command-line arguments, environment variables, and shared modules of the current process.

To view the shared modules used by a process, use the info sym command.

"},{"location":"tool_jdmpview/#info-jitm","title":"info jitm","text":"

Displays JIT compiled methods and their addresses:

"},{"location":"tool_jdmpview/#info-lock","title":"info lock","text":"Displays a list of available monitors and locked objects."},{"location":"tool_jdmpview/#info-sym","title":"info sym","text":"Displays a list of available modules. For each process in the address spaces, this command shows a list of module sections for each module, their start and end addresses, names, and sizes."},{"location":"tool_jdmpview/#info-mmap","title":"info mmap","text":"
    info mmap [<address>] [-verbose] [-sort:<size>|<address>]\n
Displays a summary list of memory sections in the process address space, with start and end address, size, and properties. If an address parameter is specified, the results show details of only the memory section containing the address. If -verbose is specified, full details of the properties of each memory section are displayed. The -sort option allows the list of memory sections to be sorted by size or by start address (default)."},{"location":"tool_jdmpview/#info-mod","title":"info mod","text":"Displays a list of native library modules in the process address space, which includes file paths and other information about each module."},{"location":"tool_jdmpview/#info-heap","title":"info heap","text":"
    info heap [*|<heap_name>*]\n

If no parameters are passed to this command, the heap names and heap sections are shown.

Using either \"*\" or a heap name shows the following information about all heaps or the specified heap:

"},{"location":"tool_jdmpview/#heapdump","title":"heapdump","text":"
    heapdump [<heaps>]\n
Generates a Java heap dump to a file. You can select which Java heaps to dump by listing the heap names, separated by spaces. To see which heaps are available, use the info heap command. By default, all Java heaps are dumped."},{"location":"tool_jdmpview/#hexdump","title":"hexdump","text":"
    hexdump <hex_address> <bytes_to_print>\n
Displays a section of memory in a hexdump-like format. Displays <bytes_to_print> bytes of memory contents starting from <hex_address>."},{"location":"tool_jdmpview/#_1","title":"+","text":"Displays the next section of memory in hexdump-like format. This command is used with the hexdump command to enable easy scrolling forwards through memory. The previous hexdump command is repeated, starting from the end of the previous one."},{"location":"tool_jdmpview/#-","title":"-","text":"Displays the previous section of memory in hexdump-like format. This command is used with the hexdump command to enable easy scrolling backwards through memory. The previous hexdump command is repeated, starting from a position before the previous one."},{"location":"tool_jdmpview/#pwd","title":"pwd","text":"Displays the current working directory, which is the directory where log files are stored."},{"location":"tool_jdmpview/#quit","title":"quit","text":"Exits the core file viewing tool; any log files that are currently open are closed before exit."},{"location":"tool_jdmpview/#set-heapdump","title":"set heapdump","text":"Configures Heapdump generation settings.
set heapdump <options>\n

where <options> are:

"},{"location":"tool_jdmpview/#set-logging","title":"set logging","text":"
    set logging <options>\n

Configures logging settings, starts logging, or stops logging. This parameter enables the results of commands to be logged to a file, where <options> are:

Redirect must be turned off before logging can be turned off. (Default: off)

"},{"location":"tool_jdmpview/#show-heapdump","title":"show heapdump","text":"
    show heapdump <options>\n
Displays the current heap dump generation settings."},{"location":"tool_jdmpview/#show-logging","title":"show logging","text":"
    show logging <options>\n

Displays the current logging settings:

The file that is currently being logged to might be different from set_logging_file, if that value was changed after logging was started.

"},{"location":"tool_jdmpview/#whatis-hex_address","title":"whatis <hex_address>","text":"Displays information about whatis stored at the given memory address, <hex_address>. This command examines the memory location at <hex_address> and tries to find out more information about this address. For example:
> whatis 0x8e76a8\n\nheap #1 - name: Default@19fce8\n0x8e76a8 is within heap segment: 8b0000 -- cb0000\n0x8e76a8 is start of an object of type java/lang/Thread\n
"},{"location":"tool_jdmpview/#x-examine","title":"x/ (examine)","text":"

Passes the number of items to display and the unit size, as listed in the following table, to the sub-command. For example, x/12bd.

Abbreviation Unit Size b Byte 8-bit h Half word 16-bit w Word 32-bit g Giant word 64-bit

This command is similar to the use of the x/ command in gdb, including the use of defaults.

"},{"location":"tool_jdmpview/#xj-class_name0xaddr","title":"x/J [<class_name>|<0xaddr>]","text":"

Displays information about a particular object, or all objects of a class. If <class_name> is supplied, all static fields with their values are shown, followed by all objects of that class with their fields and values. If an object address (in hex) is supplied, static fields for that object's class are not shown; the other fields and values of that object are printed along with its address.

Note: This command ignores the number of items and unit size passed to it by the x/ command.

"},{"location":"tool_jdmpview/#xd-0xaddr","title":"x/D <0xaddr>","text":"

Displays the integer at the specified address, adjusted for the hardware architecture this dump file is from. For example, the file might be from a big-endian architecture.

This command uses the number of items and unit size passed to it by the x/ command.

"},{"location":"tool_jdmpview/#xx-0xaddr","title":"x/X <0xaddr>","text":"

Displays the hex value of the bytes at the specified address, adjusted for the hardware architecture this dump file is from. For example, the file might be from a big-endian architecture.

Note: This command uses the number of items and unit size passed to it by the x/ command.

"},{"location":"tool_jdmpview/#xk-0xaddr","title":"x/K <0xaddr>","text":"

Where the size is defined by the pointer size of the architecture, this parameter shows the value of each section of memory. The output is adjusted for the hardware architecture this dump file is from, starting at the specified address. It also displays a module with a module section and an offset from the start of that module section in memory if the pointer points to that module section. If no symbol is found, it displays a \"*\" and an offset from the current address if the pointer points to an address in 4KB (4096 bytes) of the current address. Although this command can work on an arbitrary section of memory, it is probably more useful on a section of memory that refers to a stack frame. To find the memory section of a thread stack frame, use the info thread command.

Note: This command uses the number of items and unit size passed to it by the x/ command.

"},{"location":"tool_jdmpview/#example","title":"Example","text":"

This example session illustrates a selection of the commands available and their use.

In the example session, which is generated on a Linux system, some lines have been removed for clarity (and terseness).

User input is prefaced by a greater than symbol (>).

    test@madras:~/test> sdk/bin/jdmpview -core core.20121116.154147.16838.0001.dmp\n    DTFJView version 4.29.5, using DTFJ version 1.12.29003\n    Loading image from DTFJ...\n\n    For a list of commands, type \"help\"; for how to use \"help\", type \"help help\"\n    Available contexts (* = currently selected context) :\n\n    Source : file:///home/test/core.20121116.154147.16838.0001.dmp\n            *0 : PID: 16867 : JRE 1.8.0 Linux ppc64-64 build 20121115_128521 (pxp6480-20121116_01 )\n\n    > help\n    +                                              displays the next section of memory in hexdump-like format\n    -                                              displays the previous section of memory in hexdump-like format\n    cd                                             changes the current working directory, used for log files\n    close                     [context id]         closes the connection to a core file\n    context                   [ID|asid ID]         switch to the selected context\n    deadlock                                       displays information about deadlocks if there are any\n    exit                                           Exit the application\n    find                                           searches memory for a given string\n    findnext                                       finds the next instance of the last string passed to \"find\"\n    findptr                                        searches memory for the given pointer\n    heapdump                                       generates a PHD or classic format heapdump\n    help                      [command name]       displays list of commands or help for a specific command\n    hexdump                                        outputs a section of memory in a hexdump-like format\n    info                      <component>          Information about the specified component\n    info class                <Java class name>    Provides information about the specified Java class\n    info heap                 [*|heap name]        Displays information about Java heaps\n    info jitm                                      Displays JIT'ed methods and their addresses\n    info lock                                      outputs a list of system monitors and locked objects\n    info mmap                                      Outputs a list of all memory segments in the address space\n    info mod                                       outputs module information\n    info proc                                      shortened form of info process\n    info process                                   displays threads, command line arguments, environment\n    info sym                                       an alias for 'mod'\n    info sys                                       shortened form of info system\n    info system                                    displays information about the system the core dump is from\n    info thread                                    displays information about Java and native threads\n    log                       [name level]         display and control instances of java.util.logging.Logger\n    open                      [path to core or zip] opens the specified core or zip file\n    plugins                                        Plugin management commands\n                         list                      Show the list of loaded plug-ins for the current context\n                       reload                      Reload plug-ins for the current context\n                     showpath                      Show the DTFJ View plug-in search path for the current context\n                      setpath                      Set the DTFJ View plug-in search path for the current context\n    pwd                                            displays the current working directory\n    quit                                           Exit the application\n    set                       [logging|heapdump]   Sets options for the specified command\n    set heapdump                                   configures heapdump format, filename and multiple heap support\n    set logging                                    configures several logging-related parameters, starts/stops logging\n                           on                      turn on logging\n                          off                      turn off logging\n                         file                      turn on logging\n                    overwrite                      controls the overwriting of log files\n    show                      [logging|heapdump]   Displays the current set options for a command\n    show heapdump                                  displays heapdump settings\n    show logging                                   shows the current logging options\n    whatis                    [hex address]        gives information about what is stored at the given memory address\n    x/d                       <hex address>        displays the integer at the specified address\n    x/j                       <object address> [class name] displays information about a particular object or all objects of a class\n    x/k                       <hex address>        displays the specified memory section as if it were a stack frame parameters\n    x/x                       <hex address>        displays the hex value of the bytes at the specified address\n\n    > set logging file log.txt\n    logging turned on; outputting to \"/home/test/log.txt\"\n\n    > info system\n    Machine OS:     Linux\n    Hypervisor:     PowerVM\n    Machine name:   madras\n    Machine IP address(es):\n                    9.20.88.155\n    System memory:  8269201408\n\n    Dump creation time: 2015/08/10 14:44:36:019\n    Dump creation time (nanoseconds): 21314421467539\n\n    Java version:\n    JRE 1.8.0 Linux ppc64-64 build 20121115_128521 (pxp6490-20121116_01)\n\n    JVM start time: 2015/08/10 14:44:05:690\n    JVM start time (nanoseconds): 21284086192267\n\n    > info thread *\n    native threads for address space\n     process id: 16838\n\n      thread id: 16839\n       registers:\n\n       native stack sections:\n       native stack frames:\n       properties:\n       associated Java thread:\n        name:          main\n        Thread object: java/lang/Thread @ 0x2ffd1e08\n        Priority:      5\n        Thread.State:  RUNNABLE\n        JVMTI state:   ALIVE RUNNABLE\n        Java stack frames:\n         bp: 0x0000000000085b28  method: void com/ibm/jvm/Dump.SystemDumpImpl()  (Native Method)\n          objects: <no objects in this frame>\n         bp: 0x0000000000085b40  method: void com/ibm/jvm/Dump.SystemDump()  source: Dump.java:41\n          objects: <no objects in this frame>\n         bp: 0x0000000000085b68  method: void mySystemDump.main(String[])  source: mySystemDump.java:29\n          objects: <no objects in this frame>\n    ===Lines Removed===\n\n        name:          GC Worker\n        id:            16860\n        Thread object: java/lang/Thread @ 0x3001b980\n        Priority:      5\n        Thread.State:  WAITING\n        JVMTI state:   ALIVE WAITING WAITING_INDEFINITELY IN_OBJECT_WAIT\n          waiting to be notified on: \"MM_ParallelDispatcher::workerThread\" with ID 0x1004cbc8 owner name: <unowned>\n        Java stack frames: <no frames to print>\n\n        name:          GC Worker\n        id:            16861\n        Thread object: java/lang/Thread @ 0x3001c180\n        Priority:      5\n        Thread.State:  WAITING\n        JVMTI state:   ALIVE WAITING WAITING_INDEFINITELY IN_OBJECT_WAIT\n          waiting to be notified on: \"MM_ParallelDispatcher::workerThread\" with ID 0x1004cbc8 owner name: <unowned>\n        Java stack frames: <no frames to print>\n\n        name:          Signal Dispatcher\n        id:            16847\n        Thread object: com/ibm/misc/SignalDispatcher @ 0x3000f268\n        Priority:      5\n        Thread.State:  RUNNABLE\n        JVMTI state:   ALIVE RUNNABLE\n        Java stack frames:\n         bp: 0x00000000000df748  method: int com/ibm/misc/SignalDispatcher.waitForSignal()  (Native Method)\n          objects: <no objects in this frame>\n         bp: 0x00000000000df788  method: void com/ibm/misc/SignalDispatcher.run()  source: SignalDispatcher.java:54\n          objects: 0x30015828 0x30015828\n    ===Lines Removed===\n\n\n    > info heap *\n\n             Heap #1:  Generational@fff78303d30\n              Section #1:  Heap extent at 0x100d0000 (0x300000 bytes)\n               Size:        3145728 bytes\n               Shared:      false\n               Executable:  false\n               Read Only:   false\n              Section #2:  Heap extent at 0x2ffd0000 (0x80000 bytes)\n               Size:        524288 bytes\n               Shared:      false\n               Executable:  false\n               Read Only:   false\n              Section #3:  Heap extent at 0x30050000 (0x80000 bytes)\n               Size:        524288 bytes\n               Shared:      false\n               Executable:  false\n               Read Only:   false\n\n    > info class java/lang/String\n    name = java/lang/String\n\n            ID = 0x37c00    superID = 0x30300\n            classLoader = 0x2ffe9b58    modifiers: public final\n\n            number of instances:     2146\n            total size of instances: 51504 bytes\n\n    Inheritance chain....\n            java/lang/Object\n               java/lang/String\n\n    Fields......\n              static fields for \"java/lang/String\"\n                private static final long serialVersionUID = -6849794470754667710 (0xa0f0a4387a3bb342)\n                public static final java.util.Comparator CASE_INSENSITIVE_ORDER = <object> @ 0x2ffd0278\n                private static final char[] ascii = <object> @ 0x2ffd02c8\n                private static String[] stringArray = <object> @ 0x2ffd0298\n                private static final int stringArraySize = 10 (0xa)\n                static boolean enableCopy = false\n                private static int seed = -126504465 (0xfffffffff875b1ef)\n                private static char[] startCombiningAbove = <object> @ 0x100d0c40\n                private static char[] endCombiningAbove = <object> @ 0x100d0cc0\n                private static final char[] upperValues = <object> @ 0x100d0d40\n                private static final java.io.ObjectStreamField[] serialPersistentFields = <object> @ 0x2ffd0920\n\n              non-static fields for \"java/lang/String\"\n                private final char[] value\n                private final int offset\n                private final int count\n                private int hashCode\n                private int hashCode32\n\n    Methods......\n\n    Bytecode range(s): :  private static native int getSeed()\n    Bytecode range(s): fff76d8ce48 -- fff76d8ce5e:  public void <init>()\n    Bytecode range(s): fff76d8ce88 -- fff76d8cecd:  private void <init>(String, char)\n    Bytecode range(s): fff76d8cf10 -- fff76d8cf19:  public void <init>(byte[])\n    Bytecode range(s): fff76d8cf40 -- fff76d8cf4a:  public void <init>(byte[], int)\n    Bytecode range(s): fff76d8cf7c -- fff76d8cfb5:  public void <init>(byte[], int, int)\n    Bytecode range(s): fff76d8cff8 -- fff76d8d065:  public void <init>(byte[], int, int, int)\n    Bytecode range(s): fff76d8d0c4 -- fff76d8d10c:  public void <init>(byte[], int, int, String)\n    ===Lines Removed===\n\n    > whatis  0x2ffd0298\n            heap #1 - name: Generational@fff78303d30\n                    0x2ffd0298 is within heap segment: 2ffd0000 -- 30050000\n                    0x2ffd0298 is the start of an object of type [Ljava/lang/String;\n
"},{"location":"tool_jextract/","title":"Dump extractor","text":""},{"location":"tool_jextract/#dump-extractor-jpackcore","title":"Dump extractor (jpackcore)","text":"

(AIX\u00ae, Linux\u00ae, macOS\u00ae)

On some operating systems, copies of executable files and libraries are required for a full analysis of a core dump (you can get some information from the dump without these files, but not as much). Run the jpackcore utility to collect these extra files and package them into an archive file along with the core dump. To analyze the output, use the dump viewer (jdmpview).

Note: This tool replaces OpenJ9 jextract, which is deprecated in Eclipse OpenJ9\u2122 version 0.26.0.

The OpenJ9 jextract tool is removed from Java 21 and later.

"},{"location":"tool_jextract/#syntax","title":"Syntax","text":"
jpackcore [-r] [-x] <core file name> [<zip_file>]\n

where:

Restriction: You should run jpackcore on the same system that produced the system dump in order to collect the correct executables and libraries referenced in the system dump. You should also run jpackcore using the same VM level, to avoid any problems. From Eclipse OpenJ9 V0.24.0, the utility always checks that the build ID of the SDK that created the dump file matches the jpackcore build ID. Where these IDs do not match, the following exception is thrown:

J9RAS.buildID is incorrect (found XXX, expecting YYY). This version of jpackcore is incompatible with this dump (use '-r' option to relax this check).\n

To continue, despite the mismatch, use the -r option.

"},{"location":"tool_jextract/#see-also","title":"See also","text":""},{"location":"tool_jmap/","title":"Java memory map (jmap) tool","text":""},{"location":"tool_jmap/#java-memory-map-jmap-tool","title":"Java memory map (jmap) tool","text":"

Use the jmap tool to get memory information for a particular Java\u2122 process, or list of processes. The tool shows statistics about classes on the heap, including the number of objects and their aggregate size. The command syntax is as follows:

jmap [<option>] [<vmid>]\n

<vmid> is the Attach API virtual machine identifier for the Java process. This ID is typically the same as the operating system process ID, unless you specified the -Dcom.ibm.tools.attach.id system property when you started the process.

VMID is shown in jps or other Attach API-based tools. Multiple VMIDs can be specified, separated by a space.

If you do not specify a VMID, the command reads input from stdin. You can therefore get information for all processes by piping the output of the jps command to jmap:

jps -q | jmap -histo

IDs of dead processes are silently ignored.

On its own, jmap prints help information. To obtain memory information, a -histo argument must be supplied, where the available <options> are as follows:

The output has the following format:

num   object count     total size    class name\n-------------------------------------------------\n  1           3354         107328    [C\n  2            717          57360    java.lang.Class\n  3           2427          38832    java.lang.String\n  4             50          13200    [J\n  5            717          11472    java.lang.J9VMInternals$ClassInitializationLock\n  6            342           8208    java.lang.StringBuilder\n  7            151           7248    jdk.internal.org.objectweb.asm.Item\n  8            396           6336    [Ljava.lang.Object;\n

Restrictions: This tool is not supported and is subject to change or removal in future releases. Although similar in usage and output to the HotSpot tool of the same name, this tool is a different implementation that is specific to Eclipse OpenJ9\u2122.

The following tool limitations apply:

The tool uses the Attach API, and has the following limitations:

For more information about the Attach API, including how to enable and secure it, see Java Attach API.

"},{"location":"tool_jps/","title":"Java process status (jps)","text":""},{"location":"tool_jps/#java-process-status-jps-tool","title":"Java process status (jps) tool","text":"

Use the jps tool to query running Java\u2122 processes. The tool shows information for every Java process that is owned by the current user ID on the current host. The command syntax is as follows:

jps [<options>]\n

where the available <options> are as follows:

The output has the following format:

<VMID> [[<class_name>|<jar_name>|\"Unknown\"] [<application_args>][<vm_args>]]\n

where VMID is the Attach API virtual machine identifier for the Java process. This ID is often, but not always, the same as the operating system process ID. One example where the ID might be different is if you specified the system property -Dcom.ibm.tools.attach.id when you started the process.

For example:

$ jps -l\n5462  org.foo.bar.MyApplication\n14332 openj9.tools.attach.diagnostics.Jps\n\n$ jps -q\n5462\n14332\n

Restrictions: This tool is not supported and is subject to change or removal in future releases. Although similar in usage and output to the HotSpot tool of the same name, this tool is a different implementation that is specific to Eclipse OpenJ9\u2122.

The tool uses the Attach API, and has the following limitations:

For more information about the Attach API, including how to enable and secure it, see Java Attach API.

"},{"location":"tool_jstack/","title":"Java stack (jstack) tool","text":""},{"location":"tool_jstack/#java-stack-jstack-tool","title":"Java stack (jstack) tool","text":"

Use the jstack tool to obtain Java stack traces and thread information for processes. The tool is similar to the HotSpot tool of the same name; the Eclipse OpenJ9\u2122 version of jstack is an independent implementation, added for compatibility.

The command syntax is as follows:

jstack <options>* <pid>*\n

Where <pid>* is a list of process IDs. If none are supplied, the process IDs are read from stdin, which allows a user running a Bourne or equivalent shell to query all processes via jps -q | jstack. IDs of inactive processes are silently ignored. The output contains Java stacks and thread information of the specified processes (equivalent to the information provided in java.lang.management.ThreadInfo).

The values for <options>* are as follows:

Restrictions:

The tool uses the Attach API, and has the following limitations:

For more information about the Attach API, including how to enable and secure it, see Java Attach API.

"},{"location":"tool_jstat/","title":"Java statistics monitoring (jstat) tool","text":""},{"location":"tool_jstat/#java-statistics-monitoring-jstat-tool","title":"Java statistics monitoring (jstat) tool","text":"

Use the jstat tool to obtain Java Virtual Machine (JVM) statistics. The tool is similar to the HotSpot tool of the same name; the Eclipse OpenJ9\u2122 version of jstat is an independent implementation, added for compatibility.

The command syntax is as follows:

jstat [<option>] [<vmid>]\n

where vmid is the Attach API virtual machine identifier for the Java process. This ID is typically the same as the operating system process ID, unless you specified the -Dcom.ibm.tools.attach.id system property when you started the process.

VMID is shown in Java process status (jps) tool or other Attach API-based tools.

On its own, jstat prints help information. The values for <option> are as follows:

The output has the following format:

Class Loaded    Class Unloaded\n         860                 0\n

Restrictions:

The tool uses the Attach API, and has the following limitations:

For more information about the Attach API, including how to enable and secure it, see Java Attach API.

"},{"location":"tool_migration/","title":"Switching to OpenJ9","text":""},{"location":"tool_migration/#switching-to-eclipse-openj9","title":"Switching to Eclipse OpenJ9","text":"

Eclipse OpenJ9\u2122 provides the following tools, which might differ in behavior from the HotSpot equivalent.

Note: For information about HotSpot equivalences and differences for items other than tools, see New to Eclipse OpenJ9?

"},{"location":"tool_migration/#java-diagnostic-command-tool-jcmd","title":"Java diagnostic command tool (jcmd)","text":"

Runs diagnostic commands on a specified VM. The main difference from the HotSpot jcmd tool is that the following options are not currently supported:

"},{"location":"tool_migration/#java-memory-map-tool-jmap","title":"Java memory map tool (jmap)","text":"

Displays information about classes on the heap, including the number of objects and their aggregate size. The main differences from the HotSpot jmap tool are as follows:

For more information, see jmap.

"},{"location":"tool_migration/#java-process-status-jps","title":"Java process status (jps)","text":"

Displays information about running Java processes. The main differences from the HotSpot jps tool are as follows:

For more information, see Java process status.

"},{"location":"tool_migration/#java-stack-jstack-tool","title":"Java stack (jstack) tool","text":"

Displays information about Java stack traces and thread information for processes. The main differences from the HotSpot jstack tool are as follows:

For more information, see jstack.

"},{"location":"tool_migration/#java-statistics-monitoring-jstat-tool","title":"Java statistics monitoring (jstat) tool","text":"

Displays information about Java statistics for processes. The main difference from the HotSpot jstat tool is that this tool only provides the number of classes loaded and the number of class unloaded.

For more information, see jstat.

"},{"location":"tool_traceformat/","title":"Trace formatter","text":""},{"location":"tool_traceformat/#trace-formatter-traceformat","title":"Trace formatter (traceformat)","text":"

The trace formatter is a Java\u2122 program that converts binary trace point data in a trace file to a readable form. The formatter requires the TraceFormat.dat and J9TraceFormat.dat files, which contain the formatting templates. The formatter produces a file that contains header information about the VM that produced the binary trace file, a list of threads for which trace points were produced, and the formatted trace points with their time stamp, thread ID, trace point ID, and trace point data.

"},{"location":"tool_traceformat/#syntax","title":"Syntax","text":"

To use the trace formatter on a binary trace file type:

    traceformat <input_file>  [<output_file>] <parameters>\n

Where <input_file> is the name of the binary trace file to be formatted, and <output_file> is the name of the output file. If you do not specify an output file, the output file is called input_file.fmt.

The size of the heap that is needed to format the trace is directly proportional to the number of threads present in the trace file. For large numbers of threads the formatter might run out of memory, generating the error OutOfMemoryError. In this case, increase the heap size by using the -Xmx option.

"},{"location":"tool_traceformat/#parameters","title":"Parameters","text":"

The following <parameters> are available with the trace formatter:

Option Explanation -datfile=<file1.dat>[,<file2.dat>] A comma-separated list of trace formatting data files. By default, the following files are used:$JAVA_HOME/lib/J9TraceFormat.dat and $JAVA_HOME/lib/TraceFormat.dat -format_time=yes|no Specifies whether to format the time stamps into human readable form. The default is yes. -help Displays usage information. -indent Indents trace messages at each Entry trace point and outdents trace messages at each Exit trace point. The default is not to indent the messages. -summary Prints summary information to the screen without generating an output file. -threads=<thread id>[,<thread id>]... Filters the output for the given thread IDs only. thread id is the ID of the thread, which can be specified in decimal or hex (0x) format. Any number of thread IDs can be specified, separated by commas. -timezone=+|-HH:MM Specifies the offset from UTC, as positive or negative hours and minutes, to apply when formatting time stamps. -verbose Output detailed warning and error messages, and performance statistics."},{"location":"tool_traceformat/#examples","title":"Examples","text":"

The following example shows output from running the trace formatter command:

    C:\\test>traceformat sample.trc\n    Writing formatted trace output to file sample.trc.fmt\n    Processing 0.4921875Mb of binary trace data\n    Completed processing of 6983 tracepoints with 0 warnings and 0 errors\n

The formatted trace output looks similar to the following extract, which is truncated to show the key areas of information:

    Trace Summary\n\n    Service level:\n    JRE 1.8.0 Windows 7 amd64-64 build  (pwa6480sr2-20150624_06(SR2))\n\n    JVM startup options:\n    -Xoptionsfile=c:\\build\\pwa6480sr2-20150624\\sdk\\lib\\compressedrefs\\options.default\n    ....\n\n    Processor information:\n    Arch family:         AMD64\n    Processor Sub-type:  Opteron\n    Num Processors:      8\n    Word size:           64\n\n    Trace activation information::\n    FORMAT=c:\\build\\pwa6480sr2-20150624\\sdk\\lib;.\n    MAXIMAL=all{level1}\n    EXCEPTION=j9mm{gclogger}\n    MAXIMAL=all{level2}\n    output=sample\n\n    Trace file header:\n    JVM start time: 08:58:35.527000000\n    Generations:    1\n    Pointer size:   8\n\n    Active threads\n    ....\n    0x000000000f155f00  Attach API wait loop\n    0x000000000f18b200  Thread-1\n    0x000000000f190200  Thread-3\n\n\n     Trace Formatted Data\n\n    Time (UTC)          Thread ID          Tracepoint ID Type   Tracepoint Data\n    08:58:35.527291919 *0x000000000f010500 j9trc.0       Event  Trace engine initialized for VM = 0x3ad4d0\n    08:58:35.527349836  0x000000000f010500 j9prt.0       Event  Trace engine initialized for module j9port\n    08:58:35.527354040  0x000000000f010500 j9thr.0       Event  Trace engine initialized for module j9thr\n    08:58:35.529409621 *0x000000000f01eb00 j9trc.5       Event  Thread started VMthread = 0xf01eb00, name = (unnamed thread), nativeID = 0x24a798\n    ....\n    08:58:35.536134516  0x000000000f010500 j9vm.1        Entry >Create RAM class from ROM class 0x3cab680 in class loader 0x3042338\n    08:58:35.536136384  0x000000000f010500 j9vm.80       Event  ROM class 0x3cab680 is named java/lang/Object\n    08:58:35.536200373  0x000000000f010500 j9vm.2        Exit  <Created RAM class 0xf03ef00 from ROM class 0x3cab680\n
"},{"location":"version0.10/","title":"Version 0.10.0","text":""},{"location":"version0.10/#whats-new-in-version-0100","title":"What's new in version 0.10.0","text":"

The following new features and notable changes since v.0.9.0 are included in this release:

"},{"location":"version0.10/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.10/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.10.0 supports OpenJDK 11, which is available from the AdoptOpenJDK community at the following link:

OpenJDK 11 with Eclipse OpenJ9 is a long term support (LTS) release and supersedes OpenJDK 10 with Eclipse OpenJ9.

Although it is possible to build an OpenJDK v8 with the OpenJ9 0.10.0 release level, testing at the project is not complete and therefore support is not available.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments

"},{"location":"version0.10/#change-to-the-default-shared-classes-cache-size","title":"Change to the default shared classes cache size","text":"

For OpenJDK 8 builds, the default shared classes cache size is increased from 16 MB to 300 MB, with a \"soft\" maximum limit for the initial size of the cache set to 64 MB. Certain exceptions apply. For more information, see -Xshareclasses. The new default also applies to OpenJDK 11 builds.

"},{"location":"version0.10/#new-information-for-the-shared-classes-section-of-a-java-dump-file","title":"New information for the SHARED CLASSES section of a Java dump file","text":"

The value of the soft maximum size (-Xscmx) of the shared classes cache is now recorded in the SHARED CLASSES section of a Java dump file against the string 2SCLTEXTSMB. For example output, see Java dump.

"},{"location":"version0.10/#support-for-openjdk-hotspot-options","title":"Support for OpenJDK HotSpot options","text":"

For compatibility, the following OpenJDK HotSpot options are now supported by OpenJ9:

"},{"location":"version0.10/#new-jdk-11-features","title":"New JDK 11 features","text":"

The following features are supported by OpenJ9:

You can find the full list of features for JDK 11 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

"},{"location":"version0.10/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.9.0 and version 0.10.0 releases, see the Release notes.

"},{"location":"version0.11/","title":"Version 0.11.0","text":""},{"location":"version0.11/#whats-new-in-version-0110","title":"What's new in version 0.11.0","text":"

The following new features and notable changes since version 0.10.0 are included in this release:

"},{"location":"version0.11/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.11/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9 release 0.11.0 provides limited support for the macOS\u00ae platform on OpenJDK 11. Early builds of OpenJDK 11 with OpenJ9 on macOS are available at the AdoptOpenJDK project at the following link:

Support for macOS on OpenJDK 8 is coming soon.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments

"},{"location":"version0.11/#openssl-is-now-supported-for-improved-native-cryptographic-performance","title":"OpenSSL is now supported for improved native cryptographic performance","text":"

OpenSSL is a native open source cryptographic toolkit for Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols, which provides improved cryptographic performance compared to the in-built OpenJDK Java cryptographic implementation. The OpenSSL V1.1.x implementation is enabled by default and supported for the Digest, CBC, and GCM algorithms. Binaries obtained from AdoptOpenJDK include OpenSSL v1.1.x (see Note). For more information about tuning the OpenSSL implementation, see Performance tuning.

Note: Currently, OpenSSL is not bundled as part of the AdoptOpenJDK AIX binary due to an unresolved problem.

"},{"location":"version0.11/#changes-to-the-location-of-the-default-shared-cache-and-cache-snapshot-directory","title":"Changes to the location of the default shared cache and cache snapshot directory","text":"

To increase security, the default shared classes cache directory is changed on non-Windows platforms from /tmp/javasharedresources/ to the user's home directory, unless you specify -Xshareclasses:groupAccess. If you use the groupAccess suboption, the default directory is unchanged because some members of the group might not have access to the user home directory.

Note: For persistent caches, the shared classes cache directory cannot be on an NFS mount. If your user home directory is on an NFS mount, either move it or use the -Xshareclasses:cacheDir=<directory> suboption to specify a different directory for the cache.

In general, caches cannot be shared across different Java releases, so you cannot re-use a cache that was created by a previous level of Java 11; if you use the name and cacheDir suboptions to specify an existing cache, the VM attempts to delete the cache and create a new one. However, on Windows, the cache cannot be deleted if it is in use, in which case the VM continues to use the existing cache.

You can find and remove old caches or snapshots by using the following command-line options:

For persistent caches: - -Xshareclasses:cacheDir=/tmp/javasharedresources/,listAllCaches to find the cache - -Xshareclasses:cacheDir=/tmp/javasharedresources/,name=<cacheName>,destroy to remove the cache

For nonpersistent caches or snapshots: - -Xshareclasses:cacheDir=/tmp,listAllCaches to find the item - -Xshareclasses:cacheDir=/tmp,name=<snapshotName>,destroySnapshot to remove the item

"},{"location":"version0.11/#new-class-data-sharing-suboptions","title":"New class data sharing suboptions","text":"

-Xshareclasses:bootClassesOnly: disables caching of classes that are loaded by non-bootstrap class loaders. This suboption also enables the nonfatal suboption, which allows the VM to start even if there was an error creating the shared classes cache.

-Xshareclasses:fatal: prevents the VM from starting if there was an error creating the shared classes cache. You might want to enable this suboption when using the -Xshareclasses:bootClassesOnly suboption, to troubleshoot problems when creating the cache.

"},{"location":"version0.11/#container-awareness-in-the-openj9-vm-is-now-enabled-by-default","title":"Container awareness in the OpenJ9 VM is now enabled by default","text":"

When using container technology, applications are typically run on their own and do not need to compete for memory. If the VM detects that it is running in a container environment, and a memory limit for the container is set, the VM automatically adjusts the maximum default Java heap size.

In earlier releases, this behavior was enabled by setting the -XX:+UseContainerSupport option. This setting is now the default. For more information about the Java heap size set for a container, see -XX:[+|-]UseContainerSupport.

"},{"location":"version0.11/#pause-less-garbage-collection-mode-is-now-available-on-linux-x86-platforms","title":"Pause-less garbage collection mode is now available on Linux x86 platforms","text":"

Pause-less garbage collection mode is aimed at large heap, response-time sensitive applications. When enabled, the VM attempts to reduce GC pause times. In earlier releases, pause-less garbage collection mode (-Xgc:concurrentScavenge) was available only on IBM z14 hardware. This mode is now available on 64-bit x86 Linux platforms.

Restrictions:

"},{"location":"version0.11/#you-can-now-restrict-identity-hash-codes-to-non-negative-values","title":"You can now restrict identity hash codes to non-negative values","text":"

OpenJ9 allows both positive and negative identity hashcodes, which can be problematic if your program (incorrectly) assumes hashcodes can only be positive. However, you can now use the -XX:[+|-]PositiveIdentityHash option to limit identity hash codes to non-negative values.

"},{"location":"version0.11/#support-for-openjdk-hotspot-options","title":"Support for OpenJDK HotSpot options","text":"

For compatibility, the following OpenJDK HotSpot options are now supported by OpenJ9:

"},{"location":"version0.11/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.10.0 and version 0.11.0 releases, see the Release notes.

"},{"location":"version0.12/","title":"Version 0.12.0","text":""},{"location":"version0.12/#whats-new-in-version-012x","title":"What's new in version 0.12.x","text":""},{"location":"version0.12/#version-0120","title":"Version 0.12.0","text":"

The following new features and notable changes since version 0.11.0 are included in this release:

Warning: Following the release of OpenJ9 0.12.0, an intermittent problem was identified with OpenSSL V1.1.x acceleration of the cryptographic Digest algorithm. For more information about the issue, see #4530. You can turn off the Digest algorithm by setting the -Djdk.nativeDigest system property to false. A new release of OpenJ9 (0.12.1) is available that disables the Digest algorithm by default.

"},{"location":"version0.12/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.12/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9 release 0.12.0 provides support for OpenJDK 8 with OpenJ9 and OpenJDK 11 with OpenJ9. In this release support is extended to the 64-bit macOS\u00ae platform on OpenJDK with OpenJ9.

Builds for all platforms are available from the AdoptOpenJDK project at the following links:

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.12/#improved-flexibility-for-managing-the-size-of-the-jit-code-cache","title":"Improved flexibility for managing the size of the JIT code cache","text":"

The JIT code cache stores the native code of compiled Java\u2122 methods. By default, the size of the code cache is 256 MB for a 64-bit VM and 64 MB for a 31/32-bit VM. In earlier releases the size of the code cache could be increased from the default value by using the -Xcodecachetotal command line option. In this release the size can also be decreased by using this option, with a minimum size of 2 MB. The size of the JIT code cache also affects the size of the JIT data cache, which holds metadata about compiled methods. If you use the -Xcodecachetotal option to manage the size of the code cache, the size of the data cache is adjusted by the same proportion. For more information, see -Xcodecachetotal.

"},{"location":"version0.12/#idle-tuning-is-enabled-by-default-when-openj9-runs-in-a-docker-container","title":"Idle-tuning is enabled by default when OpenJ9 runs in a docker container","text":"

In an earlier release, a set of idle-tuning options were introduced to manage the footprint of the Java heap when the OpenJ9 VM is in an idle state. These options could be set manually on the command line. In this release, the following two options are enabled by default when OpenJ9 is running in a container:

By default, the VM must be idle for 180 seconds before the status is set to idle. To control the wait time before an idle state is set, use the -XX:IdleTuningMinIdleWaitTime option. To turn off idle detection, set the value to 0.

"},{"location":"version0.12/#changes-to-default-shared-classes-cache-directory-permissions-not-windows","title":"Changes to default shared classes cache directory permissions (not Windows)","text":"

If you do not use the cachDirPerm suboption to specify permissions for a shared classes cache directory, and the cache directory is not the /tmp/javasharedresources default, the following changes apply:

For more information, see -Xshareclasses.

"},{"location":"version0.12/#openssl-is-now-supported-for-improved-native-cryptographic-performance","title":"OpenSSL is now supported for improved native cryptographic performance","text":"

OpenSSL is a native open source cryptographic toolkit for Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols, which provides improved cryptographic performance compared to the in-built OpenJDK Java cryptographic implementation. The OpenSSL V1.1.x implementation is enabled by default and supported for the Digest, CBC, and GCM algorithms. Binaries obtained from AdoptOpenJDK include OpenSSL v1.1.x (see Note). For more information about tuning the OpenSSL implementation, see Performance tuning.

Note: OpenJDK 8 with OpenJ9 includes OpenSSL support since version 0.11.0. Currently, OpenSSL is not bundled as part of the AdoptOpenJDK AIX binaries due to an unresolved problem.

"},{"location":"version0.12/#improved-support-for-pause-less-garbage-collection","title":"Improved support for pause-less garbage collection","text":"

Concurrent scavenge mode is now supported on 64-bit Windows operating systems.

In Eclipse OpenJ9 version 0.11.0, support was added for -Xgc:concurrentScavenge on Linux x86-64 virtual machines that use compressed references. In this release, support is now available for Linux x86-64 large-heap virtual machines (non-compressed references).

For more information, see the -Xgc:concurrentScavenge option.

"},{"location":"version0.12/#rsa-algorithm-support-for-openssl","title":"RSA algorithm support for OpenSSL","text":"

OpenSSL v1.1 support for the RSA algorithm is added in this release, providing improved cryptographic performance. OpenSSL support is enabled by default. If you want to turn off support for the RSA algorithm, set the -Djdk.nativeRSA system property to false.

"},{"location":"version0.12/#ibm_java_options-is-deprecated","title":"IBM_JAVA_OPTIONS is deprecated","text":"

The VM environment variable IBM_JAVA_OPTIONS is deprecated and is replaced by OPENJ9_JAVA_OPTIONS. IBM_JAVA_OPTIONS will be removed in a future release. For more information about the use of this variable, see the general options in Environment variables.

"},{"location":"version0.12/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.11.0 and version 0.12.0 releases, see the Release notes.

"},{"location":"version0.12/#version-0121","title":"Version 0.12.1","text":"

The following change is implemented since version 0.12.0:

By default, OpenJ9 provides native cryptographic acceleration using OpenSSL version 1.1.x for the Digest, CBC, GCM, and RSA algorithms. Under certain circumstances acceleration of the Digest algorithm was found to cause a segmentation error. Cryptographic acceleration of the Digest algorithm is now turned off by default. The system property -Djdk.nativeDigest cannot be used to turn on support. This property is ignored by the VM.

"},{"location":"version0.12/#full-release-information_1","title":"Full release information","text":"

Release notes to describe the changes between Eclipse OpenJ9 version 0.12.0 and version 0.12.1 releases, can be found in the OpenJ9 GitHub repository.

"},{"location":"version0.13/","title":"Version 0.13.0","text":""},{"location":"version0.13/#whats-new-in-version-0130","title":"What's new in version 0.13.0","text":"

The following new features and notable changes since version 0.12.1 are included in this release:

"},{"location":"version0.13/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.13/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.13.0 supports OpenJDK 12, which is available from the AdoptOpenJDK community at the following link:

OpenJDK 12 with Eclipse OpenJ9 is not a long term support (LTS) release.

The latest builds of OpenJDK with OpenJ9 for Java 8 and 11 at the AdoptOpenJDK community are for Eclipse OpenJ9 release 0.12.0. Features mentioned in these release notes are not available in these builds. Although it might be possible to build an OpenJDK 8 or OpenJDK 11 with OpenJ9 0.13.0, testing at the project is not complete and therefore support for any of these features is not available.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.13/#support-for-openssl-102","title":"Support for OpenSSL 1.0.2","text":"

OpenSSL cryptographic support is extended to include OpenSSL 1.0.2 for the Digest, CBC, GCM, and RSA algorithms. Support is enabled by default. On Linux and AIX platforms, the OpenSSL libraries are expected to be available on the system path. For more information about cryptographic acceleration with OpenSSL, see Cryptographic operations.

In addition, support for the OpenSSL Digest algorithm is re-enabled in this release following the resolution of issue #4530.

Warning: Earlier versions of OpenJDK with OpenJ9 from the AdoptOpenJDK project bundle OpenSSL as part of the binary package. On Linux and AIX systems, OpenSSL is no longer bundled and the libraries are expected to be available on the system path.

"},{"location":"version0.13/#new-java-process-status-tool","title":"New Java process status tool","text":"

A Java process status tool (jps) is available for querying running Java processes. For more information, see Java process status.

"},{"location":"version0.13/#writing-a-java-dump-to-stdout-or-stderr","title":"Writing a Java dump to STDOUT or STDERR","text":"

You can now write a Java dump file to STDOUT or STDERR by using the -Xdump command-line option. See Writing to STDOUT/STDERR for details.

"},{"location":"version0.13/#better-diagnostic-information-for-linux-systems-that-implement-control-groups","title":"Better diagnostic information for Linux systems that implement control groups","text":"

If you use control groups (cgroups) to manage resources on Linux systems, information about CPU and memory limits is now recorded in a Java dump file. This information is particularly important for applications that run in Docker containers, because when resource limits are set inside a container, the Docker Engine relies on cgroups to enforce the settings. If you are getting a Java OutOfMemoryError error because a container limit has been set on the amount of memory available to an application and this allocation is not sufficient, you can diagnose this problem from the Java dump file. You can find the cgroup information in the ENVINFO section. For sample output, see Java dump (ENVINFO).

"},{"location":"version0.13/#improved-support-for-pause-less-garbage-collection","title":"Improved support for pause-less garbage collection","text":"

Concurrent scavenge mode is now supported on the following platforms:

For more information, see the -Xgc:concurrentScavenge option.

"},{"location":"version0.13/#new-jdk-12-features","title":"New JDK 12 features","text":"

The following feature is supported by OpenJ9:

The following feature is implemented in OpenJDK and available in any builds of OpenJDK 12 with OpenJ9:

You can find the full list of features for JDK 12 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

"},{"location":"version0.13/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.12.1 and version 0.13.0 releases, see the Release notes.

"},{"location":"version0.14/","title":"Version 0.14.0","text":""},{"location":"version0.14/#whats-new-in-version-014x","title":"What's new in version 0.14.x","text":""},{"location":"version0.14/#version-0140","title":"Version 0.14.0","text":"

The following new features and notable changes since version 0.13.0 are included in this release:

"},{"location":"version0.14/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.14/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.14.0 supports OpenJDK 8, 11, and 12. Binaries are available from the AdoptOpenJDK community at the following links:

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.14/#support-for-openssl-102","title":"Support for OpenSSL 1.0.2","text":"

OpenJ9 release 0.13.0 introduced support for OpenSSL 1.0.2 for Java 12. In this release, support is extended to Java 8 and Java 11. OpenSSL is enabled by default for the CBC, Digest, GCM, and RSA cryptographic algorithms. On Linux\u00ae and AIX\u00ae platforms, the OpenSSL libraries are expected to be available on the system path. For more information about cryptographic acceleration with OpenSSL, see Cryptographic operations.

Note: Support for the OpenSSL Digest algorithm on Java 8 and 11 is re-enabled in this release following the resolution of issue #4530.

Warning: Earlier versions of OpenJDK with OpenJ9 from the AdoptOpenJDK project bundle OpenSSL as part of the binary package. On Linux and AIX systems, OpenSSL is no longer bundled and the libraries are expected to be available on the system path.

"},{"location":"version0.14/#new-option-for-ignoring-or-reporting-unrecognized-xx-options","title":"New option for ignoring or reporting unrecognized -XX: options","text":"

By default, unrecognized -XX: command-line options are ignored, which prevents an application failing to start. You can now use -XX:-IgnoreUnrecognizedXXColonOptions to turn off this behavior, so that unrecognized -XX: options are reported instead. For more information, see -XX:[+|-]IgnoreUnrecognizedXXColonOptions.

"},{"location":"version0.14/#improved-support-for-pause-less-garbage-collection","title":"Improved support for pause-less garbage collection","text":"

Support for Concurrent scavenge mode is now extended to Linux on POWER\u00ae BE architectures. For more information, see -Xgc:concurrentScavenge.

"},{"location":"version0.14/#new-jstack-tool-for-obtaining-stack-traces-and-thread-information","title":"New jstack tool for obtaining stack traces and thread information","text":"

For compatibility with the reference implementation, OpenJ9 now includes an independent implementation of the jstack tool. To learn how to use the tool and about any differences compared to the HotSpot tool of the same name, see Java stack tool.

"},{"location":"version0.14/#new-jps-tool","title":"New jps tool","text":"

OpenJ9 release 0.13.0 introduced support for the jps tool for Java 12. In this release, support is added for Java 8 and 11. The jps tool can be used to query running Java processes. For more information, see Java process status.

"},{"location":"version0.14/#new-experimental-option-to-improve-the-performance-of-jvmti-watched-fields","title":"New experimental option to improve the performance of JVMTI watched fields","text":"

The -XX:[+|-]JITInlineWatches option is introduced in this release. When enabled, the option turns on experimental JIT operations that are intended to improve the performance of JVMTI watched fields. This option is currently supported only on x86 platforms (Windows\u00ae, macOS\u00ae, and Linux).

"},{"location":"version0.14/#new-option-to-prevent-a-network-query-being-used-to-determine-host-name-and-ip-address","title":"New option to prevent a network query being used to determine host name and IP address","text":"

By default, a network query is used to determine the host name and IP address for troubleshooting purposes. To avoid your program waiting to time out if a nameserver cannot be contacted, you can now prevent the query from being performed. For more information, see -XX:[+|-]ReadIPInfoForRAS.

"},{"location":"version0.14/#changes-to-the-shared-classes-cache-generation-number","title":"Changes to the shared classes cache generation number","text":"

On all platforms, the format of classes that are stored in the shared classes cache is changed, which causes the JVM to create a new shared classes cache, rather than re-creating or reusing an existing cache. To save space, all existing shared caches can be removed unless they are in use by an earlier release. For more information about destroying a shared classes cache, see -Xshareclasses.

"},{"location":"version0.14/#change-to-the-default-native-stack-size-on-64-bit-zos","title":"Change to the default native stack size on 64-bit z/OS","text":"

The default stack size for operating system threads on 64-bit z/OS is changed from 384 KB to the operating system minimum of 1 MB. For more information about this setting, see -Xmso.

"},{"location":"version0.14/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.13.0 and version 0.14.0 releases, see the Release notes.

"},{"location":"version0.14/#version-0142","title":"Version 0.14.2","text":"

The following new features and notable changes since version 0.14.0 are included in this release:

"},{"location":"version0.14/#features-and-changes_1","title":"Features and changes","text":""},{"location":"version0.14/#binaries-and-supported-environments_1","title":"Binaries and supported environments","text":"

OpenJ9 release 0.14.2 supports OpenJDK 8 and 11. Binaries are available from the AdoptOpenJDK community at the following links:

The Windows (MSI) installer for OpenJDK v8 (64-bit) can now be used to optionally install the IcedTea-Web package, which provides equivalent functionality to Java Web Start. For more information about the installer, see the AdoptOpenJDK Installation page. For more information about migrating to IcedTea-Web, read the AdoptOpenJDK Migration Guide.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.14/#support-for-openssl-101","title":"Support for OpenSSL 1.0.1","text":"

OpenSSL version 1.0.1 support is now enabled; Earlier releases supported only OpenSSL 1.0.2 and 1.1.x. On Linux\u00ae and AIX\u00ae platforms, the OpenSSL libraries are expected to be available on the system path. For more information about cryptographic acceleration with OpenSSL, see Cryptographic operations.

"},{"location":"version0.14/#openssl-digest-algorithm-disabled","title":"OpenSSL Digest algorithm disabled","text":"

Due to issue #5611, the Digest algorithm is disabled.

"},{"location":"version0.15/","title":"Version 0.15.1","text":""},{"location":"version0.15/#whats-new-in-version-0151","title":"What's new in version 0.15.1","text":"

The following new features and notable changes since version 0.14.0 are included in this release:

"},{"location":"version0.15/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.15/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 0.15.0 and 0.15.1 supports OpenJDK 8, 11, and 12.

Binaries are available from the AdoptOpenJDK community at the following links:

Note: The binaries at AdoptOpenJDK are labeled 0.15.1 due to a missing change.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.15/#performance-improvements-for-jvmti-watched-fields","title":"Performance improvements for JVMTI watched fields","text":"

OpenJ9 version 0.14.0 introduced the -XX:[+|-]JITInlineWatches option, which, when enabled, turned on experimental JIT operations to improve the performance of JVMTI watched fields. Following successful results, this option is now enabled by default. This option is now also supported on z/OS\u00ae and Linux for IBM Z\u00ae, in addition to x86 platforms (Windows\u00ae, macOS\u00ae, and Linux).

"},{"location":"version0.15/#support-for-pause-less-garbage-collection-on-ibm-z-systems","title":"Support for pause-less garbage collection on IBM Z systems","text":"

Support for Concurrent scavenge mode is now extended to Linux on IBM Z\u00ae systems and z/OS\u00ae. For more information, see -Xgc:concurrentScavenge.

"},{"location":"version0.15/#chacha20-algorithm-support-for-openssl","title":"ChaCha20 algorithm support for OpenSSL","text":"

The ChaCha20 and ChaCha20-Poly1305 algorithms can now use OpenSSL on Java 11. For more information, see -Djdk.nativeChaCha20.

"},{"location":"version0.15/#openssl-digest-algorithm-disabled","title":"OpenSSL Digest algorithm disabled","text":"

Due to issue #5611, the Digest algorithm is disabled. This algorithm was disabled for Java 8 and 11 in release 0.14.2, which did not support Java 12.

"},{"location":"version0.15/#support-for-openjdk-hotspot-options","title":"Support for OpenJDK HotSpot options","text":"

For compatibility, the -XX:OnOutOfMemoryError OpenJDK HotSpot option is now supported by OpenJ9.

"},{"location":"version0.15/#support-for-transparent-huge-pages-thp","title":"Support for Transparent Huge Pages (THP)","text":"

The VM now supports the allocation of huge pages on Linux when you use the madvise (/sys/kernel/mm/transparent_hugepage/enabled) setting. To enable this feature, set -XX:+TransparentHugePage on the command line when you start your application. This option is currently not enabled by default.

"},{"location":"version0.15/#support-for-low-overhead-heap-profiling","title":"Support for low-overhead heap profiling","text":"

JEP 331 provides a mechanism for sampling Java heap allocations with a low overhead via the JVM Tool Interface (JVMTI).

Restrictions: JEP 331 is implemented for OpenJ9 with the following limitations:

"},{"location":"version0.15/#new-java-memory-map-tool","title":"New Java memory map tool","text":"

The Java memory map (jmap) tool is similar to the HotSpot tool of the same name, and can be used to print statistics about classes on the heap, including the number of objects and their aggregate size. For usage information, see Java memory map (jmap) tool.

"},{"location":"version0.15/#automatically-setting-an-initial-heap-size","title":"Automatically setting an initial heap size","text":"

OpenJ9 can now learn and set an appropriate initial heap size for an application as an alternative to a user manually sizing and setting an -Xms value. The VM records the size of the heap when startup processing ends, writing this data to the shared classes cache. An average value is set over a few restarts, helping to ensure that the value used for the initial heap size is as accurate as possible. The heap size recorded is specific to the application command line, therefore a different hint is stored for every unique command line.

To turn on this behavior, set the -XX:+UseGCStartupHints option on the command line when you start your application.

"},{"location":"version0.15/#removal-of-xdiagnosticscollector-option","title":"Removal of -Xdiagnosticscollector option","text":"

This option was redundant and has now been removed. If you try to use this option on the command line, the VM outputs this error message:

JVMJ9VM007E Command-line option unrecognised: -Xdiagnosticscollector

"},{"location":"version0.15/#change-in-behaviour-of-xxidletuningcompactonidle","title":"Change in behaviour of -XX:IdleTuningCompactOnIdle","text":"

-XX:[+|-]IdleTuningCompactOnIdle is now no longer effective when -XX:+IdleTuningGcOnIdle is not specified.

"},{"location":"version0.15/#heuristics-for-compaction-during-idle-gc","title":"Heuristics for compaction during idle GC","text":"

OpenJ9 now automatically compacts the heap when certain triggers are met during idle garbage collection (GC). As a result of this change, -XX:[+|-]IdleTuningCompactOnIdle is deprecated.

"},{"location":"version0.15/#change-in-shared-classes-behavior-for-checking-timestamps-of-jar-or-zip-files","title":"Change in shared classes behavior for checking timestamps of jar or zip files","text":"

In earlier releases, the shared classes cache checks timestamps of jar or zip files every time a class is loaded and reloads a class if the timestamp has changed. This behavior is now changed; timestamps are checked only when zip or jar files are added to class loaders and used for the first time to look for a class, which can improve class-loading performance. If jar or zip files are updated after a class loader starts loading classes from them, an older version of the class might be loaded from the shared classes cache. To revert to the behavior of earlier releases, set the -Xshareclasses:checkURLTimestamps option on the command line when you start your application.

Note: Multiple -Xshareclasses: options are not combined, only the last one is used.

"},{"location":"version0.15/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.14.0 and version 0.15.1 releases, see the Release notes.

"},{"location":"version0.16/","title":"Version 0.16.0","text":""},{"location":"version0.16/#whats-new-in-version-0160","title":"What's new in version 0.16.0","text":"

The following new features and notable changes since version 0.15.1 are included in this release:

"},{"location":"version0.16/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.16/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.16.0 supports OpenJDK 13, which is available from the AdoptOpenJDK community at the following link:

OpenJDK 13 with Eclipse OpenJ9 is not a long term support (LTS) release.

The latest builds of OpenJDK with OpenJ9 for Java 8 and 11 at the AdoptOpenJDK community are for Eclipse OpenJ9 release 0.15.2. Features mentioned in these release notes are not available in these builds. Although it might be possible to build an OpenJDK 8 or OpenJDK 11 with OpenJ9 0.16.0, testing at the project is not complete and therefore support for any of these features is not available.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.16/#some-class-data-sharing-is-enabled-by-default","title":"Some class data sharing is enabled by default","text":"

Class data sharing is enabled by default for bootstrap classes, unless your application is running in a container. You can use the -Xshareclasses option to change the default behavior, including using -Xshareclasses:none to disable all class data sharing. For more information, see Introduction to class data sharing.

"},{"location":"version0.16/#automatic-setting-of-initial-heap-size-is-enabled-by-default","title":"Automatic setting of initial heap size is enabled by default","text":"

OpenJ9 version 0.15.1 introduced the -XX:[+|-]UseGCStartupHints option, which, when enabled, turned on the automatic learning and setting of an appropriate heap size for an application. This option is now enabled by default.

"},{"location":"version0.16/#option-to-share-vm-anonymous-classes","title":"Option to share VM anonymous classes","text":"

Prior to version 0.16.0, anonymous classes, those created by Unsafe.defineAnonymousClass, were not stored in the shared classes cache. They are now stored there by default, which means they are available for ahead-of-time (AOT) compilation, potentially improving startup performance. A new command, -XX:[+|-]ShareAnonymousClasses, is introduced that enables you to stop anonymous classes being stored in the shared classes cache.

"},{"location":"version0.16/#performance-improvements-for-jvmti-watched-fields-on-power-systems","title":"Performance improvements for JVMTI watched fields on Power Systems","text":"

OpenJ9 version 0.14.0 introduced the -XX:[+|-]JITInlineWatches option, which turns on JIT operations to improve the performance of JVMTI watched fields. This option, which was enabled by default in version 0.15.1, is now also supported on AIX\u00ae and Linux on Power Systems\u2122.

"},{"location":"version0.16/#linux-on-x86-support-for-transparent-huge-pages-thp","title":"Linux\u00ae on x86: Support for Transparent Huge Pages (THP)","text":"

When you use the madvise (/sys/kernel/mm/transparent_hugepage/enabled) setting on Linux on x86 systems, THP is now enabled by default. To disable this feature, set -XX:-TransparentHugePage on the command line when you start your application. The THP setting on other systems remains disabled by default when you use madvise, but can be enabled by setting -XX:+TransparentHugePage.

"},{"location":"version0.16/#new-jcmd-tool","title":"New jcmd tool","text":"

For compatibility with the reference implementation, OpenJ9 now includes an independent implementation of the jcmd tool for running diagnostic commands on a VM. For more information, see Java diagnostic command tool.

"},{"location":"version0.16/#changes-to-the-shared-classes-cache-generation-number","title":"Changes to the shared classes cache generation number","text":"

The format of classes that are stored in the shared classes cache is changed, which causes the JVM to create a new shared classes cache rather than re-creating or reusing an existing cache. To save space, you can remove all existing shared caches unless they are in use by an earlier release. As a result of the format change, a layer column now appears in the output of the -Xshareclasses:listAllCaches option. This change is to support a future enhancement.

For more information about the -Xshareclasses option, including the destroy options that you can use to remove caches, see -Xshareclasses.

"},{"location":"version0.16/#the-xverifynone-and-noverify-options-are-deprecated","title":"The -Xverify:none and -noverify options are deprecated","text":"

The option -Xverify:none (and its equivalent -noverify) is deprecated in Java 13. Both options might be removed in a future release. OpenJ9 issues a warning if these options are used in Java 13 and later versions.

"},{"location":"version0.16/#new-jdk-13-features","title":"New JDK 13 features","text":"

The following features are implemented in OpenJDK and available in any builds of OpenJDK 13 with OpenJ9:

You can find the full list of features for JDK 13 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

"},{"location":"version0.16/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.15.1 and version 0.16.0 releases, see the Release notes.

"},{"location":"version0.17/","title":"Version 0.17.0","text":""},{"location":"version0.17/#whats-new-in-version-0170","title":"What's new in version 0.17.0","text":"

The following new features and notable changes since version 0.16.0 are included in this release:

"},{"location":"version0.17/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.17/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.17.0 supports OpenJDK 8, 11, and 13. Binaries are available from the AdoptOpenJDK community at the following links:

Note: The Windows\u00ae and macOS\u00ae binaries from the AdoptOpenJDK community for OpenJDK 8, 11, and 13 have been updated to OpenSSL v1.1.1d. Look for the following release names to identify these packages:

Note: The last release of OpenJDK 8 and 11 from AdoptOpenJDK is Eclipse OpenJ9 0.15.1. To read about other features and changes in the VM since 0.15.1, check the Version 0.16.0 release notes too.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.17/#new-shared-classes-cache-suboptions-for-layered-caches","title":"New shared classes cache suboptions for layered caches","text":"

(Experimental, 64-bit only)

New suboptions are available for creating layered caches, where a cache builds on another cache with the same name. You can use these suboptions to save space when building a Docker container, for example.

Note: Because these suboptions are experimental, do not use them in a production environment.

The new options are:

"},{"location":"version0.17/#new-shared-classes-cache-suboption-to-skip-disk-space-check","title":"New shared classes cache suboption to skip disk space check","text":"

When creating a persistent shared classes cache, the OpenJ9 VM checks that there is sufficient disk space available on the file system. For file systems that do not support the checking of free space, you can set the -Xshareclasses:noPersistentDiskSpaceCheck option, which causes the VM to skip the space checking operation. If there isn't enough disk space available when the cache is written, a SIGBUS or SIGSEGV signal occurs and the VM ends. For more information, see the -Xshareclasses:noPersistentDiskSpaceCheck option.

"},{"location":"version0.17/#option-to-share-unsafe-classes","title":"Option to share 'Unsafe' classes","text":"

Classes created through Unsafe.defineClass are now stored by default in the shared classes cache. You can use the -XX:-ShareUnsafeClasses option to change the default behavior. For more information, see -XX:[+|-]ShareUnsafeClasses.

"},{"location":"version0.17/#option-to-record-class-relationships-in-the-verifier","title":"Option to record class relationships in the verifier","text":"

A new command line option -XX:+ClassRelationshipVerifier allows you to record class relationships in the verifier, which avoids unnecessary class loading and reduces VM startup time. This is a new approach to bytecode verification that delays validating the relationships between classes until the classes are required to be loaded for a program's execution thus loading only those classes that are needed. For more information, see -XX:[+|-]ClassRelationshipVerifier.

"},{"location":"version0.17/#support-for-the-ibm-z15-processor","title":"Support for the IBM z15 processor","text":"

This release adds JIT compiler support for exploiting z15 instructions.

"},{"location":"version0.17/#digest-algorithm-is-re-enabled","title":"Digest algorithm is re-enabled","text":"

Issue #5611 is fixed, so support for the Digest algorithm is re-enabled. For more information about this support, see Cryptographic operations.

"},{"location":"version0.17/#direct-dump-reader-ddr-vm-restriction-removed","title":"Direct Dump Reader (DDR) VM restriction removed","text":"

Prior to this version, you had to use a 32-bit VM to look at a 32-bit core, and a 64-bit VM to look at a 64-bit core when using DDR. This restriction has now been removed.

"},{"location":"version0.17/#the-format-of-the-hooks-section-of-a-java-dump-has-changed","title":"The format of the HOOKS section of a Java dump has changed","text":"

The format of the HOOKS section of a Java dump, which shows internal VM event callbacks, has changed:

For more information and an example of the new format, see Java dump: HOOKS

"},{"location":"version0.17/#ludcl-caching-disabled-by-default","title":"LUDCL caching disabled by default","text":"

By caching the Latest User Defined Class Loader (LUDCL), Java applications that use deserialization extensively can see a performance improvement. This capability is controlled by the -Dcom.ibm.enableClassCaching system property and is now disabled by default due to issue #7332.

Note: Versions of the documentation before 0.17.0 incorrectly identified this property as disabled by default when it was actually enabled by default in the VM.

"},{"location":"version0.17/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.16 and version 0.17.0 releases, see the Release notes.

"},{"location":"version0.18/","title":"Version 0.18.1","text":""},{"location":"version0.18/#whats-new-in-version-0181","title":"What's new in version 0.18.1","text":"

The following new features and notable changes since version 0.17.0 are included in this release:

"},{"location":"version0.18/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.18/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 releases 0.18.0 and 0.18.1 support OpenJDK 8, 11, and 13. Binaries are available from the AdoptOpenJDK community at the following links:

Note: Binaries at AdoptOpenJDK that are labeled 0.18.1 include additional bug fixes. For more information, see the release notes.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.18/#technical-preview-of-jitserver-technology","title":"Technical preview of JITServer technology","text":"

A technical preview of JITServer technology is included in this release. It's currently available for OpenJDK 8 and OpenJDK 11 running on Linux on x86-64.

JITServer technology decouples the JIT compiler from the VM and lets the JIT compiler run remotely in its own process. This mechanism prevents your Java application suffering possible negative effects due to CPU and memory consumption caused by JIT compilation. This technology can improve quality of service, robustness, and even performance of Java applications. For more information, see JITServer technology.

"},{"location":"version0.18/#jextract-now-available-on-macos-for-openjdk-version-8","title":"jextract now available on macOS for OpenJDK version 8","text":"

The jextract tool is now available on macOS platforms (as well as AIX\u00ae and Linux) for all current versions of OpenJDK: 8, 11, and 13.

"},{"location":"version0.18/#new-shared-classes-cache-suboption-to-turn-off-timestamp-checking","title":"New shared-classes cache suboption to turn off timestamp checking","text":"

You can set the -Xshareclasses:noTimestampChecks option to turn off timestamp checking in shared classes. For more information, see the -Xshareclasses:noTimestampChecks option.

"},{"location":"version0.18/#removal-of-restriction-on-layered-shared-cache","title":"Removal of restriction on layered shared cache","text":"

In the previous release, there is a restriction that the jvmtiSharedCacheInfo.isCorrupt field and the SharedClassCacheInfo.isCacheCorrupt() method cannot detect a corrupted cache that has a layer number other than 0. This restriction is now removed. See the Shared classes API documentation.

"},{"location":"version0.18/#-xmso-1-mb-minimum-value-on-zos-64-bit","title":"-Xmso 1 MB minimum value on z/OS 64-bit","text":"

On z/OS 64-bit, -Xmso has a 1 MB minimum value, to match the minimum stack space provided by the operating system. If you set a value smaller than 1 MB, the value is ignored.

"},{"location":"version0.18/#jstat-new-java-statistics-monitoring-tool","title":"jstat: new Java statistics monitoring tool","text":"

For compatibility with the HotSpot implementation, OpenJ9 now includes an independent implementation of the jstat tool for retrieving statistics on a VM. For more information, see Java statistics monitoring tool.

"},{"location":"version0.18/#-xxtransparenthugepage-is-enabled-by-default-on-more-linux-systems","title":"-XX:+TransparentHugePage is enabled by default on more Linux systems","text":"

-XX:+TransparentHugePage is enabled by default on Linux systems for POWER\u00ae and IBM Z\u00ae as well as x86 systems. This option takes affect only when Transparent Huge Pages (THP) is set to madvise on your system. When Transparent Huge Pages are used, your application footprint might increase.

"},{"location":"version0.18/#new-exit-dump-agent-and-exitonoutofmemoryerror-option","title":"New exit dump agent and ExitOnOutOfMemoryError option","text":"

The new exit dump agent shuts down the VM when the specified event occurs. The exit agent is at priority level 0 and the tool agent has been moved to priority level 1 to aid in mimicking the behavior of HotSpot options. For more information about dump agents, see -Xdump.

OpenJ9 now supports the HotSpot option -XX:[+|-]ExitOnOutOfMemoryError. You can set this option to have the VM shut down when a java.lang.OutOfMemory error is thrown by the VM or in Java code. The exit dump agent is used in the implementation of -XX:[+|-]ExitOnOutOfMemoryError.

"},{"location":"version0.18/#ludcl-caching-enabled-by-default","title":"LUDCL caching enabled by default","text":"

By caching the Latest User Defined Class Loader (LUDCL), Java applications that use deserialization extensively can see a performance improvement. This capability is controlled by the -Dcom.ibm.enableClassCaching system property and is now enabled by default. This feature was disabled for the 0.17.0 release due to issue #7332 which has now been resolved.

"},{"location":"version0.18/#terabytes-suffix-support-for-x-and-xx-options-that-take-a-size","title":"Terabytes suffix support for -X and -XX options that take a size","text":"

OpenJ9 now supports 't' and 'T' suffixes (indicating terabytes) for -X and -XX options that take a <size> parameter.

"},{"location":"version0.18/#improved-support-for-pause-less-garbage-collection","title":"Improved support for pause-less garbage collection","text":"

Support for Concurrent scavenge mode is now extended to macOS. For more information, see -Xgc:concurrentScavenge.

"},{"location":"version0.18/#-xgcnoconcurrentscavenge-option","title":"-Xgc:noConcurrentScavenge option","text":"

The previously undocumented option -Xgc:noConcurrentScavenge disables pause-less garbage collection.

"},{"location":"version0.18/#support-for-openjdk-hotspot-options","title":"Support for OpenJDK HotSpot options","text":"

For compatibility, the following OpenJDK HotSpot options are now supported by OpenJ9:

"},{"location":"version0.18/#shared-classes-cache-suboptions-for-layered-caches-no-longer-experimental","title":"Shared classes cache suboptions for layered caches no longer experimental","text":"

The suboptions for creating layered caches are no longer marked experimental.

The new options are:

"},{"location":"version0.18/#-djavalangstringsubstringnocopy-option","title":"-Djava.lang.string.substring.nocopy option","text":"

The previously undocumented Java 8 option -Djava.lang.string.substring.nocopy=true avoids String sharing by String.substring(), which is the same behavior as the Oracle HotSpot VM.

"},{"location":"version0.18/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.17.0 and version 0.18.0 releases, see the Release notes.

"},{"location":"version0.19/","title":"Version 0.19.0","text":""},{"location":"version0.19/#whats-new-in-version-0190","title":"What's new in version 0.19.0","text":"

The following new features and notable changes since version 0.18.0 are included in this release:

"},{"location":"version0.19/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.19/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.19.0 supports OpenJDK 14, which is available from the AdoptOpenJDK community at the following link:

OpenJDK 14 with Eclipse OpenJ9 is not a long term support (LTS) release.

The latest builds of OpenJDK with OpenJ9 for Java 8 and 11 at the AdoptOpenJDK community are for Eclipse OpenJ9 release 0.18.0. Features mentioned in these release notes are not available in these builds. Although it might be possible to build an OpenJDK 8 or OpenJDK 11 with OpenJ9 0.19.0, testing at the project is not complete and therefore support for any of these features is not available.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.19/#option-to-print-code-cache-usage-to-stderr-at-vm-shutdown","title":"Option to print code cache usage to stderr at VM shutdown","text":"

A new command line option -XX:+PrintCodeCache allows you to print the code cache memory usage to stderr when the VM shuts down.

"},{"location":"version0.19/#stringbuffer-and-stringbuilder-above-1-g-grow-to-the-maximum-size","title":"StringBuffer and StringBuilder above 1 G grow to the maximum size","text":"

A 1 G char[] or larger StringBuffer and StringBuilder now immediately grows to the maximum possible size for all current versions of Java, including Java 8. For Java 8 only, you can revert to the previous behavior of growing only as much as necessary to accommodate the String being added, by using the option, -Djava.lang.stringBuffer.growAggressively=false.

"},{"location":"version0.19/#jpackage-packaging-tool-platform-support","title":"jpackage packaging tool platform support","text":"

The jpackage utility is described in JEP 343 as a tool that \"packages a Java application into a platform-specific package that includes all of the necessary dependencies.\" Full details of the tool are available at JEP 343: Packaging Tool. Be aware that jpackage is supported on only the following OpenJ9 platforms: Linux\u00ae, macOS\u00ae, and Windows\u2122. It is not supported on AIX\u00ae or z/OS\u00ae platforms.

"},{"location":"version0.19/#extended-messages-for-nullpointerexception-not-yet-implemented","title":"Extended messages for NullPointerException not yet implemented","text":"

JEP 358: Helpful NullPointerExceptions provides extended messages when a NullPointerException is generated by the Java 14 VM and you have enabled the feature. However, be aware that this is not implemented in OpenJ9 at this time.

"},{"location":"version0.19/#compiler-changes-for-linux","title":"Compiler changes for Linux","text":"

Linux x86 64-bit, Linux on POWER\u00ae LE 64-bit, and Linux on IBM Z\u00ae 64-bit have all moved to the gcc 7.5 compiler. See Supported environments.

"},{"location":"version0.19/#new-jdk-14-features","title":"New JDK 14 features","text":"

The following features are supported by OpenJ9:

The following features are implemented in OpenJDK and available in any builds of OpenJDK 14 with OpenJ9:

You can find the full list of features for JDK 14 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

"},{"location":"version0.19/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.18.0 and version 0.19.0 releases, see the Release notes.

"},{"location":"version0.20/","title":"Version 0.20.0","text":""},{"location":"version0.20/#whats-new-in-version-0200","title":"What's new in version 0.20.0","text":"

The following new features and notable changes since version 0.19.0 are included in this release:

"},{"location":"version0.20/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.20/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.20.0 supports OpenJDK 8, 11, and 14. Binaries are available from the AdoptOpenJDK community at the following links:

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.20/#limited-support-for-64-bit-linux-on-arm","title":"Limited support for 64-bit Linux on ARM","text":"

Limited support is available in this release for the 64-bit ARM (AArch64) architecture. An early access build on OpenJDK 11 is available from the AdoptOpenJDK community. See the OpenJ9 release notes for any known issues that are still being worked on before this platform is fully supported.

"},{"location":"version0.20/#-xx-exitonoutofmemoryerror-option-behavior-update","title":"-XX:[+|-]ExitOnOutOfMemoryError option behavior update","text":"

The -XX:[+|-]ExitOnOutOfMemoryError option is updated to exit only on VM OutOfMemoryErrors instead of both VM and Java\u2122 thrown errors to match the HotSpot option. See -XX:[+|-]ExitOnOutOfMemoryError for more details about this option.

"},{"location":"version0.20/#new-xx-globallockreservation-option-added","title":"New -XX:[+|-]GlobalLockReservation option added","text":"

(AIX\u00ae and Linux on Power Systems\u2122 only)

Option -XX:[+|-]GlobalLockReservation enables a new optimization targeted towards more efficient handling of locking and unlocking Java objects. See -XX:[+|-]GlobalLockReservation for more details about this option.

"},{"location":"version0.20/#change-to-default-maximum-heap-size-for-java-8","title":"Change to default maximum heap size for Java 8","text":"

For consistency with Java 11, the default maximum heap size (-Xmx) is changed to be 25% of the available memory with a maximum of 25 GB. Where there is 2 GB or less of physical memory, the value set is 50% of available memory with a minimum value of 16 MB and a maximum value of 512 MB. If you want to revert to the default setting in earlier releases of OpenJ9, use the -XX:+OriginalJDK8HeapSizeCompatibilityMode option.

"},{"location":"version0.20/#change-to-jcmd-default-options","title":"Change to jcmd default options","text":"

The Java diagnostic command (jcmd) tool no longer requires a filename when used with the Dump.java, Dump.snap, or Dump.system options. See jcmd for more information about the tool.

"},{"location":"version0.20/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.19.0 and version 0.20.0 releases, see the Release notes.

"},{"location":"version0.21/","title":"Version 0.21.0","text":""},{"location":"version0.21/#whats-new-in-version-0210","title":"What's new in version 0.21.0","text":"

The following new features and notable changes since version 0.20.0 are included in this release:

"},{"location":"version0.21/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.21/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.21.0 supports OpenJDK 8, 11, and 14. Binaries are available from the AdoptOpenJDK community at the following links:

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.21/#application-programming-interface-api-documentation","title":"Application Programming Interface (API) documentation","text":"

API documentation that applies to OpenJ9 can now be found in this user documentation for both JDK 8 and JDK 11. The documentation includes links to Oracle API documentation for information that is not specific to OpenJ9. See API overview.

"},{"location":"version0.21/#performance-improvements","title":"Performance improvements","text":""},{"location":"version0.21/#new-xx-handlesigabrt-option-added","title":"New -XX:[+|-]HandleSIGABRT option added","text":"

This option affects the handling of the operating system signal SIGABRT. For compatibility with the reference implementation, set -XX:-HandleSIGABRT. For more information, see -XX:[+|-]HandleSIGABRT.

"},{"location":"version0.21/#new-xx-printflagsfinal-option-added","title":"New -XX:[+|-]PrintFlagsFinal option added","text":"

This release provides an initial implementation of the -XX:[+|-]PrintFlagsFinal option. It is currently incomplete and outputs only a subset of parameters. Over time, we expect more options to be added to the output. See -XX:[+|-]PrintFlagsFinal for more details about this option.

"},{"location":"version0.21/#update-to-noclassdeffounderror-exception-message","title":"Update to NoClassDefFoundError exception message","text":"

The order in which class names are printed in a NoClassDefFoundError exception message now matches the output reported by HotSpot.

For example, in the following exception message:

java.lang.NoClassDefFoundError: mypackage/Main (wrong name: Main)\n

mypackage/Main is the class name encountered by the VM in the .class file, but \"wrong name\" Main was the provided class name. Prior to this update to the exception message, the encountered class name and the provided class name were swapped in the NoClassDefFoundError exception message.

"},{"location":"version0.21/#macos-shared-libraries-version-updated","title":"macOS shared libraries version updated","text":"

The version information for shared libraries on macOS has been updated from 0.0.0 to 1.0.0. If an application has linked against a shared library from a previous OpenJ9 release, it needs to be re-linked against the new release. Failure to re-link causes an error Incompatible library version, requires version 0.0.0.

"},{"location":"version0.21/#support-for-openjdk-hotspot-options","title":"Support for OpenJDK HotSpot options","text":"

For compatibility, the following OpenJDK HotSpot option is now supported by OpenJ9:

"},{"location":"version0.21/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.20.0 and version 0.21.0 releases, see the Release notes.

"},{"location":"version0.22/","title":"Version 0.22.0","text":""},{"location":"version0.22/#whats-new-in-version-0220","title":"What's new in version 0.22.0","text":"

The following new features and notable changes since version 0.21.0 are included in this release:

"},{"location":"version0.22/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.22/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.22.0 supports OpenJDK 15. Binaries are available from the AdoptOpenJDK community at the following link:

OpenJDK 15 with Eclipse OpenJ9 is not a long term support (LTS) release.

The latest builds of OpenJDK with OpenJ9 for Java 8 and 11 at the AdoptOpenJDK community are for Eclipse OpenJ9 release 0.21.0. Features mentioned in these release notes are not available in these Java 8 and 11 builds. Although it might be possible to build an OpenJDK 8 or OpenJDK 11 with OpenJ9 0.22.0, testing at the project is not complete and therefore support for any of these features is not available.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.22/#performance-improvements","title":"Performance improvements","text":"

The performance of zero initializing Java heap memory improved on the IBM Z\u00ae platform because of a change to use memset instead of an outdated handcrafted assembly sequence in the JVM.

"},{"location":"version0.22/#new-xx-portablesharedcache-option-added","title":"New -XX:[+|-]PortableSharedCache option added","text":"

On x86 only, the -XX:[+|-]PortableSharedCache option enables you to choose whether AOT code should be generated using an older processor (Intel\u00ae Sandybridge) feature set, which therefore allows the AOT code to be portable. This feature is particularly relevant for packaging a shared classes cache into a container image (for example, applications deployed on the cloud in the form of Docker containers) because the processor on which the container image is built is likely to be different from the processor on which the container is deployed. For more information, see -XX:[+|-]PortableSharedCache.

"},{"location":"version0.22/#methods-in-comibmlangmanagementmemorymxbean-deprecated-and-replaced","title":"Methods in com.ibm.lang.management.MemoryMXBean deprecated and replaced","text":"

The methods com.ibm.lang.management.MemoryMXBean.getGCMasterThreadCpuUsed() and com.ibm.lang.management.MemoryMXBean.getGCSlaveThreadsCpuUsed() are deprecated for removal in Java 16. The recommended methods to be used are com.ibm.lang.management.MemoryMXBean.getGCMainThreadCpuUsed() and com.ibm.lang.management.MemoryMXBean.getGCWorkerThreadsCpuUsed() respectively.

For more information see Java 8: com.ibm.lang.management.MemoryMXBean and for Java 11: com.ibm.lang.management.MemoryMXBean

"},{"location":"version0.22/#javalangsystemmaplibraryname-string-suffix","title":"java.lang.System.mapLibraryName() string suffix","text":"

On AIX\u00ae systems, java.lang.System.mapLibraryName(libname) returns a representation of a native library in a platform-specific string with a .so suffix.

"},{"location":"version0.22/#new-jdk-15-features","title":"New JDK 15 features","text":"

The following features are supported by OpenJ9:

The following features are implemented in OpenJDK and available in any builds of OpenJDK 14 with OpenJ9:

You can find the full list of features for JDK 15 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

"},{"location":"version0.22/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.21.0 and version 0.22.0 releases, see the Release notes.

"},{"location":"version0.23/","title":"Version 0.23.0","text":""},{"location":"version0.23/#whats-new-in-version-0230","title":"What's new in version 0.23.0","text":"

The following new features and notable changes since version 0.22.0 are included in this release:

"},{"location":"version0.23/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.23/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.23.0 supports OpenJDK 8, 11, and 15. Binaries are available from the AdoptOpenJDK community at the following links:

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.23/#-xx-portablesharedcache-option-behavior-update","title":"-XX:[+|-]PortableSharedCache option behavior update","text":"

The -XX:[+|-]PortableSharedCache option is updated to improve the portability of AOT-compiled code further. This update allows AOT-compiled code to be portable across OpenJ9 VMs that use compressed references and have a heap size of 1 MB to 28 GB when this option is enabled. This option might introduce a small (1-2%) steady-state throughput penalty when compressed references are used and the heap size is between 1 MB and 3 GB. See -XX:[+|-]PortableSharedCache for more details about this option.

"},{"location":"version0.23/#-xx-idletuningcompactonidle-option-now-inactive","title":"-XX:[+|-]IdleTuningCompactOnIdle option now inactive","text":"

Setting the -XX:[+|-]IdleTuningCompactOnIdle option now has no effect. A compaction is triggered by internal heuristics that look into the number of fragmented pages. Typically there is no need to force a compaction. This option was deprecated in release 0.15.0, and will be removed in the future. See -XX:[+|-]IdleTuningCompactOnIdle for details about this option.

"},{"location":"version0.23/#support-for-openjdk-hotspot-options","title":"Support for OpenJDK HotSpot options","text":"

For compatibility, the following OpenJDK HotSpot options are now supported by OpenJ9:

"},{"location":"version0.23/#extended-platform-support-for-the-jitserver-technology-preview","title":"Extended platform support for the JITServer technology preview","text":"

Platform support for the JITServer technology preview is now extended to 64-bit Linux\u00ae on IBM Power\u00ae systems, and 64-bit Linux on IBM Z\u00ae systems. JITServer decouples the JIT compiler from the OpenJ9 VM, freeing up CPU and memory for an application. JITServer runs in its own process, either locally or on a remote machine, where resources can be separately managed. This preview was initially introduced in Eclipse OpenJ9 V0.18.1 for Linux on 64-bit x86 systems. For more information, see JITServer technology (technical preview).

"},{"location":"version0.23/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.22.0 and version 0.23.0 releases, see the Release notes.

"},{"location":"version0.24/","title":"Version 0.24.0","text":""},{"location":"version0.24/#whats-new-in-version-0240","title":"What's new in version 0.24.0","text":"

The following new features and notable changes since version 0.23.0 are included in this release:

"},{"location":"version0.24/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.24/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.24.0 supports OpenJDK 8, 11, and 15.

Windows\u00ae builds for Java\u2122 8 are now compiled with Microsoft\u00ae Visual Studio 2013. The Visual Studio redistributable files included with the build are updated to match.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.24/#changes-to-message-logging","title":"Changes to message logging","text":"

JEP 158 introduces the -Xlog option as a common logging system for all components of a Java virtual machine. To avoid confusion with the reference implementation, the -Xsyslog option replaces the existing OpenJ9 -Xlog option for message logging. For compatibility with the reference implementation, a limited set of -Xlog suboptions are supported.

A new option, -XX:[+|-]LegacyXlogOption, controls how -Xlog is processed when set on the command line.

"},{"location":"version0.24/#support-for-the-java_options-environment-variable","title":"Support for the JAVA_OPTIONS environment variable","text":"

For compatibility with the reference implementation, OpenJ9 now supports the JAVA_OPTIONS environment variable. This environment variable can be used to set command line options, as described in OpenJ9 command-line options and Environment variables. Options specified by JAVA_OPTIONS can be overridden by options specified by OPENJ9_JAVA_OPTIONS.

"},{"location":"version0.24/#-xx-portablesharedcache-option-support-update","title":"-XX:[+|-]PortableSharedCache option support update","text":"

The -XX:[+|-]PortableSharedCache option is now supported on IBM Z\u00ae and POWER\u00ae platforms. AOT-compiled code that is generated with this option is guaranteed to be portable across IBM z10 or newer microarchitectures on IBM Z platforms and IBM POWER8\u00ae or newer microarchitectures on POWER platforms. See -XX:[+|-]PortableSharedCache for more details about this option.

"},{"location":"version0.24/#-xx-shareanonymousclasses-option-behavior-update","title":"-XX:[+|-]ShareAnonymousClasses option behavior update","text":"

In earlier releases of OpenJ9, the -XX:[+|-]ShareAnonymousClasses option enables or disables the storage of VM anonymous classes in the shared classes cache. From OpenJ9 0.24.0 for OpenJDK 15 binaries, this option also controls the storage of hidden classes. See -XX:[+|-]ShareAnonymousClasses for more details about this option.

"},{"location":"version0.24/#additional-parameters-for-jcmd-dump-commands","title":"Additional parameters for jcmd Dump commands","text":"

You can now include additional parameters for jcmd Dump commands as indicated in the following list:

These parameters, including the <file path> parameter, can be in any order. The default for both system and heap dumps is now: request=exclusive+prepwalk. For further details, refer to the following -Xdump suboptions: request=<requests> and opts=<options>. For more information about jcmd, see Java diagnostic command (jcmd) tool.

"},{"location":"version0.24/#change-in-behavior-for-the-jextract-utility","title":"Change in behavior for the jextract utility","text":"

The jextract utility gathers relevant files following a system dump to assist with problem determination. It is important that the jextract utility is run from the same SDK that generated the dump. From this release, if the build ID of the jextract utility does not match the build ID of the SDK that is recorded in the system dump, an exception message is generated. To force jextract to continue, a new option, -r, is introduced. For more information, see Dump extractor.

"},{"location":"version0.24/#new-diagnostic-suboption-for-xcheckjni-for-fatal-jni-errors","title":"New diagnostic suboption for -Xcheck:jni for fatal JNI errors","text":"

A new abortonerror suboption for -Xcheck:jni provides diagnostic data when fatal JNI errors occur. For more information, run -Xcheck:jni:help.

"},{"location":"version0.24/#improved-diagnostic-information-in-a-java-dump-file-on-processor-features","title":"Improved diagnostic information in a Java dump file on processor features","text":"

The ENVINFO section of a Java dump file now includes further information about processor features. This information helps to diagnose problems associated with JIT and AOT compilations that depend on underlying hardware. For an example that shows the information provided when JIT is enabled, see the CPU Information (2CIJITFEATURE,2CIAOTFEATURE) section in the Java dump topic.

"},{"location":"version0.24/#helm-chart-available-for-deploying-jitserver","title":"Helm chart available for deploying JITServer","text":"

A Helm Chart is now available for easier deployment of JITServer technology in a Kubernetes or OpenShift cluster. You can find the chart (openj9-jitserver-chart) in the JITServer Helm repository, which contains a complete set of usage instructions. For an introduction to JITServer technology, see JITServer (tech. preview).

"},{"location":"version0.24/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.23.0 and version 0.24.0 releases, see the Release notes.

"},{"location":"version0.25/","title":"Version 0.25.0","text":""},{"location":"version0.25/#whats-new-in-version-0250","title":"What's new in version 0.25.0","text":"

The following new features and notable changes since version 0.24.0 are included in this release:

"},{"location":"version0.25/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.25/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.25.0 supports OpenJDK 16. OpenJDK 16 with Eclipse OpenJ9 is not a long term support (LTS) release.

Although it might be possible to build an OpenJDK 8 or OpenJDK 11 with OpenJ9 release 0.25.0, testing at the project is not complete and therefore support for new features that apply to these Java versions is not available.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.25/#new-jdk-16-features","title":"New JDK 16 features","text":"

The following features are supported by OpenJ9:

The following features will be supported by OpenJ9 in a future release:

The following features are implemented in OpenJDK and available in any builds of OpenJDK 16 with OpenJ9:

You can find the full list of features for JDK 16 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

Note: Applications might be adversely affected by JEP 396 if they make use of internal APIs. You should update your application to use standard APIs. To temporarily work around this problem, set --illegal-access=permit on the command line, which prints a warning that is similar to the following example when an illegal access call is made:

WARNING: An illegal reflective access operation has occurred\nWARNING: Illegal reflective access by org.openj9.test.com.ibm.jit.Test_JITHelpers (file:/home/jenkins/workspace/Test_openjdk11_j9.functional_ppc64_aix_Nightly_testList_1/jvmtest/functional/Java8andUp/GeneralTest.jar) to field java.lang.String.value\nWARNING: Please consider reporting this to the maintainers of org.openj9.test.com.ibm.jit.Test_JITHelpers\nWARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations\nWARNING: All illegal access operations will be denied in a future release\n
"},{"location":"version0.25/#support-for-the-verbosemodule-option","title":"Support for the -verbose:module option","text":"

The -verbose:module option is now supported for Java 11 and later releases. This option writes information to stderr for each module that is loaded and unloaded.

"},{"location":"version0.25/#enabling-zlibnx-hardware-accelerated-data-compression-and-decompression-on-aix","title":"Enabling zlibNX hardware-accelerated data compression and decompression on AIX","text":"

By default, AIX\u00ae uses the system zlib library for data compression and decompression.

On systems that contain the Nest accelerator (NX) co-processor, OpenJ9 now uses the zlibNX library instead, if it is installed. To learn more about hardware acceleration and the zlibNX library, see Hardware acceleration.

"},{"location":"version0.25/#zos-support-for-the-sysname-dump-token","title":"z/OS support for the %sysname dump token","text":"

The %sysname dump token is added on z/OS, which equates to the SYSNAME sysparm. See Dump agent tokens.

"},{"location":"version0.25/#single-build-for-compressed-references-and-non-compressed-references","title":"Single build for compressed references and non-compressed references","text":"

A single build now supports both compressed references and non-compressed references. The object reference mode is selected at run time based on the specified heap size (-Xmx) or by using command-line options that control the selection of compressed references.

If you used a large heap build for an earlier release of OpenJ9 because you did not require compressed references, you might need to turn it off if compressed references mode is being selected automatically at run time. Use the -Xnocompressedrefs option when you start your application.

The compressedrefs directory is no longer present in the single build.

To learn about the benefits of using compressed references, see Compressed references.

"},{"location":"version0.25/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.24.0 and version 0.25.0 releases, see the Release notes.

"},{"location":"version0.26/","title":"Version 0.26.0","text":""},{"location":"version0.26/#whats-new-in-version-0260","title":"What's new in version 0.26.0","text":"

The following new features and notable changes since version 0.25.0 are included in this release:

"},{"location":"version0.26/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.26/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.26.0 supports OpenJDK 8, 11, and 16.

For OpenJDK 8 and 11 builds that contain OpenJ9, see Version 0.25.0 for additional changes that have now been fully tested for these versions.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.26/#dump-extractor-tool-deprecated","title":"Dump extractor tool deprecated","text":"

The dump extractor tool, jextract, is deprecated in this release and replaced with the jpackcore tool. This tool uses the same syntax and parameters as jextract to collect diagnostic files for analysis. The change is necessary because the reference implementation will be introducing a tool in a future release that is also called jextract.

For more information, see Dump extractor.

"},{"location":"version0.26/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 v0.25.0 and v0.26.0 releases, see the Release notes.

"},{"location":"version0.27/","title":"Version 0.27.1","text":""},{"location":"version0.27/#whats-new-in-version-0271","title":"What's new in version 0.27.1","text":"

The following new features and notable changes since version 0.26.0 are included in this release:

"},{"location":"version0.27/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.27/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.27.1 supports OpenJDK 8, 11, and 16.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.27/#new-xx-adaptivegcthreading-option-added","title":"New -XX:[+|-]AdaptiveGCThreading option added","text":"

Adaptive threading is enabled by default, which automatically tunes the number of active parallel garbage collection (GC) threads. When this feature is enabled, the GC thread count is dynamically adjusted from collection cycle to cycle to account for changes in the the amount of time that parallel threads spend doing useful GC work (such as object graph traversal) compared to time spent synchronizing among themselves. When GC work decreases, fewer threads are used, which reduces the overhead, effectively reducing GC pause times. Resources are freed up for other processing activities.

Use the -xgcmaxthreads option with the -XX:+AdaptiveGCThreading option to specify a thread count limit.

"},{"location":"version0.27/#improved-time-zone-information-added-to-java-dump-files","title":"Improved time zone information added to Java dump files","text":"

To help with troubleshooting, additional time zone information is added to Java\u2122 dump files. Two new fields are included, the date and time in UTC (1TIDATETIMEUTC) and the time zone according to the local system (1TITIMEZONE). For more information, see the Java dump TITLE section.

"},{"location":"version0.27/#change-in-default-behavior-for-the-balanced-garbage-collection-gc-policy","title":"Change in default behavior for the balanced garbage collection (GC) policy","text":"

In this release, a new scan mode, -Xgc:dynamicBreadthFirstScanOrdering, is used during balanced GC copy forward operations that is expected to improve performance.

For more information about this type of operation, see GC copy forward operation.

You can revert to the behavior in earlier releases by setting -Xgc:breadthFirstScanOrdering when you start your application.

"},{"location":"version0.27/#stop-parsing-the-java_options-environment-variable","title":"Stop parsing the JAVA_OPTIONS environment variable","text":"

The 0.24 release started parsing the JAVA_OPTIONS environment variable. This variable was added in error and has been removed. The _JAVA_OPTIONS environment variable (with different behavior) is added for compatibility.

"},{"location":"version0.27/#global-lock-reservation-enabled-by-default","title":"Global lock reservation enabled by default","text":"

(AIX\u00ae and Linux on Power Systems\u2122 only)

Global lock reservation is now enabled by default. This is an optimization targeted towards more efficient handling of locking and unlocking Java objects. The older locking behavior can be restored via the -XX:-GlobalLockReservation option. See -XX:[+|-]GlobalLockReservation for more details.

"},{"location":"version0.27/#increase-in-default-operating-system-stack-size-on-ppc64-platforms","title":"Increase in default operating system stack size on PPC64 platforms","text":"

The default operating system stack size on AIX and Linux PPC64 is increased from 256KB to 512KB. You can change the operating system stack size by using the -Xmso option.

"},{"location":"version0.27/#new-x-option-recognized-by-jpackcore-jextract","title":"New -x option recognized by jpackcore / jextract","text":"

The new option, -x, causes the system dump to be omitted from the archive created. In its place, the file excluded-files.txt is added, which names the excluded file. For more information, see Dump extractor.

"},{"location":"version0.27/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 v0.26.0 and v0.27.1 releases, see the Release notes.

"},{"location":"version0.29.1/","title":"Version 0.29.1","text":""},{"location":"version0.29.1/#whats-new-in-version-0291","title":"What's new in version 0.29.1","text":"

The following new features and notable changes since version 0.29.0 are included in this release:

"},{"location":"version0.29.1/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.29.1/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.29.1 supports OpenJDK 17.

AArch64 Linux is now a fully supported, production-ready target for OpenJDK 17.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.29.1/#new-jdk-17-features","title":"New JDK 17 features","text":"

The following features are supported by OpenJ9:

The following features will be supported by OpenJ9 in a future release:

The following features are implemented in OpenJDK and available in any build of OpenJDK 17 with OpenJ9:

You can find the full list of features for JDK 17 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

Note: Applications might be adversely affected by JEP 403 if they make use of internal APIs. You should update your application to use standard APIs. To temporarily work around this problem, use --add-opens, --add-exports on the command line for each package required.

"},{"location":"version0.29.1/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 v0.29.0 and v0.29.1 releases, see the Release notes.

"},{"location":"version0.29/","title":"Version 0.29.0","text":""},{"location":"version0.29/#whats-new-in-version-0290","title":"What's new in version 0.29.0","text":"

The following new features and notable changes since version 0.27.0 are included in this release:

"},{"location":"version0.29/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.29/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.29.0 supports OpenJDK 8 and 11.

AArch64 Linux is now a fully supported, production-ready target for OpenJDK 8 and 11.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.29/#jitserver-technology-is-fully-supported-on-some-systems","title":"JITServer technology is fully supported on some systems","text":"

JITServer technology is now a fully supported feature on Linux\u00ae on x86 and Linux on IBM Power\u00ae systems (64-bit only). This feature remains a technical preview for Linux on IBM Z\u00ae systems (64-bit only). For more information, see JITServer technology.

"},{"location":"version0.29/#new-xx-utfcache-option-added","title":"New -XX:[+|-]UTFCache option added","text":"

A UTF to String cache is added to enhance reflection performance. The cache is enabled by default but can be disabled using the -XX:[+|-]UTFCache option.

"},{"location":"version0.29/#-xsoftmx-updates-for-gencon","title":"-Xsoftmx updates for gencon","text":"

When using gencon, the -Xsoftmx limit is proportional to the maximum amount of nursery space specified relative to the -Xmx value.

"},{"location":"version0.29/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 v0.27.0 and v0.29.0 releases, see the Release notes.

"},{"location":"version0.30.1/","title":"Version 0.30.1","text":""},{"location":"version0.30.1/#whats-new-in-version-0301","title":"What's new in version 0.30.1","text":"

The following new features and notable changes since version 0.30.0 are included in this release:

"},{"location":"version0.30.1/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.30.1/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.30.1 supports OpenJDK 8, 11 and 17.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.30.1/#creation-of-system-dumps-on-macos-12","title":"Creation of system dumps on macOS 12","text":"

Creation of system (core) dumps on macOS 12 or later is now possible.

"},{"location":"version0.30.1/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.30.0 and v0.30.1 releases, see the Release notes.

"},{"location":"version0.30/","title":"Version 0.30.0","text":""},{"location":"version0.30/#whats-new-in-version-0300","title":"What's new in version 0.30.0","text":"

The following new features and notable changes since version 0.29.0 are included in this release:

"},{"location":"version0.30/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.30/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.30.0 supports OpenJDK 8, 11 and 17.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.30/#changes-to-the-shared-classes-cache-generation-number","title":"Changes to the shared classes cache generation number","text":"

The format of classes that are stored in the shared classes cache is changed, which causes the JVM to create a new shared classes cache rather than re-creating or reusing an existing cache. To save space, you can remove all existing shared caches unless they are in use by an earlier release. For more information about the -Xshareclasses option, including the destroy options that you can use to remove caches, see -Xshareclasses.

"},{"location":"version0.30/#ignored-options-captured-in-java-dumps","title":"Ignored options captured in java dumps","text":"

For improved compatibility with other Java implementations, OpenJ9 ignores many command-line options. If any were ignored, they are now listed in the java dump files. For example, the command

\njava -Xdump:java:events=vmstop -XX:+UseCompressedOop -XX:CompressedClassSpaceSize=528482304 -version\n

would yield the following in the ENVINFO section after the complete list of all command-line arguments

\n1CIIGNOREDARGS Ignored Args:\n2CIIGNOREDARG            -XX:+UseCompressedOop\n2CIIGNOREDARG            -XX:CompressedClassSpaceSize=528482304\n
"},{"location":"version0.30/#new-xx-ensurehashed-option-added","title":"New -XX:[+|-]EnsureHashed option added","text":"

This option specifies the classes whose objects should be assigned hash values or those classes that should be ignored. This option might improve performance for applications that frequently hash objects of a certain type. See -XX:[+|-]EnsureHashed for more details.

"},{"location":"version0.30/#redesigned-heap-resizing-for-the-balanced-gc-policy","title":"Redesigned heap resizing for the balanced GC policy","text":"

Heap resizing heuristics have been redesigned for the balanced GC policy. This includes both total heap resizing including eden and non-eden components independently, and also balancing between these two components when the heap is fully expanded. The heuristics now combine both the CPU overhead (for Partial GCs as well as Global Mark Phase) and the heap occupancy criteria. The balancing between eden and non-eden for fully expanded heaps is far more dynamic (instead of being mostly fixed in the ratio 1:4).

As a consequence, there should typically be less need for heap sizing tuning options, most notably for eden sizing options -Xmn, -Xmns, and -Xmnx.

Also, a new soft limit pause target is added for Partial GCs, which defaults to 200ms. This criterion is combined with the PGC CPU overhead criterion for a balanced compromise between minimizing footprint, maximizing throughput, and meeting the paused time target.

More details about the new heuristics can be found at:

https://blog.openj9.org/2021/09/24/balanced-gc-performance-improvements-eden-heap-sizing-improvements/

The heuristics now obey the following existing options that were previously used for the optthruput, optavgpause, and gencon GC policies:

The heuristics also use the -Xgc:targetPausetime option that was previously used only for the metronome GC policy.

For more information about GC policies, see Garbage collection policies.

"},{"location":"version0.30/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.29.0 and v0.30.0 releases, see the Release notes.

"},{"location":"version0.32/","title":"Version 0.32.0","text":""},{"location":"version0.32/#whats-new-in-version-0320","title":"What's new in version 0.32.0","text":"

The following new features and notable changes since version 0.30.0 are included in this release:

"},{"location":"version0.32/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.32/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.32.0 supports OpenJDK 8, 11, 17, and 18.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.32/#creation-of-system-dumps-on-macos-12","title":"Creation of system dumps on macOS\u00ae 12","text":"

You can now create system (core) dumps on macOS 12 or later.

"},{"location":"version0.32/#support-for-openjdk-hotspot-options","title":"Support for OpenJDK HotSpot options","text":"

For compatibility, the following OpenJDK HotSpot options are now supported by OpenJ9:

"},{"location":"version0.32/#sharedclassstatistics-api-updated","title":"SharedClassStatistics API updated","text":"

You can now use the SharedClassStatistics API to get the name, path, and directory of a shared classes cache. Depending on the operating system, you can also get the number of attached VMs for a non-persistent cache. This information is available through the following new methods: cacheDir(), cacheName(), cachePath(), and numberAttached(). For more information, see the API documentation.

"},{"location":"version0.32/#support-for-openssl-30x","title":"Support for OpenSSL 3.0.x","text":"

OpenSSL 3.0.x is supported but on Linux only. The JITServer technology feature currently does not support OpenSSL 3.0.x. For more information about OpenSSL support, see Cryptographic operations.

"},{"location":"version0.32/#new-xx-openj9commandlineenv-option-added","title":"New -XX:[+|-]OpenJ9CommandLineEnv option added","text":"

This option specifies whether the VM captures the command line in the environment variable OPENJ9_JAVA_COMMAND_LINE. For more information, see -XX:[+|-]OpenJ9CommandLineEnv.

"},{"location":"version0.32/#jitserver-support-for-linux-on-ibm-z-systems","title":"JITServer support for Linux on IBM Z\u00ae systems","text":"

JITServer technology is now a fully supported feature on Linux on IBM Z\u00ae systems (64-bit only). For more information, see JITServer technology.

"},{"location":"version0.32/#modified-default-value-for-xxmaxdirectmemorysize","title":"Modified default value for -XX:MaxDirectMemorySize","text":"

The default value of the -XX:MaxDirectMemorySize option, which limits the amount of heap memory that is used for direct byte buffers, is now the same as the maximum heap size.

"},{"location":"version0.32/#new-jdk-18-features","title":"New JDK 18 features","text":"

The following features are supported by OpenJ9:

The following features will be supported by OpenJ9 in a future release:

The following features are implemented in OpenJDK and available in any build of OpenJDK 18 with OpenJ9:

You can find the full list of features for JDK 18 at the OpenJDK project.

"},{"location":"version0.32/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.30.0 and v0.32.0 releases, see the Release notes.

"},{"location":"version0.33/","title":"Version 0.33.x","text":""},{"location":"version0.33/#whats-new-in-version-033x","title":"What's new in version 0.33.x","text":"

The following new features and notable changes since version 0.32.0 are included in this release:

"},{"location":"version0.33/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.33/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.33.x supports OpenJDK 8, 11, 17, and 18.

OpenJ9 Windows\u00ae builds for OpenJDK 8 are now compiled with Microsoft\u00ae Visual Studio 2017. The Visual Studio redistributable files included with the build are updated to match.

Note: Binaries that are labeled 0.33.1 include additional bug fixes. For more information, see the release notes.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.33/#jitserver-technology-feature-updated","title":"JITServer technology feature updated","text":"

The JITServer technology feature is updated to provide the following new capabilities, which are disabled by default:

"},{"location":"version0.33/#xl-c-runtime-required-on-aix","title":"XL C++ Runtime required on AIX","text":"

AIX OpenJ9 builds now require version 16.1 of the IBM XL C++ Runtime. This was already required for OpenJDK 17 and is now also required from 11.0.16 to accommodate a security update to the HarfBuzz text shaping library.

"},{"location":"version0.33/#linux-reference-compiler-updated-to-gcc-103","title":"Linux reference compiler updated to gcc 10.3","text":"

Linux\u00ae builds for all platforms now use gcc 10.3 instead of gcc 7.5. See the list of build environments.

"},{"location":"version0.33/#the-maximum-number-of-jit-compilation-threads-is-increased","title":"The maximum number of JIT compilation threads is increased","text":"

The maximum number of JIT compilation threads is increased from 7 to 15. If the JITServer feature is enabled, the maximum number of JIT compilation threads is increased further on the server, to 999. You can set the number of compilation threads to be used by specifying the -XcompilationThreads command line option.

"},{"location":"version0.33/#default-operating-system-stack-size-increased-on-x64-platforms","title":"Default operating system stack size increased on x64 platforms","text":"

The default operating system stack size on Windows x64, macOS\u00ae x64, and Linux x64 platforms is increased from 256 KB to 512 KB to accommodate vector support. You can change the operating system stack size by using the -Xmso option.

"},{"location":"version0.33/#control-groups-v2-support","title":"Control groups v2 support","text":"

The Linux kernel has two variants of control groups (cgroups): v1 and v2. Many Linux operating systems are gradually transitioning from cgroups v1 to v2 as their default choice. Now, OpenJ9 has added cgroups v2 support, which is identical to the support for cgroups v1.

"},{"location":"version0.33/#support-for-openssl-30x","title":"Support for OpenSSL 3.0.x","text":"

The JITServer technology feature now supports OpenSSL 3.0.x. For more information about OpenSSL support, see Cryptographic operations.

"},{"location":"version0.33/#ec-key-agreement-algorithm-support-for-openssl","title":"EC key agreement algorithm support for OpenSSL","text":"

The EC key agreement algorithm can now use the native OpenSSL library. For more information, see -Djdk.nativeEC.

"},{"location":"version0.33/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.32.0 and v0.33.x, see the Release notes.

"},{"location":"version0.35/","title":"Version 0.35.0","text":""},{"location":"version0.35/#whats-new-in-version-0350","title":"What's new in version 0.35.0","text":"

The following new features and notable changes since version 0.33.1 are included in this release:

"},{"location":"version0.35/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.35/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.35.0 supports OpenJDK 8, 11, and 17.

OpenJ9 Windows\u00ae builds for OpenJDK 11 are now compiled with Microsoft\u00ae Visual Studio 2019. The Visual Studio redistributable files included with the build are updated to match.

Apple silicon macOS\u00ae is now a fully supported, production-ready target for OpenJDK 11 and later.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.35/#java-dump-files-contain-more-information-about-waiting-threads","title":"Java dump files contain more information about waiting threads","text":"

For threads that are waiting for a class initialization lock, the Java dump output now shows the thread that is currently working to progress the initialization of the class. This thread is indicated by the new Initializing thread: <thread_name> string in the existing 3XMTHREADBLOCK line in the Java dump output. For example:

3XMTHREADBLOCK Waiting on: java/lang/J9VMInternals$ClassInitializationLock@0x00000000FFF5DC90 Owned by: <unowned> Initializing thread: \"Class Initialization Thread 1\"

For more information, see Threads.

"},{"location":"version0.35/#new-xx-shownativestacksymbols-option-added","title":"New -XX:[+|-]ShowNativeStackSymbols option added","text":"

This option controls whether Java dumps show the names of functions in native call stacks.

For more information, see -XX:[+|-]ShowNativeStackSymbols.

"},{"location":"version0.35/#new-user2-event-added-for-the-xdump-option","title":"New user2 event added for the -Xdump option","text":"

On operating systems other than Windows\u2122, you can now use the user2 event for the -Xdump option. This event is triggered when the VM receives the SIGUSR2 signal.

There is a change in the SIGUSR2 signal behavior as well whereby, the process does not exit in response to this signal.

For more information, see -Xdump and Signal handling.

"},{"location":"version0.35/#new-xx-perftool-option-added","title":"New -XX:[+|-]PerfTool option added","text":"

This option enables or disables the JIT support for the perf tool without affecting the existing Xjit options.

Since this option creates a file that is used by the Linux\u00ae system profiler, perf, it applies only to Linux.

For more information, see -XX:[+|-]PerfTool.

"},{"location":"version0.35/#new-default-options-added-in-the-optionsdefault-file","title":"New default options added in the options.default file","text":"

-XX:+EnsureHashed:java/lang/Class,java/lang/Thread is added to the list of default options in the options.default file to improve performance.

For more information, see XX:[+|-]EnsureHashed.

"},{"location":"version0.35/#new-options-added-to-encrypt-the-jitserver-exported-metrics","title":"New options added to encrypt the JITServer exported metrics","text":"

You can use the -XX:JITServerMetricsSSLKey and -XX:JITServerMetricsSSLCert options to encrypt the custom metrics with TLS or SSL.

"},{"location":"version0.35/#xl-c-runtime-16107-or-later-required-on-aix","title":"XL C++ Runtime 16.1.0.7 or later required on AIX","text":"

AIX OpenJ9 builds now require version 16.1.0.7 or later of the IBM XL C++ Runtime.

"},{"location":"version0.35/#-xx-jitserverlocalsynccompiles-enabled-by-default","title":"-XX:[+|-]JITServerLocalSyncCompiles enabled by default","text":"

The -XX:[+|-]JITServerLocalSyncCompiles option is now enabled in most cases. For more information, see -XX:[+|-]JITServerLocalSyncCompiles.

"},{"location":"version0.35/#support-for-changes-to-the-maintenance-specifications-of-jsr-337-in-java-8","title":"Support for changes to the maintenance specifications of JSR 337 in Java 8","text":"

OpenJ9 now supports changes to the maintenance specifications in Java 8 as listed in the JSR 337 Maintenance Release 4 document.

These changes include the change in the garbage collector behavior for handling the phantom references in Java 8. The garbage collector handles both the phantom as well as the weak references similarly, which is the current behavior in Java 11 and later. For more information, see Weak reference processing.

"},{"location":"version0.35/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.33.1 and v0.35.0 releases, see the Release notes.

"},{"location":"version0.36/","title":"Version 0.36.x","text":""},{"location":"version0.36/#whats-new-in-version-036x","title":"What's new in version 0.36.x","text":"

The following new features and notable changes since version 0.35.0 are included in this release:

"},{"location":"version0.36/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.36/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.36.0 supports OpenJDK 8 and 17.

Release 0.36.1 supports OpenJDK 11.

Support for running OpenJ9 with OpenJDK 8 or OpenJDK 11 on CentOS 6.10 is deprecated and might be removed in a future release. OpenJ9 will not be tested with OpenJDK 11 on CentOS 6.10 after the 0.36.1 release.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.36/#changes-to-the-location-of-the-default-directory-for-the-shared-cache-and-snapshot","title":"Changes to the location of the default directory for the shared cache and snapshot","text":"

On operating systems other than Windows\u2122 and z/OS\u00ae, the default shared classes cache directory in the user's home directory is changed from javasharedresources to .cache/javasharedresources. This change is to avoid cluttering of the home directory. If you specify -Xshareclasses:groupAccess, the default directory remains /tmp/javasharedresources/.

If the javasharedresources directory in the user's home directory is empty, the javasharedresources directory can be deleted.

You can find and remove caches or snapshots in the old default directory by using the following command-line options:

For persistent caches:

For nonpersistent caches or snapshots:

"},{"location":"version0.36/#new-xx-mergecompileroptions-option-added","title":"New -XX:[+|-]MergeCompilerOptions option added","text":"

This option enables or disables the merging of multiple -Xjit or -Xaot options into a single -Xjit or -Xaot option.

For more information, see -XX:[+|-]MergeCompilerOptions.

"},{"location":"version0.36/#default-jitserver-aot-cache-name-changed","title":"Default JITServer AOT cache name changed","text":"

A JITServer instance can have several AOT caches, each with its own name and containing different versions of compiled methods. Client JVMs with different profiles of execution can connect to the same JITServer instance, but access the cache with compiled methods optimized for their own profile with the -XX:JITServerAOTCacheName option. Earlier, if the cache name was not specified in this option, the default was to use a nameless cache. The default AOT cache name is now changed to default.

This change is to allow AOT cache persistence, whereby JITServer can periodically save its AOT caches to files with names that include the name of the cache. JITServer can then load caches from such files when a client requests a particular cache.

For more information, see -XX:JITServerAOTCacheName and -XX:[+|-]JITServerAOTCachePersistence.

"},{"location":"version0.36/#new-xxjitserveraotmx-option-added","title":"New -XX:JITServerAOTmx option added","text":"

This option specifies the maximum amount of memory that can be used by the JITServer AOT cache. Instead of unlimited memory consumption, the maximum amount of memory that all AOT cache instances combined can use at the server is now limited to 300 MB, by default.

For more information, see -XX:JITServerAOTmx.

"},{"location":"version0.36/#new-xx-jitserveraotcachepersistence-option-added","title":"New -XX:[+|-]JITServerAOTCachePersistence option added","text":"

The JITServer AOT cache was a non-persistent in-memory cache. If the JITServer instance terminated, the cache content was lost. Now, with the -XX:+JITServerAOTCachePersistence option, the JITServer server periodically saves its AOT caches to files. Other JITServer instances can then load these caches from files the first time a client requests a particular cache.

For more information, see -XX:[+|-]JITServerAOTCachePersistence.

"},{"location":"version0.36/#new-xxjitserveraotcachedir-option-added","title":"New -XX:JITServerAOTCacheDir option added","text":"

You can specify the directory for saving or loading the JITServer AOT cache files with the -XX:JITServerAOTCacheDir=<directory> option. If the option is not used, AOT cache files are saved to (or loaded from) the current working directory of the JITServer server.

For more information, see -XX:JITServerAOTCacheDir.

"},{"location":"version0.36/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.35.0 and v0.36.x releases, see the Release notes.

"},{"location":"version0.37/","title":"Version 0.37.0","text":""},{"location":"version0.37/#whats-new-in-version-0370","title":"What's new in version 0.37.0","text":"

The following new features and notable changes since version 0.36.x are included in this release:

"},{"location":"version0.37/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.37/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.37.0 works with OpenJDK 19. OpenJDK 19 is out of support at the time of the 0.37.0 release. Builds of 0.37.0 should not be used in production and might contain known security vulnerabilities as of 18 April 2023.

RHEL 8.2 is out of support. RHEL 8.4 is the new minimum operating system level.

OpenJ9 Windows\u00ae builds for OpenJDK 19 and later are now compiled with Microsoft\u00ae Visual Studio 2022. The Visual Studio redistributable files included with the build are updated to match.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.37/#aix-is-now-built-on-aix-72-tl5","title":"AIX is now built on AIX 7.2 TL5","text":"

All AIX compiles are now moved from AIX 7.1 TL5 to AIX 7.2 TL5.

For more information, see Supported environments.

"},{"location":"version0.37/#linux-reference-compiler-updated-to-gcc-112","title":"Linux reference compiler updated to gcc 11.2","text":"

Linux builds for platforms Linux x86 64-bit, Linux on POWER LE 64-bit, and Linux on IBM Z 64-bit now use gcc 11.2 instead of gcc 10.3. Linux AArch64 64-bit continues to use the gcc 10.3 compiler. See the list of build environments.

"},{"location":"version0.37/#support-added-for-the-comsunmanagementthreadmxbean-interface","title":"Support added for the com.sun.management.ThreadMXBean interface","text":"

The OpenJ9 ThreadMXbean interface (com.ibm.lang.management.ThreadMXBean) was extending the java.lang.management.ThreadMXBean interface. With this release, the OpenJ9 ThreadMXBean interface extends the com.sun.management.ThreadMXBean interface, whereby it now contains all the methods of the java.lang.management.ThreadMXBean interface with additional methods from the com.sun.management.ThreadMXBean interface.

The OpenJ9 VM implementation does not support thread memory allocation measurement (isThreadAllocatedMemorySupported method returns false).

"},{"location":"version0.37/#support-for-pkcs11-token-labels-added-on-linux-on-ibm-z","title":"Support for PKCS#11 token labels added on Linux on IBM Z","text":"

On restarting an application, or creating or removing of tokens, the token might move to a different slot. An application that uses the slot or slotListIndex attributes might fail if it doesn\u2019t first check which slot the token is in.

OpenJ9 now supports the use of an extra attribute, tokenlabel, in the SunPKCS11 configuration file on Linux on IBM Z, which helps to avoid this issue.

For more information, see Support for PKCS#11 token labels.

"},{"location":"version0.37/#new-message-added-to-help-find-system-dumps-on-linux","title":"New message added to help find system dumps on Linux","text":"

A new message, JVMPORT049I, is added to help find the system dump files for kernel.core_pattern piped programs on Linux.

For more information about system dumps and piped system dumps, see System dumps on Linux.

"},{"location":"version0.37/#new-jdk-19-features","title":"New JDK 19 features","text":"

The following features are supported by OpenJ9:

The following features are implemented in OpenJDK and available in any build of OpenJDK 19 with OpenJ9:

You can find the full list of features for JDK 19 at the OpenJDK project. Any remaining features that are listed are not implemented and hence not applicable to OpenJ9 in this release.

"},{"location":"version0.37/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.36.x and v0.37.0 releases, see the Release notes.

"},{"location":"version0.38/","title":"Version 0.38.0","text":""},{"location":"version0.38/#whats-new-in-version-0380","title":"What's new in version 0.38.0","text":"

The following new features and notable changes since version 0.37.0 are included in this release:

"},{"location":"version0.38/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.38/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.38.0 supports OpenJDK 8, 11 and 17.

Support for running OpenJ9 with OpenJDK 8 or OpenJDK 11 on CentOS 6.10 is deprecated and might be removed in a future release. Since release 0.37, OpenJ9 is no longer tested with OpenJDK 11 on CentOS 6.10. Testing of OpenJ9 with OpenJDK 8 on CentOS 6.10 is likely to end in a future release.

OpenJ9 Windows\u00ae builds for OpenJDK 8 are now compiled with Microsoft\u00ae Visual Studio 2019. The Visual Studio redistributable files included with the build are updated to match.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.38/#new-xx-handlesigusr2-option-added","title":"New -XX:[+|-]HandleSIGUSR2 option added","text":"

This option controls the handling of the SIGUSR2 signal by the VM signal handler. The VM signal handler is installed only if this option is enabled.

For more information, see -XX:[+|-]HandleSIGUSR2.

"},{"location":"version0.38/#technical-preview-of-criu-support","title":"Technical preview of CRIU support","text":"

This release supports, as a technical preview, the Checkpoint/Restore In Userspace (CRIU) tool that is included with many Linux distributions. This tool is available for OpenJDK 11 and later running on Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), and Linux on IBM Z\u00ae only.

You can use the CRIU feature to stop the VM at a checkpoint, save its state, then run the VM from the point where it was stopped. You can restore the checkpoint image in multiple other environments with improved start-up time. This capability means that the CRIU support is particularly useful in container environments. For more information, see CRIU support.

"},{"location":"version0.38/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.37.0 and v0.38.0 releases, see the Release notes.

"},{"location":"version0.39/","title":"Version 0.39.0","text":""},{"location":"version0.39/#whats-new-in-version-0390","title":"What's new in version 0.39.0","text":"

The following new features and notable changes since version 0.38.0 are included in this release:

"},{"location":"version0.39/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.39/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.39.0 supports OpenJDK 20.

OpenJDK 20 with Eclipse OpenJ9 is not a long term support (LTS) release.

RHEL 8.4 is out of support. RHEL 8.6 is the new minimum operating system level.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.39/#ec-key-generation-algorithm-support-for-openssl","title":"EC key generation algorithm support for OpenSSL","text":"

The EC key generation algorithm can now use the native OpenSSL library for OpenJDK 20. For more information, see -Djdk.nativeECKeyGen.

"},{"location":"version0.39/#new-jdk-20-features","title":"New JDK 20 features","text":"

The following features are supported by OpenJ9:

The following features are implemented in OpenJDK and available in any build of OpenJDK 20 with OpenJ9:

You can find the full list of features for JDK 20 at the OpenJDK project. Any remaining features that are listed either do not apply to OpenJ9 or are not implemented and hence not applicable to OpenJ9 in this release.

"},{"location":"version0.39/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.38.0 and v0.39.0 releases, see the Release notes.

"},{"location":"version0.40/","title":"Version 0.40.0","text":""},{"location":"version0.40/#whats-new-in-version-0400","title":"What's new in version 0.40.0","text":"

The following new features and notable changes since version 0.39.0 are included in this release:

"},{"location":"version0.40/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.40/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.40.0 supports OpenJDK 8, 11, 17 and 20.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.40/#new-xxcodecachetotalmaxrampercentage-option-added","title":"New -XX:codecachetotalMaxRAMPercentage option added","text":"

In environments with low physical memory availability, the VM might use too much memory for JIT code caches, leaving little memory for critical operations. With the -XX:codecachetotalMaxRAMPercentage option, you can set an upper limit for the total code cache size, where the upper limit is specified as a percentage of the physical memory the VM process is allowed to use.

For more information, see -XX:codecachetotalMaxRAMPercentage.

"},{"location":"version0.40/#vm-starts-with-a-warning-message-after-the-container-detection-fails","title":"VM starts with a warning message after the container detection fails","text":"

If you mount the /proc file system with the hidepid=2 option on Linux\u00ae systems and the VM does not have root privileges, it cannot access the /proc file system. In previous releases, the VM exits when it encounters this scenario. From this release, the VM starts with a warning message after the container detection fails.

For more information, see the Cloud optimizations topic.

"},{"location":"version0.40/#support-for-persistent-shared-classes-cache-added-on-zos","title":"Support for persistent shared classes cache added on z/OS","text":"

Persistent shared caches are now supported on z/OS systems. The default cache type on z/OS is still non-persistent. You can use the -Xshareclasses:persistent option to switch to persistent shared cache.

"},{"location":"version0.40/#ec-key-generation-algorithm-and-xdh-key-agreement-and-generation-algorithms-support-for-openssl","title":"EC key generation algorithm and XDH key agreement and generation algorithms support for OpenSSL","text":"

The EC key generation algorithm can now use the native OpenSSL library for all OpenJDK versions. The XDH key agreement and generation algorithms can also use the native OpenSSL library. For more information, see -Djdk.nativeECKeyGen, -Djdk.nativeXDHKeyAgreement, and -Djdk.nativeXDHKeyGen.

"},{"location":"version0.40/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.39.0 and v0.40.0 releases, see the Release notes.

"},{"location":"version0.41/","title":"Version 0.41.0","text":""},{"location":"version0.41/#whats-new-in-version-0410","title":"What's new in version 0.41.0","text":"

The following new features and notable changes since version 0.40.0 are included in this release:

"},{"location":"version0.41/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.41/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.41.0 supports OpenJDK 8, 11, and 17.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.41/#new-xx-showcarrierframes-option-added","title":"New -XX:[+|-]ShowCarrierFrames option added","text":"

A VM maintains multiple platform threads that are used as carrier threads to run the virtual threads. Although the virtual thread runs on a carrier thread, the stack trace of the virtual thread and its carrier thread are separate. You can use the -XX:+ShowCarrierFrames option to add the stack trace of the carrier thread in addition to the virtual thread stack trace to the Throwable.getStackTrace() method, if an exception occurs.

For more information, see -XX:[+|-]ShowCarrierFrames.

"},{"location":"version0.41/#new-xxcontinuationcache-option-added","title":"New -XX:ContinuationCache option added","text":"

When a virtual thread is created, it is associated with a continuation, which holds the target task of the virtual thread. The VM saves the current thread state in an internal data structure that is linked with the continuation and allocates the memory for that structure. The VM stores the internal data structure in a continuation cache. New continuations can reuse the cached structure instead of allocating new memory for it.

You can optimize the virtual thread performance by tuning the continuation tier 1 and 2 cache size with the -XX:ContinuationCache option.

"},{"location":"version0.41/#-xxcompactstrings-option-enabled-by-default","title":"-XX:+CompactStrings option enabled by default","text":"

Like HotSpot, the-XX:+CompactStrings option is now enabled by default on Java\u2122 11 and later. In the earlier versions, this option is disabled by default.

For more information, see -XX:[+|-]CompactStrings.

"},{"location":"version0.41/#change-in-behavior-of-xshareclassesreadonly","title":"Change in behavior of -Xshareclasses:readonly","text":"

In the earlier releases, if the -Xshareclasses:readonly option and the JITServer AOT cache feature were both enabled at the same time at a JITServer client, the client could not use the JITServer AOT cache because the cache for storing data that the JITServer AOT cache needed was read-only.

Now, with the change in behavior of the -Xshareclasses:readonly option, the shared classes cache startup creates a temporary new (writable) top layer that the JITServer AOT cache can use to store data that it needs to function.

"},{"location":"version0.41/#new-xx-enabledynamicagentloading-option-added","title":"New -XX:[+|-]EnableDynamicAgentLoading option added","text":"

This option enables or disables the dynamic loading of agents into a running VM. The -XX:+EnableDynamicAgentLoading option is the default setting.

For Java 21 and later, warnings are issued when the agents are loaded dynamically into a running VM after startup without specifying the -XX:+EnableDynamicAgentLoading option and the same agents were not loaded before.

For more information, see -XX:[+|-]EnableDynamicAgentLoading.

"},{"location":"version0.41/#new-xx-usezlibnx-option-added","title":"New -XX:[+|-]UseZlibNX option added","text":"

AIX\u00ae system adds the zlibnx library directory path in the LIBPATH environment variable by default, if it is available in the system. You can control the loading of the zlibnx library by using the -XX:[+|-]UseZlibNX option.

"},{"location":"version0.41/#support-for-openssl-3x","title":"Support for OpenSSL 3.x","text":"

OpenSSL 3.x is now supported on all operating systems. For more information about OpenSSL support, see Cryptographic operations.

"},{"location":"version0.41/#performance-improvement","title":"Performance improvement","text":"

Performance of algorithms with the use of OpenSSL version 3 and later is now enhanced. Improved algorithms include SHA256, AES, HmacSHA256, and ChaCha20. To obtain these improved algorithms and further enhance the performance of these algorithms on Linux\u00ae and AIX, use OpenSSL 3.0.12 or a later 3.0.x version, or 3.1.4 or a later 3.1.x version.

"},{"location":"version0.41/#support-added-for-the-comsunmanagementthreadmxbeangetthreadallocatedbytes-api","title":"Support added for the com.sun.management.ThreadMXBean.getThreadAllocatedBytes() API","text":"

With this release, the OpenJ9 VM implementation supports thread memory allocation measurement (com.sun.management.ThreadMXBean.getThreadAllocatedBytes() API). The isThreadAllocatedMemorySupported() method now returns true instead of false. The setThreadAllocatedMemoryEnabled() and isThreadAllocatedMemoryEnabled() methods do not throw the \"UnsupportedOperationException\" error now and are enabled by default.

Support for the com.sun.management.ThreadMXBean.getThreadAllocatedBytes() API is not added on z/OS\u00ae platforms in this release. In the coming future z/OS release, the support for this API will be added on z/OS platforms as well.

"},{"location":"version0.41/#change-in-behavior-of-the-djavasecuritymanager-system-property-for-openjdk-version-11","title":"Change in behavior of the -Djava.security.manager system property for OpenJDK version 11","text":"

From OpenJDK version 18 onwards, if you enable the SecurityManager at runtime by calling the System.setSecurityManager() API, you must set the -Djava.security.manager=allow option. To disable the SecurityManager, you must specify the -Djava.security.manager=disallow option. If an application is designed to run on multiple OpenJDK versions, the same command line might be used across multiple versions. Because of this use of the same command line across multiple versions, in OpenJDK versions before version 18, the runtime attempts to load a SecurityManager with the class name allow or disallow resulted in an error and the application was not starting.

To resolve this issue, OpenJDK version 17 ignores these options. With this release, OpenJDK version 11 also ignores the allow and disallow keywords, if specified.

"},{"location":"version0.41/#jitserver-support-for-linux-on-aarch64","title":"JITServer support for Linux on AArch64","text":"

JITServer technology is now a fully supported feature on Linux on AArch64 systems. For more information, see JITServer technology.

"},{"location":"version0.41/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.40.0 and v0.41.0 releases, see the Release notes.

"},{"location":"version0.42/","title":"Version 0.42.0","text":""},{"location":"version0.42/#whats-new-in-version-0420","title":"What's new in version 0.42.0","text":"

The following new features and notable changes since version 0.41.0 are included in this release:

"},{"location":"version0.42/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.42/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.42.0 supports OpenJDK 21.

OpenJDK 21 with Eclipse OpenJ9 is a long term support (LTS) release and supersedes OpenJDK 20 with Eclipse OpenJ9.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.42/#openj9-jextract-removed","title":"OpenJ9 jextract removed","text":"

The dump extractor tool, OpenJ9 jextract, that was deprecated since the 0.26.0 release is now removed from Java 21 and later. The jpackcore tool replaced the OpenJ9 jextract tool after its deprecation.

"},{"location":"version0.42/#change-in-the-systemgc-call-behavior","title":"Change in the System.gc() call behavior","text":"

The System.gc call triggers a global garbage collection (GC) cycle, which is a stop-the-world GC. If the System.gc() call was made during an active GC cycle where the concurrent operation was in progress, the status of objects might not be updated. An object that was reachable when the concurrent operation started might be considered as reachable even if the object is no longer in use later. The System.gc() call had to be called twice explicitly to ensure that all unreachable objects are identified and cleared.

Now, the System.gc() call triggers the GC cycle twice internally to clear the unreachable objects that were not identified during the first GC cycle. The call also triggers finalization of the objects in the Finalization queues.

For more information, see Garbage collection.

"},{"location":"version0.42/#new-xx-iprofileduringstartupphase-option-added","title":"New -XX:[+|-]IProfileDuringStartupPhase option added","text":"

The VM uses heuristics to decide whether to collect interpreter profiling information during the VM startup. You can overrule the heuristics and control the collection of the profiling information during the startup phase by using the -XX:[+|-]IProfileDuringStartupPhase option.

"},{"location":"version0.42/#new-xx-criusecprovider-option-added","title":"New -XX:[+|-]CRIUSecProvider option added","text":"

When you enable CRIU support, all the existing security providers are removed from the security provider list during the checkpoint phase and CRIUSECProvider is added by default.

You can now control the use of CRIUSECProvider during the checkpoint phase with the -XX:[+|-]CRIUSecProvider option. You can use all the existing security providers instead of the CRIUSECProvider by specifying the -XX:-CRIUSecProvider option.

For more information, see -XX:[+|-]CRIUSecProvider.

"},{"location":"version0.42/#new-jdk-21-features","title":"New JDK 21 features","text":"

The following features are supported by OpenJ9:

The following features are implemented in OpenJDK and available in any build of OpenJDK 21 with OpenJ9:

You can find the full list of features for JDK 21 at the OpenJDK project. Any remaining features that are listed either do not apply to OpenJ9 or are not implemented and hence not applicable to OpenJ9 in this release.

"},{"location":"version0.42/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.41.0 and v0.42.0 releases, see the Release notes.

"},{"location":"version0.43/","title":"Version 0.43.0","text":""},{"location":"version0.43/#whats-new-in-version-0430","title":"What's new in version 0.43.0","text":"

The following new features and notable changes since version 0.42.0 are included in this release:

"},{"location":"version0.43/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.43/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.43.0 supports OpenJDK 8, 11, 17, and 21.

OpenJ9 Windows\u00ae builds for OpenJDK 8, 11, and 17 are now compiled with Microsoft\u00ae Visual Studio 2022. The Visual Studio redistributable files included with the build are updated to match.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.43/#compiler-changes-for-linux","title":"Compiler changes for Linux","text":"

Linux x86 64-bit, Linux on POWER\u00ae LE 64-bit, and Linux on IBM Z\u00ae 64-bit builds on OpenJDK 8, 11, and 17 now use gcc 11.2 compiler. Linux AArch64 64-bit moved to gcc 10.3 compiler from gcc 7.5 compiler on OpenJDK 8 and 11.

On OpenJDK 19 and later, the Linux reference compiler was already updated to gcc 11.2 in release 0.37.0.

For more information, see Supported environments.

"},{"location":"version0.43/#change-in-the-large-page-memory-allocation-behavior","title":"Change in the large page memory allocation behavior","text":"

Earlier, the JIT code cache was allocated memory as a multiple of the available page size even if the configured large page size was greater than the total JIT code cache size.

Now, if the configured large page size is greater than the size of the total code cache for JIT, then the page size that is used for code cache allocation is recalculated. The next available lower page size on the platform is used for the code cache allocation.

For more information, see -Xlp:codecache.

"},{"location":"version0.43/#new-xx-criusecprovider-option-added","title":"New -XX:[+|-]CRIUSecProvider option added","text":"

When you enable CRIU support, all the existing security providers are removed from the security provider list during the checkpoint phase and CRIUSECProvider is added by default.

You can now control the use of CRIUSECProvider during the checkpoint phase with the -XX:[+|-]CRIUSecProvider option. You can use all the existing security providers instead of the CRIUSECProvider by specifying the -XX:-CRIUSecProvider option.

For more information, see -XX:[+|-]CRIUSecProvider.

"},{"location":"version0.43/#new-xxcompatibility-option-added","title":"New -XX:Compatibility option added","text":"

The Elasticsearch application was facing incompatibility issues when it was running on OpenJ9 and required many workarounds. With the -XX:Compatibility option, you can enable a compatibility mode that OpenJ9 can run in to support applications that require specific capabilities.

In release 0.43.0, the compatibility mode is provided for the Elasticsearch application only.

For more information, see -XX:Compatibility.

"},{"location":"version0.43/#new-xx-cpuloadcompatibility-option-added","title":"New -XX:[+|-]CpuLoadCompatibility option added","text":"

The getProcessCpuLoad() and getSystemCpuLoad() methods were returning -1 to indicate that the recent CPU usage is not available when these methods were called in OpenJ9 for the first time. It was difficult to identify whether the reason for the -1 value was an error or because the call was the first call and therefore, no recent CPU usage was available.

In OpenJDK, these methods return 0 value in the case of the first call, which makes it easier to differentiate between the first call behavior and an error that needs further investigation.

The -XX:+CpuLoadCompatibility option is used to enable the OpenJDK behavior of the getProcessCpuLoad() and getSystemCpuLoad() methods in OpenJ9 so that these methods return 0 when called in OpenJ9 for the first time.

For more information, see -XX:[+|-]CpuLoadCompatibility.

"},{"location":"version0.43/#support-added-for-the-comsunmanagementthreadmxbeangetthreadallocatedbytes-api-on-zos-platforms","title":"Support added for the com.sun.management.ThreadMXBean.getThreadAllocatedBytes() API on z/OS platforms","text":"

With this release, support for the com.sun.management.ThreadMXBean.getThreadAllocatedBytes() API is added on z/OS\u00ae platforms as well.

"},{"location":"version0.43/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.42.0 and v0.43.0 releases, see the Release notes.

"},{"location":"version0.44/","title":"Version 0.44.0","text":""},{"location":"version0.44/#whats-new-in-version-0440","title":"What's new in version 0.44.0","text":"

The following new features and notable changes since version 0.43.0 are included in this release:

"},{"location":"version0.44/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.44/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.44.0 supports OpenJDK 8, 11, 17, and 21.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.44/#change-in-behavior-of-the-djavasecuritymanager-system-property-for-openjdk-version-8","title":"Change in behavior of the -Djava.security.manager system property for OpenJDK version 8","text":"

From OpenJDK version 18 onwards, if you enable the SecurityManager at runtime by calling the System.setSecurityManager() API, you must set the -Djava.security.manager=allow option. To disable the SecurityManager, you must specify the -Djava.security.manager=disallow option. If an application is designed to run on multiple OpenJDK versions, the same command line might be used across multiple versions. Because of this use of the same command line across multiple versions, in OpenJDK versions before version 18, the runtime attempts to load a SecurityManager with the class name allow or disallow resulted in an error and the application was not starting.

To resolve this issue, OpenJDK version 17 ignores these options and from 0.41.0 release onwards, OpenJDK version 11 also ignores these options. With this release, OpenJDK version 8 too ignores the allow and disallow keywords, if specified.

"},{"location":"version0.44/#display-of-multiple-warnings-on-loading-the-same-agent-restricted-on-aix-systems","title":"Display of multiple warnings on loading the same agent restricted on AIX systems","text":"

Earlier, on AIX systems, warnings were issued each time the agents were loaded dynamically into a running VM after startup without specifying the -XX:+EnableDynamicAgentLoading option, even if the same agents were loaded before.

Now, from 0.44.0 release onwards, AIX systems, like other OpenJ9 supported operating systems, can detect whether an agent was previously loaded or not. Therefore, like other platforms, on AIX systems also, the warnings are issued only once for the same agent when the -XX:+EnableDynamicAgentLoading option is not specified.

For more information, see -XX:[+|-]EnableDynamicAgentLoading.

"},{"location":"version0.44/#xl-c-runtime-16107-or-later-required-for-aix-openj9-builds-on-openjdk-8","title":"XL C++ Runtime 16.1.0.7 or later required for AIX OpenJ9 builds on OpenJDK 8","text":"

AIX OpenJ9 builds now require version 16.1.0.7 or later of the IBM XL C++ Runtime on OpenJDK 8 as well.

"},{"location":"version0.44/#new-xx-showunmountedthreadstacks-option-added","title":"New -XX:[+|-]ShowUnmountedThreadStacks option added","text":"

Java\u2122 core file lists stacks of only those threads that are mapped to platform threads. An unmounted virtual thread is not mapped to any platform thread. Therefore, the stack of any unmounted virtual thread is not included in the Java core file and thus, the virtual thread information remains incomplete.

You can use the -XX:+ShowUnmountedThreadStacks option to include all the thread data that a VM is aware of, both regular Java threads and the unmounted virtual threads, in a Java core file.

For more information, see -XX:[+|-]ShowUnmountedThreadStacks.

"},{"location":"version0.44/#vmid-query-in-the-jcmd-tool-enhanced","title":"VMID query in the jcmd tool enhanced","text":"

Earlier in OpenJ9, when sending a jcmd command to a VM, you had to run jcmd -l to retrieve all the pids for all the VMs found on the machine. Then, you had to use jcmd [vmid] [command] to send the command to the specific VM.

For OpenJDK compatibility, OpenJ9 now supports direct use of the Java process name, full or partial, as the ID to send the jcmd command.

The jcmd tool also now supports specifying 0 as a VMID to target all VMs.

For more information, see Java diagnostic command (jcmd) tool.

"},{"location":"version0.44/#ddr-field-names-in-j9buildflags-changed","title":"DDR field names in J9BuildFlags changed","text":"

The Direct Dump Reader (DDR) code enables reading system dump data by using the OpenJ9 Diagnostic Tool Framework for Java (DTFJ) API or the jdmpview tool. DDR code uses fields of J9BuildFlags to access build flags in the system dump data. The names of J9BuildFlags fields changed over time and therefore, supporting system dumps with different build flags became a challenge.

Earlier, field names in J9BuildFlags were based on names defined in j9.flags. Now, when the J9BuildFlags is generated for each build, the flag names are those names that are specified in j9cfg.h (derived from j9cfg.h.ftl or j9cfg.h.in) instead of the names that are defined in j9.flags. For example, env_data64 is now referred to as J9VM_ENV_DATA64.

You can extend the DDR code, adding your own commands, by writing plug-ins. If the user plug-in code contains references to fields of J9BuildFlags to read the build flags in the system dump data, you must change references to use the names as specified in j9cfg.h.

"},{"location":"version0.44/#new-system-property-added-to-prevent-the-deletion-of-the-attach-api-control-files-within-the-tmp-folder","title":"New system property added to prevent the deletion of the Attach API control files within the /tmp/ folder","text":"

You can use the -Dcom.ibm.tools.attach.fileAccessUpdateTime system property to prevent Linux\u00ae systemd-tmpfiles from deleting the Attach API control files within the /tmp/ folder. By updating the Attach API control file access times to avoid deletion by systemd-tmpfiles, the long-running Attach API can continue to use the control files to operate. This system property enables Attach API to update the control file access times at specific intervals.

For more information, see -Dcom.ibm.tools.attach.fileAccessUpdateTime.

"},{"location":"version0.44/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.43.0 and v0.44.0 releases, see the Release notes.

"},{"location":"version0.45/","title":"Version 0.45.0","text":""},{"location":"version0.45/#whats-new-in-version-0450","title":"What's new in version 0.45.0","text":"

The following new features and notable changes since version 0.44.0 are included in this release:

"},{"location":"version0.45/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.45/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.45.0 supports OpenJDK 22.

OpenJDK 22 with Eclipse OpenJ9 is not a long term support (LTS) release.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.45/#new-jdk-22-features","title":"New JDK 22 features","text":"

The following features are supported by OpenJ9:

The following features are implemented in OpenJDK and available in any build of OpenJDK 22 with OpenJ9:

You can find the full list of features for JDK 22 at the OpenJDK project. Any remaining features that are listed either do not apply to OpenJ9 or are not implemented and hence not applicable to OpenJ9 in this release.

"},{"location":"version0.45/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.44.0 and v0.45.0 releases, see the Release notes.

"},{"location":"version0.46/","title":"Version 0.46.0","text":""},{"location":"version0.46/#whats-new-in-version-0460","title":"What's new in version 0.46.0","text":"

The following new features and notable changes since version 0.45.0 are included in this release:

"},{"location":"version0.46/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.46/#binaries-and-supported-environments","title":"Binaries and supported environments","text":"

Eclipse OpenJ9\u2122 release 0.46.0 supports OpenJDK 8, 11, 17, 21, and 22.

Support for running OpenJ9 with all versions of OpenJDK on CentOS 6, CentOS 7, Red Hat Enterprise Linux (RHEL) 6, and RHEL 7 is removed.

RHEL 8.6 and 9.0 are out of support. RHEL 8.8 is the new minimum operating system level.

To learn more about support for OpenJ9 releases, including OpenJDK levels and platform support, see Supported environments.

"},{"location":"version0.46/#md5-message-digest-algorithm-support-for-openssl","title":"MD5 message digest algorithm support for OpenSSL","text":"

OpenSSL native cryptographic support is added for the MD5 message digest algorithm, providing improved cryptographic performance. OpenSSL support is enabled by default. If you want to turn off support for the MD5 message digest algorithm, set the -Djdk.nativedigest system property to false.

"},{"location":"version0.46/#support-added-for-the-comsunmanagementthreadmxbeangettotalthreadallocatedbytes-api","title":"Support added for the com.sun.management.ThreadMXBean.getTotalThreadAllocatedBytes() API","text":"

With this release, the OpenJ9 VM implementation supports measurement of the total memory allocation for all threads (com.sun.management.ThreadMXBean.getTotalThreadAllocatedBytes() API).

The getTotalThreadAllocatedBytes() method now returns the total thread allocated bytes instead of -1.

"},{"location":"version0.46/#the-jitserver-aot-caching-feature-enabled-by-default-at-the-jitserver-server","title":"The JITServer AOT caching feature enabled by default at the JITServer server","text":"

-XX:+JITServerUseAOTCache is the default setting at the JITServer server now. That means that you don't have to specify the -XX:+JITServerUseAOTCache option at the server to enable the JITServer AOT caching feature.

Although this option is by default enabled at the server, it is still disabled for the JITServer clients. The clients that want to use the JITServer AOT caching, must still specify the -XX:+JITServerUseAOTCache option on the command line. Also, now the clients don't have to enable the shared classes cache feature to use the -XX:+JITServerUseAOTCache option.

For more information, see -XX:[+|-]JITServerUseAOTCache.

"},{"location":"version0.46/#the-extended-hot-code-replace-hcr-capability-disabled-and-xx-enableextendedhcr-option-added","title":"The extended Hot Code Replace (HCR) capability disabled and -XX:[+|-]EnableExtendedHCR option added","text":"

By default, the extended HCR capability in the VM is disabled for all OpenJDK versions, which is a change from the previous releases. You can enable the HCR capability by using the new option, -XX:+EnableExtendedHCR option.

The extended HCR feature is deprecated in this release and will be removed in a future release. From OpenJDK 25 onwards, extended HCR will not be supported. Following that, the extended HCR support will be removed from other earlier OpenJDK versions also.

"},{"location":"version0.46/#new-system-property-added-to-improve-jcmd-attaching-in-case-of-the-socketexception-error-on-windows-platform","title":"New system property added to improve jcmd attaching in case of the SocketException error on Windows platform","text":"

When the jcmd tool sends a command to a running VM, the command might throw the Socket Exception error on Windows platform. Instead of failing the attaching request, you can specify the number of times the tool retries attaching to the target VM with the new system property, -Dcom.ibm.tools.attach.retry.

"},{"location":"version0.46/#-xtgcallocation-report-includes-core-allocation-cache-statistics-per-thread","title":"-Xtgc:allocation report includes core allocation cache statistics per thread","text":"

The -Xtgc:allocation option prints thread-specific allocation cache (TLH) statistics in addition to the cumulative allocation statistics.

"},{"location":"version0.46/#known-problems-and-full-release-information","title":"Known problems and full release information","text":"

To see known problems and a complete list of changes between Eclipse OpenJ9 v0.45.0 and v0.46.0 releases, see the Release notes.

"},{"location":"version0.8/","title":"Version 0.8.0","text":""},{"location":"version0.8/#release-notes-version-080","title":"Release notes - version 0.8.0","text":"

Version 0.8.0 is the first release of Eclipse OpenJ9\u2122, as defined in the release plan.

This release supports OpenJDK Version 8 binaries at AdoptOpenJDK.net that contain the Eclipse OpenJ9 virtual machine.

For more information about supported platforms, and any issues and limitations, read the OpenJ9 GitHub release notes.

"},{"location":"version0.9/","title":"Version 0.9.0","text":""},{"location":"version0.9/#whats-new-in-version-090","title":"What's new in version 0.9.0","text":"

The following new features and notable changes from v.0.8.0 are included in this release:

"},{"location":"version0.9/#features-and-changes","title":"Features and changes","text":""},{"location":"version0.9/#binaries-and-supported-platforms","title":"Binaries and supported platforms","text":"

The following additional OpenJDK binaries that contain the Eclipse OpenJ9\u2122 VM are now available from the AdoptOpenJDK community:

Complete platform support information for OpenJ9 can be found in Supported environments

"},{"location":"version0.9/#idle-tuning-feature","title":"Idle tuning feature","text":"

The idle tuning feature in OpenJ9 keeps your memory footprint small by releasing unused memory back to the operating system. Prior to Eclipse version 0.9.0 this feature was available only on Linux x86 architectures with the gencon garbage collection policy. From version 0.9.0, this feature is now available on Linux for IBM POWER\u00ae and IBM Z\u00ae architectures. For more information about this feature, see the following command line options, which control this behavior:

The following blog post describes the benefits of using this feature: Are you still paying for unused memory when your Java app is idle?

"},{"location":"version0.9/#new-gc-policy","title":"New GC policy","text":"

A new GC policy is introduced for JEP 318: Epsilon: A No-Op Garbage Collector.

When this policy is enabled, the Java object heap is expanded in the normal way until the limit is reached, but memory is not reclaimed through garbage collection. When the limit is reached the VM shuts down.

This JEP has a number of use cases including short-lived applications and certain test scenarios.

To enable this policy you can use one of the following options:

"},{"location":"version0.9/#modifying-the-default-java-heap-size-for-applications-that-run-in-containers","title":"Modifying the default Java heap size for applications that run in containers","text":"

When using container technology, applications are typically run on their own and do not need to compete for memory. In this release, changes are introduced to detect when OpenJ9 is running inside a container. If your application is running in a container and you want the VM to allocate a larger fraction of memory to the Java heap, set the -XX:+UseContainerSupport option on the command line.

The following table shows the maximum Java heap size that gets set, depending on the memory available:

Physical memory <size> Maximum Java heap size Less than 1 GB 50% <size> 1 GB - 2 GB <size> - 512M Greater than 2 GB 75% <size>

The default heap size for containers only takes affect when running in a container environment and when -XX:+UseContainerSupport is specified, which is expected to be the default in a future release.

"},{"location":"version0.9/#specifying-the-maximum-java-heap-size-as-a-percentage-value","title":"Specifying the maximum Java heap size as a percentage value","text":"

OpenJ9 now supports setting the heap size as a percentage of the physical memory. The following OpenJDK options are recognized and can be set for the VM:

To understand how to set these options, see -XX:InitialRAMPercentage / -XX:MaxRAMPercentage.

If your application is running in a container and you have specified -XX:+UseContainerSupport, as described in Modifying the default Java heap size for applications that run in containers, both the default heap size for containers and the -XX:MaxRAMPercentage and -XX:InitialRAMPercentage options are based on the available container memory.

"},{"location":"version0.9/#shared-classes-support-for-nested-jar-files","title":"Shared classes support for nested jar files","text":"

Changes are made to the com.ibm.oti.shared API to support nested jar files.

"},{"location":"version0.9/#direct-dump-reader-enabled-on-linux-and-windows","title":"Direct Dump Reader enabled on Linux and Windows","text":"

Direct Dump Reader (DDR) support is now enabled for the OpenJ9 VM on all Linux architectures and on Windows. The DDR code enables the VM to read system dump data by using the OpenJ9 Diagnostic Tool Framework for Java (DTFJ) API or the jdmpview tool. If you use the Eclipse Memory Analyzer\u2122 tool (MAT), you can also analyze OpenJ9 or IBM VMs by installing the DTFJ plug-in. (Install from the Eclipse Help menu; Install New Software > Work with \"IBM Diagnostic Tool Framework for Java\" > IBM Monitoring and Diagnostic Tools > Diagnostic Tool Framework for Java)

You must use a 32-bit VM to look at a 32-bit core, and a 64-bit VM to look at a 64-bit core. This restriction will be fixed in a later version of OpenJ9.

"},{"location":"version0.9/#changes-to-the-javalangstring-class","title":"Changes to the java.lang.String class","text":"

To match the behavior of OpenJDK, java.lang.String no longer has a count field, which changes the way that String.subString() works compared to Java 8. String.subString() now copies the value array. Similarly, StringBuffer and StringBuilder do not share the value array with any String created by toString().

For performance and compatibility with the new String object layout, the OpenJ9 implementations of StringBuffer and StringBuilder have been deprecated in favor of the OpenJDK implementations.

"},{"location":"version0.9/#changes-to-the-sharedclasscacheinfo-class","title":"Changes to the SharedClassCacheInfo class","text":"

SharedClassCacheInfo.getCacheJVMLevel() used to return the JVMLEVEL constant that maps to a Java version number, for example JVMLEVEL_JAVA8. This call now returns only the Java version number, for example 10 for Java 10.

"},{"location":"version0.9/#new-jdk-9-features","title":"New JDK 9 features","text":"

The following features are supported by OpenJ9:

You can find the full list of features for JDK 9 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

"},{"location":"version0.9/#new-jdk-10-features","title":"New JDK 10 features","text":"

The following features are supported by OpenJ9:

You can find the full list of features for JDK 10 at the OpenJDK project. Any remaining features that are listed do not apply to OpenJ9.

"},{"location":"version0.9/#full-release-information","title":"Full release information","text":"

To see a complete list of changes between Eclipse OpenJ9 version 0.8.0 and version 0.9.0 releases, see the Release notes.

"},{"location":"vgclog/","title":"Verbose GC logs","text":""},{"location":"vgclog/#verbose-garbage-collection-logs","title":"Verbose garbage collection logs","text":"

Garbage collection (GC) reclaims used memory in the Java\u2122 object heap for reuse. During cleanup of the heap, the verbose GC logs, when enabled, capture information about the different GC operations that are involved in the GC cycles. GC operations aim to reorganize or reclaim memory.

Verbose GC logs contain information about GC operations to assist with the following actions:

Verbose GC logs, when enabled, begin capturing information as soon as GC is initialized.

To help you visualize and analyze the GC, you can feed verbose GC log files into various diagnostic tools and interfaces. Examples include tools such as Garbage Collection and Memory Visualizer (GCMV) and online services such as GCEasy.

For examples of log output, including guidance on how to analyze the logs, see Log examples.

A further diagnostic step is to run one or more traces on GC activity by using the -Xtgc option. Trace output provides more granular information to help diagnose GC problems or perform finer tuning.

"},{"location":"vgclog/#how-to-generate-a-verbose-gc-log","title":"How to generate a verbose GC log","text":"

You can enable verbose GC logs by specifying the -verbose:gc standard option when you start your application. For more information, see standard command-line options.

The output of -verbose:gc is printed to STDERR by default. To print the log output to a file, append the -Xverbosegclog option. You can also use this option to print to a succession of files, where each file logs a specified number of GC cycles.

"},{"location":"vgclog/#verbose-gc-log-contents-and-structure","title":"Verbose GC log contents and structure","text":"

The verbose GC logs are printed in XML format and consist of the following sections:

For definitions of GC cycles and operations, see Garbage collection. For definitions of GC increments, see GC increments and interleaving.

The logs record when GC cycles and their increments start and end, and list the GC operations that run within these increments to manage or reclaim memory. You can also determine which type of event triggered the cycle or increment, and the amount of memory available to your application before and after processing.

"},{"location":"vgclog/#initialization","title":"Initialization","text":"

The log begins by recording the configuration of the Eclipse OpenJ9\u2122 runtime virtual environment (VM) and details of the GC configuration(GC). The configuration is recorded by using child elements of the <initialized> element, for example:

\n<initialized id=\"1\" timestamp=\"2020-10-18T13:27:07.691\">\n  <attribute name=\"gcPolicy\" value=\"-Xgcpolicy:gencon\" />\n  <attribute name=\"maxHeapSize\" value=\"0x40000000\" />\n  <attribute name=\"initialHeapSize\" value=\"0x40000000\" />\n  <attribute name=\"compressedRefs\" value=\"true\" />\n  <attribute name=\"compressedRefsDisplacement\" value=\"0x0\" />\n  <attribute name=\"compressedRefsShift\" value=\"0x0\" />\n  <attribute name=\"pageSize\" value=\"0x1000\" />\n  <attribute name=\"pageType\" value=\"not used\" />\n  <attribute name=\"requestedPageSize\" value=\"0x1000\" />\n  <attribute name=\"requestedPageType\" value=\"not used\" />\n  <attribute name=\"gcthreads\" value=\"4\" />\n  <attribute name=\"gcthreads Concurrent Mark\" value=\"1\" />\n  <attribute name=\"packetListSplit\" value=\"1\" />\n  <attribute name=\"cacheListSplit\" value=\"1\" />\n  <attribute name=\"splitFreeListSplitAmount\" value=\"1\" />\n  <attribute name=\"numaNodes\" value=\"0\" />\n  <system>\n    <attribute name=\"physicalMemory\" value=\"100335456256\" />\n    <attribute name=\"numCPUs\" value=\"28\" />\n    <attribute name=\"architecture\" value=\"amd64\" />\n    <attribute name=\"os\" value=\"Linux\" />\n    <attribute name=\"osVersion\" value=\"3.10.0-1160.el7.x86_64\" />\n  </system>\n  <vmargs>\n    <vmarg name=\"-Dfile.encoding=bestfit936\" />\n    ...\n    <vmarg name=\"-Xms1024m\" />\n    <vmarg name=\"-Xmx1024m\" />\n    ...\n    <vmarg name=\"-Xverbosegclog:verbosegc.xml\" />\n    ...\n  </vmargs>\n</initialized>\n

The first set of <attribute> elements records the configuration of the garbage collector, such as the GC policy type, configuration of the Java object heap, and the number of threads that are used for garbage collection. For example, the GCThreads attribute records that the garbage collector is configured to use four threads.

The <system> section records information about the operating system and available hardware, such as the physical memory, number of CPUs, and operating system type and version. In the example, the VM is running on Linux\u00ae amd64 V3.10 and has access to 28 CPUs and over 100 GB.

The <vmargs> section records any VM configuration command-line options (VM arguments) that are specified. The following types of options are recorded:

These command-line options can be set by using the command line, or by passing a manifest file, options file, or environment variable to the VM.

After the configurations are recorded in the Initialization section, the verbose GC log begins recording GC activities and details.

"},{"location":"vgclog/#gc-cycles","title":"GC cycles","text":"

The start of a GC cycle is recorded by the <cycle-start> XML element. The trigger for the start of a GC cycle is captured in a preceding element to the <cycle-start> element. A GC cycle or GC increment is triggered for one of the following reasons:

The following XML structure is an example of the verbose GC logs that are generated from the Generational Concurrent GC policy (-Xgcpolicy:gencon). In this example, the lines are indented to help illustrate the flow and attributes and some child elements are omitted for clarity:

    <exclusive-start/>\n\n      <af-start/>\n\n        <cycle-start/>\n\n          <gc-start>\n\n            <mem-info>\n\n              <mem/>\n\n            </mem-info>\n\n          </gc-start>\n\n          <allocation-stats/>\n\n              <gc-op/>\n\n          <gc-end>\n\n            <mem-info>\n\n              <mem/>\n\n            </mem-info>\n\n          </gc-end>\n\n        <cycle-end/>\n\n        <allocation-satisfied/>\n\n      <af-end/>\n\n    <exclusive-end/>\n

Some elements serve as markers for starting and ending parts of the GC cycle and do not contain child elements, while other elements do contain child elements. In this example, the <af-start/>, <cycle-start/>, <cycle-end/>, <allocation-satisfied/>, and <af-end/> XML elements are empty and contain only attributes. All other XML elements contain child XML elements, which are omitted from this simplified example. For detailed examples of log output for a specific cycle, see Log examples).

"},{"location":"vgclog/#gc-increments-and-interleaving","title":"GC increments and interleaving","text":"

Some GC cycle types are run in piecemeal blocks of operations called GC increments. Using GC increments reduces pause times by enabling blocks of operations or operation steps to interleave with operations or operation steps from other types of cycle.

For example, consider the garbage collector for the gencon policy, which uses partial cycles and global cycles. The partial cycle consists of just 1 GC operation, scavenge, that runs on the nursery area during a stop-the-world (STW) pause. However, the gencon global cycle, which runs when the tenure area is close to full, is split into three increments. The initial and final global cycle increments run during a relatively short STW pause. The intermediate global cycle increment, which consists of the majority of the GC cycle's work, runs its GC operations concurrently.

Splitting the global cycle operations into these increments reduces pause times by running most of the GC operations concurrently with application threads. The gencon global cycle's concurrent increment is paused when a gencon partial GC cycle is triggered and resumes when the partial cycle, or multiple partial cycles, complete. In this way, a global cycle can progress while other types of cycle are run by pausing and resuming the concurrent work. In some policies, concurrent operations are split further into multiple concurrent increments for better control of progress of the concurrent operation.

You can see this interleaving of the increments in the verbose GC log. The following table illustrates how the interleaving of the gencon policy's partial scavenge and global cycles appears in the logs. Line numbers of an example gencon policy's verbose GC log are displayed, alongside columns that show the status of each cycle that is recorded in the logs. (for clarity, not all GC activities are listed):

Table showing how the `gencon` policy's global and partial scavenge cycles, which interleave with each other, are recorded in an example log. Example log line number `gencon` global GC cycle status recorded in log `gencon` partial GC cycle status recorded in log 1-87 Initialization section of the logs 87-51676 - series of partial scavenge cycles start and finish 51677 global cycle's trigger and target logged - 51680 STW pause starts - 51683 global cycle starts - 51684 STW pause ends - 518685 blank line in logs. (Concurrent increment runs) - 51686 (concurrent increment paused) STW pause starts 51690 (concurrent increment paused) partial scavenge cycle starts 51691 (concurrent increment paused) partial scavenge increment runs 51730 (concurrent increment paused) partial cycle ends 51733 (concurrent increment resumes) STW pause ends 51734 blank line in logs. (Concurrent increment resumes) - 51735 STW pause starts - 51741 final global increment logged - 51793 global cycle ends - 51795 STW pause ends -

Note: Zero, one, or multiple GC cycles might run between the start and end of a gencon global GC cycle.

The XML elements and attribute values that define operations and increments of a particular cycle are specific to the policy and type of cycle. To follow how the different cycle's increments interleave in a log, you can locate the elements and attributes that record the increments and operations that belong to a particular type of cycle. For example, for the gencon policy, you can locate the start of the intermediate, concurrent increment of the global cycle by searching for the <concurrent-kickoff> element.

For more information about the XML elements and attribute values that are used for a particular type of cycle for a particular policy, and examples of log output, see Log examples.

You can determine the GC increments and operations that are associated with a particular instance of a cycle by using the contextid and id attributes:

  1. Determine the ID of the GC cycle: find the value of the id attribute of the <cycle-start> element that denotes the start of the GC cycle. Note: the id attribute increases incrementally with each GC event.
  2. Search for the contextid attribute values that match the GC cycle's ID. All GC increments, operations, and concurrent events that are associated with a particular cycle have a contextid attribute whose value matches the GC cycle's ID.
"},{"location":"vgclog_examples/","title":"Log examples","text":""},{"location":"vgclog_examples/#log-examples","title":"Log examples","text":"

To help you understand how garbage collection (GC) processes memory for your application and how these processes are recorded, a number of annotated log examples are provided from different GC policies. Each example covers a particular type of cycle from a particular policy. By following the examples, you can learn how to interpret the XML elements in a log.

"},{"location":"vgclog_examples/#gencon-examples","title":"gencon examples","text":"

The gencon policy uses two types of cycle; a partial GC cycle and a global GC cycle. By default, the partial GC cycle runs a stop-the-world (STW) scavenge operation. On specific platforms, gencon can run a concurrent scavenge operation (-Xgc:concurrentScavenge) instead, if enabled at run time.

The start of a gencon cycle is recorded in the log by the following elements and attributes:

Table showing types of gencon cycle along with the corresponding trigger reason and XML elements for each type. GC cycle Value of type attribute of the <cycle-start> and <cycle-end>elements Element that logs the cycle trigger Trigger reason Global global <concurrent-kickoff> Low free memory tenure area threshold reached. Cycle trigger element is located before the <cycle-start> element. Partial scavenge <af-start> Allocation failure. Cycle trigger element is located before the <cycle-start> element.

You can use the type attribute of the <gc-start> and <gc-end> elements to locate a particular cycle. You can also locate a particular type of cycle by searching for the element that records the cycle trigger, which is located before the <cycle-start> element.

You can analyze the increments and operations that are associated with a particular type of cycle by locating and interpreting the elements in the following table:

Table showing increments and operations that are associated with the gencon partial scavenge and global cycles. GC process Elements that log the start and end of the event Details GC cycle <cycle-start>, <cycle-end> The start and end of a GC cycle. GC STW increment <gc-start>, <gc-end> The start and end of a GC increment that begins with a pause. GC STW increment <concurrent-kickoff> The start of the initial GC increment of the global concurrent cycle that begins the initial mark operation. GC STW increment <concurrent-global-final> The start of the final GC increment of the global concurrent cycle that executes the final collection. GC operations and suboperations <gc-op> A GC operation such as mark or sweep, or a suboperation such as class unload.

Note: For more information about the XML structure of GC cycles, see GC cycles. For more information about GC cycle increments, see GC increments and interleaving.

The following examples use log excerpts to show how the different types of gencon cycle are logged.

"},{"location":"vgclog_examples/#scavenge-partial-gc-cycle","title":"Scavenge partial GC cycle","text":"

The following example is taken from a gencon log. The output is broken down into sections with supporting text to explain the GC processing that is taking place.

To search for a scavenge partial GC cycle, you can search for the type attribute value scavenge in cycle-start and cycle-end elements, or search for the <af> element that logs the allocation failure trigger.

By default, the gencon partial GC cycle runs by using a single STW pause. The cycle performs only one operation, a scavenge operation, which runs only on the nursery area. The cycle consists of a single GC increment, which is labeled by using the elements that are shown in the following table:

Table showing the gencon default partial scavenge cycle's GC increment and corresponding XML elements. GC operation GC increment STW or concurrent XML element of GC increment Details scavenge single STW <gc-start>, <gc-end> Contains detailed information about copied objects and the weak roots processing operation

The scavenge partial GC cycle follows a general structure in the verbose GC log as shown. Some elements are omitted for clarity:

\n<exclusive-start/>          (STW Pause starts)\n\n<af-start/>                 (allocation failure trigger recorded)\n\n<cycle-start/>              (scavenge cycle starts)\n\n<gc-start>                  (scavenge cycle increment starts)\n\n<mem-info>                  (memory status before operation)\n\n<mem></mem>                 (status of different areas of heap)\n\n</mem-info>\n\n</gc-start>\n\n<allocation-stats/>         (Snapshot of how memory was divided up between\n                            ... application threads before current cycle started)\n\n<gc-op> \u201cscavenge\"</gc-op>  (scavenge operation completed)\n\n<gc-end>                    (scavenge cycle increment ends)\n\n<mem-info>                  (memory status after operation)\n\n<mem></mem>                 (status of different areas of heap)\n\n</mem-info>\n\n</gc-end>\n\n</cycle-end>                (scavenge cycle ends)\n\n<allocation-satisfied/>     (required allocation has been achieved)\n\n<af-end/>\n\n<exclusive-end>             (STW for scavenge cycle ends)\n...\n\n

The first activity in the cycle is recorded by an <exclusive-start> element, which indicates the start of the STW pause. Application (or mutator) threads are halted to give the garbage collector exclusive access to the Java\u2122 object heap:

<!-- Start of gencon scavenge partial GC cycle example -->\n\n<exclusive-start id=\"12392\" timestamp=\"2020-10-18T13:35:45.000\" intervalms=\"406.180\">\n  <response-info timems=\"0.070\" idlems=\"0.070\" threads=\"0\" lastid=\"00000000013D6900\" lastname=\"LargeThreadPool-thread-68\" />\n</exclusive-start>\n

The <af-start> element indicates that the cycle was triggered by an allocation failure in the nursery (type=\"nursery\") area of the heap:

<af-start id=\"12393\" threadId=\"00000000013D7280\" totalBytesRequested=\"8200\" timestamp=\"2020-10-18T13:35:45.000\" intervalms=\"418.233\" type=\"nursery\" />\n

The <cycle-start> element marks the start of the cycle. The attribute type=\"scavenge\" confirms that this activity is a scavenge partial GC cycle:

<cycle-start id=\"12394\" type=\"scavenge\" contextid=\"0\" timestamp=\"2020-10-18T13:35:45.000\" intervalms=\"418.231\" />\n

Most elements are labeled with an id attribute that increases in value incrementally, atimestamp attribute, and a contextid attribute. All elements that record GC increments and operations that are associated with a particular cycle have a contextid value that matches the id value of the cycle. The <cycle-start> element of this example cycle has an id=\"12394\", so all subsequent elements that have a contextid=\"4\", such as the <gc-start> increment element and the <gc-op> operation element, are associated with this particular example cycle.

The <gc-start> element records the first GC increment. In this <gc-start> section, you can find information about the amount of memory available (<mem-info>) and where it is located in the Java object heap.

The memory snapshot within the <gc-start> element is taken before the scavenge operation and can be compared with a similar snapshot that is taken afterward to understand the effect on the heap.

<gc-start id=\"12395\" type=\"scavenge\" contextid=\"12394\" timestamp=\"2020-10-18T13:35:45.000\">\n  <mem-info id=\"12396\" free=\"414960320\" total=\"1073741824\" percent=\"38\">\n    <mem type=\"nursery\" free=\"0\" total=\"268435456\" percent=\"0\">\n      <mem type=\"allocate\" free=\"0\" total=\"241565696\" percent=\"0\" />\n      <mem type=\"survivor\" free=\"0\" total=\"26869760\" percent=\"0\" />\n    </mem>\n    <mem type=\"tenure\" free=\"414960320\" total=\"805306368\" percent=\"51\">\n      <mem type=\"soa\" free=\"374694592\" total=\"765040640\" percent=\"48\" />\n      <mem type=\"loa\" free=\"40265728\" total=\"40265728\" percent=\"100\" />\n    </mem>\n    <remembered-set count=\"21474\" />\n  </mem-info>\n</gc-start>\n

The following statements describe the object heap memory allocation at the start of the increment:

The next element <allocation-stats> shows a snapshot, which was taken before the cycle started, of how memory was divided up between application threads. In this example, the thread that used the most memory was LargeThreadPool-thread-79.

<allocation-stats totalBytes=\"235362176\" >\n  <allocated-bytes non-tlh=\"32880\" tlh=\"235329296\" />\n  <largest-consumer threadName=\"LargeThreadPool-thread-79\" threadId=\"00000000013F0C00\" bytes=\"6288544\" />\n</allocation-stats>\n

The scavenge GC operation is recorded by the <gc-op> element; child elements record details about the operation. For example,

<gc-op id=\"12397\" type=\"scavenge\" timems=\"11.649\" contextid=\"12394\" timestamp=\"2020-10-18T13:35:45.012\">\n  <scavenger-info tenureage=\"7\" tenuremask=\"4080\" tiltratio=\"89\" />\n  <memory-copied type=\"nursery\" objects=\"154910\" bytes=\"6027440\" bytesdiscarded=\"394832\" />\n  <memory-copied type=\"tenure\" objects=\"16171\" bytes=\"562848\" bytesdiscarded=\"3064\" />\n  <ownableSynchronizers candidates=\"10838\" cleared=\"10824\" />\n  <references type=\"soft\" candidates=\"24\" cleared=\"0\" enqueued=\"0\" dynamicThreshold=\"16\" maxThreshold=\"32\" />\n  <references type=\"weak\" candidates=\"390\" cleared=\"269\" enqueued=\"269\" />\n  <references type=\"phantom\" candidates=\"1\" cleared=\"0\" enqueued=\"0\" />\n  <object-monitors candidates=\"132\" cleared=\"0\"  />\n</gc-op>\n

The <memory-copied> element indicates that 5.75 MB (6,027,440B) of reachable objects were moved by the scavenge operation from the allocate space to the survivor space in the nursery area, and 0.54 MB(562,848 B) were moved to the tenure area.

The <scavenger-info> element shows that the tenure age is set to 7. Any object in the allocate space with an age less than or equal to 7 is copied to the survivor space during this scavengeoperation. Any object that is copied between the allocate and survivor areas more than 7 times is moved to the tenure area.

For more information about how the scavenge operation acts on the Java object heap, see GC processing.

The end of the increment is recorded with <gc-end> and provides another snapshot of memory allocation on the heap, similar to <gc-start>.

<gc-end id=\"12398\" type=\"scavenge\" contextid=\"12394\" durationms=\"11.785\" usertimems=\"46.278\" systemtimems=\"0.036\" stalltimems=\"0.145\" timestamp=\"2020-10-18T13:35:45.012\" activeThreads=\"4\">\n  <mem-info id=\"12399\" free=\"649473560\" total=\"1073741824\" percent=\"60\">\n    <mem type=\"nursery\" free=\"235142120\" total=\"268435456\" percent=\"87\">\n      <mem type=\"allocate\" free=\"235142120\" total=\"241565696\" percent=\"97\" />\n      <mem type=\"survivor\" free=\"0\" total=\"26869760\" percent=\"0\" />\n    </mem>\n    <mem type=\"tenure\" free=\"414331440\" total=\"805306368\" percent=\"51\" macro-fragmented=\"0\">\n      <mem type=\"soa\" free=\"374065712\" total=\"765040640\" percent=\"48\" />\n      <mem type=\"loa\" free=\"40265728\" total=\"40265728\" percent=\"100\" />\n    </mem>\n    <pending-finalizers system=\"0\" default=\"0\" reference=\"269\" classloader=\"0\" />\n    <remembered-set count=\"13792\" />\n  </mem-info>\n</gc-end>\n

The Java object heap memory allocation at the end of the increment is as follows:

The scavenge operation successfully reclaimed memory in the allocate space of the nursery area by copying objects from the allocate space into the survivor space of the nursery area, and copying objects from the survivor space into the tenure area.

The cycle ends (<cycle-end>). The following <allocation-satisfied> element indicates that the allocation request that caused the allocation failure can now complete successfully. The STW pause ends with the <exclusive-end> element:

<cycle-end id=\"12400\" type=\"scavenge\" contextid=\"12394\" timestamp=\"2020-10-18T13:35:45.012\" />\n<allocation-satisfied id=\"12401\" threadId=\"00000000013D6900\" bytesRequested=\"8200\" />\n<af-end id=\"12402\" timestamp=\"2020-10-18T13:35:45.012\" threadId=\"00000000013D7280\" success=\"true\" from=\"nursery\"/>\n<exclusive-end id=\"12403\" timestamp=\"2020-10-18T13:35:45.012\" durationms=\"12.319\" />\n\n<!-- End of gencon partial GC cycle example -->\n
"},{"location":"vgclog_examples/#summary","title":"Summary","text":"

Analyzing the structure and elements of this example log output shows that this example global cycle has the following characteristics:

"},{"location":"vgclog_examples/#concurrent-scavenge-partial-gc-cycle-non-default","title":"Concurrent scavenge partial GC cycle (non-default)","text":"

When concurrent scavenge mode is enabled, the partial GC cycle is run as a Concurrent Scavenge cycle. This partial GC cycle is divided into increments to enable the majority of the scavenge operation to run concurrently with running application (or mutator) threads. The concurrent increment can run while application threads run, and also while the intermediate concurrent increment of the global GC cycle runs. The interleaving of the concurrent scavenge partial GC cycle with the global cycle can be seen in the logs.

The following elements log the GC increments and operations of the concurrent scavenge partial GC cycle:

Table showing the gencon concurrent (non-default) partial scavenge cycle's GC increment and corresponding XML elements. GC operation GC increment STW or concurrent XML element of GC increment Details scavenge initial STW <gc-start>, <gc-end> Root scanning, reported as a single scavenge operation. scavenge intermediate concurrent <concurrent-start>, <concurrent-end> Live objects are traversed and evacuated (*copy forward*). Operation is reported as a scavenge operation. scavenge final STW <gc-start>, <gc-end> weak roots scanning, reported as a complex scavenge operation. <gc-op> contains specific details for each of the weak root groups.

To search for a concurrent scavenge partial GC cycle, you can search for the type attribute value scavenge in cycle-start and cycle-end elements, or search for the <af> element that logs the allocation failure trigger.

You can locate the concurrent scavenge partial cycle's concurrent increment by searching for <concurrent-start> and <concurrent-end>. The global cycle's intermediate concurrent increment, which can run at the same time, is not logged by an element, but begins immediately after application threads are restarted following the <cycle-start type=\"global\"/> element. For more information about the global cycle's intermediate concurrent increment, see gencon global GC cycle. For more information about GC increments, see GC increments and interleaving.

"},{"location":"vgclog_examples/#gencon-global-gc-cycle","title":"gencon global GC cycle","text":"

The following example shows how a global GC cycle is recorded in a gencon policy verbose GC log. The output is broken down into sections with supporting text to explain the GC processing that is taking place.

The global GC cycle runs when the tenure area is close to full, which typically occurs after many partial cycles. As such, the output can be found part way down a full log. For more information about the GC initialization section, see Initialization . For an example log output for a gencon partial cycle, see Scavenge partial GC cycle.

The global GC cycle is split into three increments, as shown in GC increments and interleaving. Splitting the cycle operations into the following increments reduces pause times by running the majority of the GC work concurrently. The concurrent increment pauses when a partial GC cycle is triggered and resumes after the partial cycle, or multiple cycles, finish. The interleaving of partial GC cycles with the global cycle's intermediate concurrent increment can be seen in the following gencon global GC cycle log output. A single partial GC cycle is logged between the initial and final increments of the global cycle.

To search for a global cycle, you can search for the type attribute value global in cycle-start and cycle-end elements, or search for the element that logs the initial concurrent increment, <concurrent-kickoff>.

The following elements log the GC increments and operations of the global GC cycle:

Table showing the gencon global cycle's GC increment and corresponding XML elements. GC operation GC increment STW or concurrent XML element of GC increment Details n/a - initiates cycle initial STW <concurrent-kickoff> No <gc-op> is logged. This increment just initiates the concurrent mark increment. concurrent mark intermediate concurrent none <concurrent-trace-info> records the progress of the concurrent mark increment. final collection final STW <concurrent-global-final> The increment is typically triggered when a card cleaning threshold is reached. The completion of a tracing phase can also trigger the increment. Operations include a final concurrent mark, a sweep, and an optional class unload and compact.

The global GC cycle follows a general structure in the verbose GC log. Some child elements are omitted for clarity. Multiple partial GC cycles can start and finish between the start and end of a global GC cycle. In the following example, the structure includes a single partial GC cycle within the global cycle:

\n<concurrent-kickoff/>       (global cycle 1st increment recorded)\n\n<exclusive-start/>          (STW pause starts)\n\n<cycle-start/>              (global cycle starts)\n\n<exclusive-end/>            (STW pause ends)\n\n(mutator threads running, global cycle concurrent increment running concurrently)\n\n\n<exclusive-start/>          (STW for partial GC cycle starts)\n\n\n...                         (partial GC cycle starts and completes)\n\n\n<exclusive-end/>            (STW for partial GC cycle ends)\n\n(mutator threads running, global cycle concurrent increment running concurrently)\n\n<exclusive-start/>          (STW pause starts)\n\n<concurrent-global-final/>  (global cycle final increment recorded)\n\n<gc-start/>                 (global cycle final increment starts)\n\n<allocation-stats/>         (Snapshot of how memory was divided up between\n                            ... application threads before current cycle started)\n\n<mem-info>                  (memory status before operations)\n\n<mem></mem>                 (status of different areas of heap)\n\n</mem-info>\n\n</gc-start>\n\n<gc-op> \u201ctype=rs-scan\"</gc-op>        (remembered set scan completed)\n\n<gc-op>\u201dtype=card-cleaning\" </gc-op>  (card cleaning completed)\n\n<gc-op> \u201ctype=mark\u201d</gc-op>           (final mark operation and weak roots processing completed)\n\n<gc-op> \u201ctype=classunload\u201d</gc-op>    (class unload operation completed)\n\n<gc-op \u201dtype=sweep\u201d />                (sweep operation completed)\n\n<gc-end>                     (global cycle final increment ends)\n\n<mem-info>                   (memory status after operations)\n\n<mem></mem>                  (status of different areas of heap)\n\n</mem-info>\n\n</gc-end>\n\n</cycle-end>                 (global cycle ends)\n\n<exclusive-end>              (STW pause ends)\n\n<exclusive-start>            (STW pause starts)\n...\n\n

The first activity in the cycle is recorded by a <concurrent-kickoff> element, which records the start of the first of three increments that make up a gencon global GC cycle. The <concurrent-kickoff> element records the following information:

<concurrent-kickoff id=\"12362\" timestamp=\"2020-10-18T13:35:44.341\">\n\n<kickoff reason=\"threshold reached\" targetBytes=\"239014924\" thresholdFreeBytes=\"33024922\" remainingFree=\"32933776\" tenureFreeBytes=\"42439200\" nurseryFreeBytes=\"32933776\" />\n\n</concurrent-kickoff>\n

For this example, the remainingFree bytes value of 31.4 MB (32,933,776B) is approaching the thresholdFreeBytes value of 31.5 MB (33,024,922B) so a global cycle is triggered.

This cycle aims to trace 228 MB (239,014,924B) during the concurrent increment. If the concurrent increment is interrupted by a card cleaning threshold value before it traces all 228 MB, the final STW increment completes the tracing during the STW pause.

Note: To analyze specific parts of a cycle, you can search for the elements that mark a specific increment of the cycle. For example, you can search for the element to locate the final increment of the gencon global cycle. See the details of a particular cycle, such as the gencon global GC cycle, to determine the element names for particular STW or concurrent GC increments or operations.

The next element recorded in the log, the <exclusive-start>element, records the start of an STW pause:

<exclusive-start id=\"12363\" timestamp=\"2020-10-18T13:35:44.344\" intervalms=\"342.152\">\n\n<response-info timems=\"0.135\" idlems=\"0.068\" threads=\"3\" lastid=\"00000000015DE600\" lastname=\"LargeThreadPool-thread-24\" />\n\n</exclusive-start>\n

The following <gc-start> element records details of the start of a new cycle.

<cycle-start id=\"12364\" type=\"global\" contextid=\"0\" timestamp=\"2020-10-18T13:35:44.344\" intervalms=\"516655.052\" />\n

The type attribute records the cycle as a global cycle. The contextid of the cycle is, which indicates that all GC events that are associated with this cycle are tagged in relation to the id of this cycle. In particular, all subsequent elements that are associated with this particular example cycle have a contextid value equal to the <cycle-start> id attribute value of \u201c12634\u201d.

The next element in the log is <exclusive-end>, which records the end of the STW pause:

<exclusive-end id=\"12365\" timestamp=\"2020-10-18T13:35:44.344\" durationms=\"0.048\" />\n

The operations and suboperations of the second increment of the gencon global cycle are now running concurrently.

The next section of the logs records an STW pause that is associated with an allocation failure. The <cycle-start> element that follows this STW pause indicates that the cycle is a scavenge cycle, which is the partial GC cycle that is used by the gencon GC:

...\n<cycle-start id=\"12368\" type=\"scavenge\" contextid=\"0\" timestamp=\"2020-10-18T13:35:44.582\" intervalms=\"580.047\" />\n...\n

Subsequent elements have a contextid=\u201c12368\u201d, which matches the id of this new scavengecycle. For more information about how this cycle is recorded in the logs, see Scavenge partial GC cycle.

The operations and suboperations of the second, concurrent increment of the gencon global cycle are paused while the STW scavenge operation is running, and resume when the STW pause finishes.

After the partial GC cycle completes and the STW pause finishes, the log records a new STW pause, which is triggered to enable the final gencon global GC increment to run. This final increment finishes marking the nursery area and completes the global cycle. The <exclusive-start> element is followed by a <concurrent-global-final> element, which logs the beginning of this final increment (and by implication, the end of the second increment).

<exclusive-start id=\"12378\" timestamp=\"2020-10-18T13:35:44.594\" intervalms=\"12.075\">\n\n<response-info timems=\"0.108\" idlems=\"0.040\" threads=\"3\" lastid=\"00000000018D3800\" lastname=\"LargeThreadPool-thread-33\" />\n\n</exclusive-start>\n\n<concurrent-global-final id=\"12379\" timestamp=\"2020-10-18T13:35:44.594\" intervalms=\"516905.029\" >\n\n<concurrent-trace-info reason=\"card cleaning threshold reached\" tracedByMutators=\"200087048\" tracedByHelpers=\"12164180\" cardsCleaned=\"4966\" workStackOverflowCount=\"0\" />\n\n</concurrent-global-final>\n

The reason attribute of the <concurrent-trace-info> child element indicates that this final STW increment of the global cycle was triggered because a card-cleaning threshold was reached. The concurrent tracing was stopped prematurely and the targetBytes concurrent tracing target, recorded at the cycle start by <concurrent-kickoff>, was not achieved concurrently. If the concurrent tracing completes without interruption, the <concurrent-trace-info element logs reason=tracing completed.

In the next section that begins with the gc-start element, you can find information about the amount of memory available (<mem-info>) and where it is located in the java object heap. This snapshot is taken before the final increment's operations and suboperations are run and can be compared with a similar snapshot that is taken afterward to understand the effect on the heap. The child element attribute values of the<mem> and <mem-info> elements indicate the status of the memory.

Note: You can double check that the increment is associated with the GC global cycle in the example by checking the contextid attribute value matches the id=12364 attribute value of the cycle's element.

<gc-start id=\"12380\" type=\"global\" contextid=\"12364\" timestamp=\"2020-10-18T13:35:44.594\">\n\n<mem-info id=\"12381\" free=\"277048640\" total=\"1073741824\" percent=\"25\">\n\n<mem type=\"nursery\" free=\"234609440\" total=\"268435456\" percent=\"87\">\n\n<mem type=\"allocate\" free=\"234609440\" total=\"241565696\" percent=\"97\" />\n\n<mem type=\"survivor\" free=\"0\" total=\"26869760\" percent=\"0\" />\n\n</mem>\n\n<mem type=\"tenure\" free=\"42439200\" total=\"805306368\" percent=\"5\">\n\n<mem type=\"soa\" free=\"2173472\" total=\"765040640\" percent=\"0\" />\n\n<mem type=\"loa\" free=\"40265728\" total=\"40265728\" percent=\"100\" />\n\n</mem>\n\n<pending-finalizers system=\"0\" default=\"0\" reference=\"405\" classloader=\"0\" />\n\n<remembered-set count=\"17388\" />\n\n</mem-info>\n\n</gc-start>\n\n<allocation-stats totalBytes=\"827488\" >\n\n<allocated-bytes non-tlh=\"96\" tlh=\"827392\" />\n\n<largest-consumer threadName=\"LargeThreadPool-thread-68\" threadId=\"00000000013D6900\" bytes=\"65632\" />\n\n</allocation-stats>\n

The next element <allocation-stats> shows a snapshot of how memory was divided up between application threads before the current cycle started. In this example, the thread that used the most memory was LargeThreadPool-thread-68.

For this example, at the start of this GC increment, the tenure area is low on free memory, as expected. 25% of the total heap is available as free memory, which is split between the following areas of the heap:

The <gc-op> elements and their child elements contain information about the operations and suboperations in the increment. The final increment of the gencon global cycle consists of multiple operations, each logged with a <gc-op> element. The type of operation is shown by the <gc-op> type attribute. The final increment of the example log runs five types of operation:

  1. rs-scan
  2. card-cleaning
  3. mark
  4. classunload
  5. sweep

Note: The final increment of a gencon global cycle can include an optional compact suboperation.

For more information about the different types of GC operation, see GC operations.

<gc-op id=\"12382\" type=\"rs-scan\" timems=\"3.525\" contextid=\"12364\" timestamp=\"2020-10-18T13:35:44.598\">\n\n<scan objectsFound=\"11895\" bytesTraced=\"5537600\" workStackOverflowCount=\"0\" />\n\n</gc-op>\n\n<gc-op id=\"12383\" type=\"card-cleaning\" timems=\"2.910\" contextid=\"12364\" timestamp=\"2020-10-18T13:35:44.601\">\n\n<card-cleaning cardsCleaned=\"3603\" bytesTraced=\"5808348\" workStackOverflowCount=\"0\" />\n\n</gc-op>\n\n<gc-op id=\"12384\" type=\"mark\" timems=\"6.495\" contextid=\"12364\" timestamp=\"2020-10-18T13:35:44.607\">\n\n<trace-info objectcount=\"1936\" scancount=\"1698\" scanbytes=\"61200\" />\n\n<finalization candidates=\"389\" enqueued=\"1\" />\n\n<ownableSynchronizers candidates=\"5076\" cleared=\"523\" />\n\n<references type=\"soft\" candidates=\"18420\" cleared=\"0\" enqueued=\"0\" dynamicThreshold=\"32\" maxThreshold=\"32\" />\n\n<references type=\"weak\" candidates=\"19920\" cleared=\"114\" enqueued=\"60\" />\n\n<references type=\"phantom\" candidates=\"671\" cleared=\"50\" enqueued=\"50\" />\n\n<stringconstants candidates=\"40956\" cleared=\"109\" />\n\n<object-monitors candidates=\"182\" cleared=\"51\" />\n\n</gc-op>\n\n<gc-op id=\"12385\" type=\"classunload\" timems=\"1.607\" contextid=\"12364\" timestamp=\"2020-10-18T13:35:44.609\">\n\n<classunload-info classloadercandidates=\"425\" classloadersunloaded=\"6\" classesunloaded=\"2\" anonymousclassesunloaded=\"1\" quiescems=\"0.000\" setupms=\"1.581\" scanms=\"0.019\" postms=\"0.007\" />\n\n</gc-op>\n\n<gc-op id=\"12386\" type=\"sweep\" timems=\"9.464\" contextid=\"12364\" timestamp=\"2020-10-18T13:35:44.618\" />\n

The end of the increment is recorded with <gc-end> and provides another snapshot of memory in the heap, similar to <gc-start>.

<gc-end id=\"12387\" type=\"global\" contextid=\"12364\" durationms=\"24.220\" usertimems=\"86.465\" systemtimems=\"0.000\" stalltimems=\"2.846\" timestamp=\"2020-10-18T13:35:44.618\" activeThreads=\"4\">\n\n<mem-info id=\"12388\" free=\"650476504\" total=\"1073741824\" percent=\"60\">\n\n<mem type=\"nursery\" free=\"235516088\" total=\"268435456\" percent=\"87\">\n\n<mem type=\"allocate\" free=\"235516088\" total=\"241565696\" percent=\"97\" />\n\n<mem type=\"survivor\" free=\"0\" total=\"26869760\" percent=\"0\" />\n\n</mem>\n\n<mem type=\"tenure\" free=\"414960416\" total=\"805306368\" percent=\"51\" micro-fragmented=\"98245682\" macro-fragmented=\"0\">\n\n<mem type=\"soa\" free=\"374694688\" total=\"765040640\" percent=\"48\" />\n\n<mem type=\"loa\" free=\"40265728\" total=\"40265728\" percent=\"100\" />\n\n</mem>\n\n<pending-finalizers system=\"1\" default=\"0\" reference=\"515\" classloader=\"0\" />\n\n<remembered-set count=\"13554\" />\n\n</mem-info>\n\n</gc-end>\n

60% of the heap now contains free memory as a result of the final global cycle increment, which is split between the following areas of the heap:

Note: The global GC cycle runs to reclaim memory in the tenure area. The freeing up of memory in the nursery area is achieved by using the partial GC cycle. For more information, see gencon policy (default).

After the final increment of the global cycle completes, the global cycle ends and the STW pause ends, as shown in the following output:

<cycle-end id=\"12389\" type=\"global\" contextid=\"12364\" timestamp=\"2020-10-18T13:35:44.619\" />\n\n<exclusive-end id=\"12391\" timestamp=\"2020-10-18T13:35:44.619\" durationms=\"24.679\" />\n
"},{"location":"vgclog_examples/#summary_1","title":"Summary","text":"

Analyzing the structure and elements of this example log output shows that this example global cycle has the following characteristics:

"},{"location":"vgclog_examples/#balanced-examples","title":"balanced examples","text":"

The balanced policy (-Xgcpolicy:balanced) uses two types of cycle to perform GC; a partial GC cycle and a global GC mark cycle. The policy might also run a third type of cycle, which is a global cycle, to reclaim memory after an allocation failure that results from tight memory conditions.

For more information about the cycles used in a particular policy, see GC policies.

The start of a balanced cycle is recorded in the log by the following elements and attributes:

Table showing types of balanced cycle, the corresponding trigger, and XML elements for each `type`. GC cycle or increment Value of type attribute of the cycle or increment elements Element that logs the cycle trigger Trigger reason partial cycle partial gc <allocation-taxation> Allocation taxation threshold reached. global mark cycle global mark phase <allocation-taxation> Allocation taxation threshold reached. global mark STW subincrement of global mark cycle mark increment n/a Allocation taxation threshold reached global mark concurrent subincrement of global mark cycle GMP work packet processing n/a Allocation taxation threshold reached global cycle global garbage collect <af-start> (or <sys-start reason=\"explicit\"> if triggered explicitly) Allocation failure. Occurs under tight memory conditions. Cycle runs rarely.

To locate a particular type of cycle, you can search for the type attribute of the <cycle-start> and <cycle-end> elements.

When memory in the Java object heap reaches a memory threshold, called an allocation taxation threshold, a balanced partial GC cycle, balanced global mark cycle, or balanced global mark cycle increment, is triggered. If the available memory in the heap is low, the GC triggers a balanced global mark cycle, or a global mark cycle increment if the global mark cycle is in progress. Otherwise, the GC triggers a partial cycle.

Partial GC cycles, global mark cycles, and global GC cycles set the allocation taxation threshold at the end of their cycle or increment to schedule the next cycle or increment. For balanced cycles, the taxation on the mutator threads refers to pausing the mutator threads while GC work is run.

When a partial cycle ends, if the cycle is not run between global mark phase increments of a global mark cycle, and a global mark cycle is not scheduled as the next cycle, the allocation taxation threshold is set to trigger the next partial cycle when the eden space is full. Specifically, the allocation threshold is set to be equal to the size of the eden space.

If a partial cycle runs within a global mark cycle, or if a global mark cycle is scheduled as the next cycle, the allocation taxation threshold, set at the end of the partial cycle, is set to be smaller than the size of the eden space. Specifically, the allocation taxation threshold is set to be half the size of the eden space so that the next global mark cycle or global mark cycle increment has enough memory available in the eden space to run.

For more information about GC increments, see GC increments and interleaving.

You can analyze the increments and operations that are associated with a particular type of cycle by locating and interpreting the elements in the following table:

Table showing increments and operations that are associated with the balanced partial and global mark cycles GC process Elements that log the start and end of the event> Details GC cycle <cycle-start>,<cycle-end> The start and end of a GC cycle GC STW increment <gc-start><gc-end> The start and end of a GC increment or subincrement that begins with a STW pause. For example, a global mark phase global mark GC cycle increment or a partial GC cycle increment GC concurrent increment <concurrent-start>, <concurrent-end> The start of the concurrent global mark phase work packet processing subincrements of the global mark cycle GC operations and phases <gc-op> A GC operation such as mark or sweep, or a suboperation such as class unload.

For more information about the XML structure of GC cycles, see GC cycles.

The following sections use log excerpts to show how the different GC processes are logged.

"},{"location":"vgclog_examples/#balanced-partial-gc-cycle","title":"balanced partial GC cycle","text":"

The following example is taken from a balanced policy verbose GC log. The output is broken down into sections to explain the GC processing that is taking place.

To search for a balanced partial GC cycle, you can search for the type attribute value partial gc in <cycle-start> and <cycle-end> elements.

The partial GC cycle reclaims memory in the heap for the allocation of new objects by reducing the number of used regions. The partial GC cycle always reduces used regions in the eden space and might also reclaim memory from older regions. Multiple partial GC cycles often run in between global mark phase increments of the balanced global mark GC cycle.

All the operations in a partial GC cycle run during a single STW pause, as shown in the following table:

Table showing the balanced partial GC cycle operation and corresponding XML elements. GC operation GC increment STW or concurrent XML element of GC increment copy forward, and optionally class unload, sweep, and compact single STW <gc-start>, <gc-end>

The following general structure shows a balanced partial GC cycle. Some child elements are omitted for clarity:

<exclusive-start/>                       (STW pause starts)\n\n<allocation-taxation/>                   (memory threshold trigger recorded)\n\n<cycle-start/>                            (partial cycle starts)\n\n<gc-start/>                             (partial  cycle increment starts)\n\n<mem-info>                            (memory status before operations)\n\n  <mem></mem>                         (status of different types of memory)\n\n</mem-info>         \n\n</gc-start>\n\n<allocation-stats/>                  (Snapshot of how memory was divided up between\n                                     ... application threads before current cycle started)\n\n<gc-op> type=\"copy forward\" </gc-op>    (copy forward operation completed)\n\n<gc-op> type=\"class unload\" </gc-op>    (class unload operation completed)\n\n<gc-op> type=\"sweep\" </gc-op>           (sweep operation completed)\n\n<gc-op> type=\"compact\" </gc-op>         (compact operation completed)\n\n<gc-end>                                (partial cycle increment ends)\n\n<mem-info>                            (memory status after operations)\n\n  <mem></mem>                         (status of different types of memory)\n\n</mem-info>         \n\n</gc-end>\n\n<cycle-end>                               (partial cycle ends)\n\n<exclusive-end>                           (STW pause ends)\n

When the balanced partial GC cycle is triggered, the GC runs an STW pause. Application (or mutator) threads are halted to give the garbage collector exclusive access to the heap. The STW pause is recorded in the logs by the <exclusive-start> element.

<exclusive-start id=\"184\" timestamp=\"2021-02-26T11:11:42.310\" intervalms=\"3745.790\">\n  <response-info timems=\"3.138\" idlems=\"1.056\" threads=\"2\" lastid=\"00000000006EDE00\" lastname=\"RunDataWriter.1\" />\n</exclusive-start>\n

An allocation taxation threshold triggers a balanced partial GC cycle. The logs record this trigger reason by using the<allocation-taxation> element.

<allocation-taxation id=\"185\" taxation-threshold=\"2147483648\" timestamp=\"2021-02-26T11:11:42.311\" intervalms=\"3745.785\" />\n

Details about the start of the cycle are recorded by the <cycle-start> element. The cycle is recorded as a partial gc with an id=336. Any subsequent elements that are associated with this cycle have a contextid=186 to match the cycle id. You can use this contextid value to distinguish the partial GC cycle increment and operations from interleaving increments and operations of other balanced cycles, such as global mark cycles.

<cycle-start id=\"186\" type=\"partial gc\" contextid=\"0\" timestamp=\"2021-02-26T11:11:42.311\" intervalms=\"3745.805\" />\n\n

The partial cycle begins its only GC increment, recorded by using the <gc-start> element. You can understand the effect that the increment operations have on the heap by comparing snapshots of the memory that are taken at the start and the end of the increment. The child elements <mem-info> and <mem> of the <gc-start> and <gc-end> elements record the amount of memory available and where it is located in the heap.

<gc-start id=\"187\" type=\"partial gc\" contextid=\"186\" timestamp=\"2021-02-26T11:11:42.311\">\n  <mem-info id=\"188\" free=\"897581056\" total=\"4294967296\" percent=\"20\">\n    <mem type=\"eden\" free=\"0\" total=\"2147483648\" percent=\"0\" />\n    <arraylet-primitive objects=\"1\" leaves=\"4\" largest=\"4\" />\n    <remembered-set count=\"2749664\" freebytes=\"160705664\" totalbytes=\"171704320\" percent=\"93\" regionsoverflowed=\"1\" regionsstable=\"12\" regionsrebuilding=\"0\"/>\n  </mem-info>\n</gc-start>\n

As expected, at the start of this increment, the eden regions are full. 856 MB (897,581,056 B) of the total 4096 MB (4294,967,296 B) heap, equivalent to 20% of the heap, is available as free memory.

The status of the remembered set, a metastructure specific to Eclipse OpenJ9\u2122 generational garbage collectors, is reported by the <remembered-set> element. The remembered set metastructure keeps a record of any object references that cross different regions. Each region corresponds to a single remembered set.

The partial GC cycle uses and prunes the remembered set. The regionsoverflowed value records the number of regions that exceeded the non-object heap memory allocation that is reserved for the remembered set. The partial GC cycle cannot reclaim memory from these overflow regions. The partial GC cycle also cannot reclaim memory from any regions whose remembered set is being rebuilt by an increment of a global mark cycle that is in progress.

At the start of the partial GC cycle, the remembered set is using 93% of its available memory capacity, with 153.26 MB (160705664 B) available. The set consists of 2,749,664 cards and has one overflow region.

The following element, <allocation-stats>, records information about how memory was divided between application (or mutator) threads before the start of the current cycle. For this example, the thread Group1.Backend.CompositeBackend{Tier1}.7 was the largest consumer of memory.

<allocation-stats totalBytes=\"2146431360\" >\n  <allocated-bytes non-tlh=\"96417448\" tlh=\"2050013912\" arrayletleaf=\"0\"/>\n  <largest-consumer threadName=\"Group1.Backend.CompositeBackend{Tier1}.7\" threadId=\"00000000007E9300\" bytes=\"275750048\" />\n</allocation-stats>\n

The operations of the GC increment are run and details are recorded in the <gc-op> elements. The logs show that this increment begins with a copy forward operation followed by a class unload. Other balanced partial GC cycles can also include sweep and compact operations. For more information about the operations involved in balanced partial GC cycles, see GC Processing.

<gc-op id=\"189\" type=\"copy forward\" timems=\"400.637\" contextid=\"186\" timestamp=\"2021-02-26T11:11:42.713\">\n  <memory-copied type=\"eden\" objects=\"4434622\" bytes=\"119281928\" bytesdiscarded=\"1382272\" />\n  <memory-copied type=\"other\" objects=\"8847813\" bytes=\"244414264\" bytesdiscarded=\"6243176\" />\n  <memory-cardclean objects=\"1446970\" bytes=\"64143048\" />\n  <regions eden=\"512\" other=\"80\" />\n  <remembered-set-cleared processed=\"2435794\" cleared=\"887129\" durationms=\"8.667\" />\n  <finalization candidates=\"66\" enqueued=\"56\" />\n  <ownableSynchronizers candidates=\"256500\" cleared=\"78012\" />\n  <references type=\"soft\" candidates=\"153648\" cleared=\"0\" enqueued=\"0\" dynamicThreshold=\"22\" maxThreshold=\"32\" />\n  <references type=\"weak\" candidates=\"1266\" cleared=\"610\" enqueued=\"430\" />\n  <stringconstants candidates=\"9479\" cleared=\"0\"  />\n  <object-monitors candidates=\"13576\" cleared=\"13505\"  />\n</gc-op>\n<gc-op id=\"190\" type=\"classunload\" timems=\"0.010\" contextid=\"186\" timestamp=\"2021-02-26T11:11:42.713\">\n  <classunload-info classloadercandidates=\"179\" classloadersunloaded=\"0\" classesunloaded=\"0\" anonymousclassesunloaded=\"0\" quiescems=\"0.000\" setupms=\"0.010\" scanms=\"0.000\" postms=\"0.000\" />\n</gc-op>\n

The logs show that the copy forward operation acts on the entire eden space (512 regions), recorded as type=eden, and 80 older regions, which are recorded as type=other. 113.76 MB (119281928 B) of memory was copied from the eden space to 1st generation regions and 233.10 MB (244414264 B) of memory in non-eden regions was copied to the next generation of regions. The copy forward operation is followed by a class unload operation.

In some cases, a copy forward operation moves some regions by copying forward the objects in those regions, but only marks the objects in other regions. For example, the following log excerpt is taken from a different partial cycle, which corresponds to a contextid of 2049. The copy forward operation in the following example involves marking some regions and copying forward other regions.

<gc-op id=\"2052\" type=\"copy forward\" timems=\"649.059\" contextid=\"2049\" timestamp=\"2021-02-26T11:22:34.901\">\n  <memory-copied type=\"eden\" objects=\"95989\" bytes=\"7882704\" bytesdiscarded=\"501088\" />\n  <memory-copied type=\"other\" objects=\"2955854\" bytes=\"86854064\" bytesdiscarded=\"626024\" />\n  <memory-cardclean objects=\"1304\" bytes=\"56840\" />\n  <memory-traced type=\"eden\" objects=\"23392785\" bytes=\"553756840\" />\n  <memory-traced type=\"other\" objects=\"5461302\" bytes=\"131394216\" />\n  <regions eden=\"488\" other=\"138\" />\n  <remembered-set-cleared processed=\"156775\" cleared=\"4897\" durationms=\"1.759\" />\n  <finalization candidates=\"31\" enqueued=\"12\" />\n  <ownableSynchronizers candidates=\"1992467\" cleared=\"1600904\" />\n  <references type=\"soft\" candidates=\"329190\" cleared=\"0\" enqueued=\"0\" dynamicThreshold=\"8\" maxThreshold=\"32\" />\n  <references type=\"weak\" candidates=\"697\" cleared=\"105\" enqueued=\"6\" />\n  <stringconstants candidates=\"9848\" cleared=\"0\"  />\n  <object-monitors candidates=\"1437\" cleared=\"1353\"  />\n  <heap-resize type=\"expand\" space=\"default\" amount=\"0\" count=\"1\" timems=\"0.000\" reason=\"continue current collection\" />\n  <warning details=\"operation aborted due to insufficient free space\" />\n</gc-op>\n

The logs record these two concurrent parts of a copy forward operation in the <gc-op type=\"copy forward\"> section by using a <memory-traced> child element. In addition,evacuated and marked attributes for the <regions> child element are used to distinguish between the number of regions that were copied-forward (recorded as evacuated) and the number of regions that were only marked and not copied-forward. For example, <regions eden=\"256\" other=\"308\" evacuated=\"308\" marked=\"256\" />.

Returning to the contextid=186 partial cycle example, the next element in the logs, <gc-end>, records the end of the increment and provides another snapshot of memory allocation on the heap, similar to <gc-start>.

<gc-end id=\"191\" type=\"partial gc\" contextid=\"186\" durationms=\"402.645\" usertimems=\"3157.520\" systemtimems=\"4.000\" stalltimems=\"47.689\" timestamp=\"2021-02-26T11:11:42.714\" activeThreads=\"8\">\n  <mem-info id=\"192\" free=\"3003121664\" total=\"4294967296\" percent=\"69\">\n    <mem type=\"eden\" free=\"2147483648\" total=\"2147483648\" percent=\"100\" />\n    <arraylet-primitive objects=\"1\" leaves=\"4\" largest=\"4\" />\n    <pending-finalizers system=\"56\" default=\"0\" reference=\"430\" classloader=\"0\" />\n    <remembered-set count=\"2922048\" freebytes=\"160016128\" totalbytes=\"171704320\" percent=\"93\" regionsoverflowed=\"1\" regionsstable=\"12\" regionsrebuilding=\"0\"/>\n  </mem-info>\n</gc-end>\n

The following information describes the heap memory allocation at the end of the increment:

The cycle completes and the GC restarts application threads.

<cycle-end id=\"193\" type=\"partial gc\" contextid=\"186\" timestamp=\"2021-02-26T11:11:42.714\" />\n<exclusive-end id=\"194\" timestamp=\"2021-02-26T11:11:42.714\" durationms=\"404.145\" />\n

The next cycle that is recorded in the logs is another partial GC cycle. The <gc-start>element records the following information:

<gc-start id=\"198\" type=\"partial gc\" contextid=\"197\" timestamp=\"2021-02-26T11:11:46.072\">\n  <mem-info id=\"199\" free=\"855638016\" total=\"4294967296\" percent=\"19\">\n    <mem type=\"eden\" free=\"0\" total=\"2147483648\" percent=\"0\" />\n    <arraylet-primitive objects=\"1\" leaves=\"4\" largest=\"4\" />\n    <remembered-set count=\"2922048\" freebytes=\"160016128\" totalbytes=\"171704320\" percent=\"93\" regionsoverflowed=\"1\" regionsstable=\"12\" regionsrebuilding=\"0\"/>\n  </mem-info>\n</gc-start>\n

The <mem-info> element shows that the following events occurred in between the end of the last (partial) GC cycle and the start of this cycle:

"},{"location":"vgclog_examples/#summary_2","title":"Summary","text":"

Analyzing the structure and elements of this example log output shows that this example balanced partial GC cycle has the following characteristics:

"},{"location":"vgclog_examples/#balanced-global-mark-gc-cycle","title":"balanced global mark GC cycle","text":"

The global mark GC cycle uses a mixture of STW and concurrent operations to build a new record of object liveness across the heap for use by the balanced partial GC cycle. The balanced GC runs a balanced global mark cycle, or a balanced global mark cycle increment if the global mark cycle is in progress, if the heap satisfies a low memory condition when the allocation taxation threshold is reached.

The global mark cycle runs a global mark phase and also triggers an associated sweep phase within the partial GC cycle that immediately follows the end of the global mark cycle.

To search for a balanced global mark cycle, you can search for the type attribute value global mark phase in <cycle-start> and <cycle-end> elements.

The global cycle is split into multiple increments, each recorded as type=\"global mark phase\". A global mark phase increment involves an STW subincrement, which runs a global mark operation during an STW pause, followed by a global mark phase (GMP) work packet subincrement. The GMP work packet subincrement involves a processing operation that runs concurrently. The GMP work packet subincrement might also use an STW pause to complete if the subincrement is interrupted by a partial or global cycle trigger.

Splitting the global mark phase into these increments and subincrements reduces pause times by running the majority of the GC work concurrently and interleaving global mark phase increments with partial GC cycles, and, rarely a balanced global GC cycles.

The following elements log the GC increments, subincrements, and operations of the global mark GC cycle:

Table showing the global mark cycle GC increments and corresponding XML elements GC increment GC operations> STW or concurrent XML element of GC increment Details global mark phase subincrement mark STW <gc-start>, <gc-end> The global mark phase operations start at the beginning of the cycle and run through all regions until the final region GMP work packet processing subincrement Work packet processing (WPP) operations concurrent and sometimes final operations during an STW to complete the subincrement <concurrent-start>, <concurrent-end> The GMP work packet processing subincrement runs immediately after the global mark phase final global mark phase increment final global mark phase operations including class unload STW <gc-start>, <gc-end> Final increment. Runs the final global mark phase operations, including weak roots processing, followed by operations to finish the cycle

The following structure shows a balanced global mark GC cycle. The lines are indented to help illustrate the flow and some child elements are omitted for clarity:

<exclusive-start/>                        (STW pause starts)\n\n<allocation-taxation/>                    (memory threshold trigger recorded)\n\n<cycle-start type=\"global mark phase\"/>   (global mark cycle starts)\n\n<gc-start type=\"global mark phase\"/>      (1st GMP STW subincrement starts)\n\n    <mem-info>                            (memory status before operations)\n\n    <remembered-set>\n\n    </mem-info>         \n\n</gc-start>\n\n<gc-op type=\"mark increment\" />           (STW copy forward operation completed)\n\n<gc-end>                                  (1st GMP STW subincrement ends)\n\n    <mem-info>                            (memory status after operations)\n\n    <remembered-set>\n\n    </mem-info>\n\n<gc-end>\n\n<concurrent-start type=\"GMP work packet processing\"/> (1st GMP concurrent subincrement starts)\n\n<exclusive-end/>                                      (STW pause ends and application threads resume)\n\n<concurrent-end type=\"GMP work packet processing\"/>   (1st GMP concurrent subincrement ends)\n\n<gc-op type=\"mark increment\"/>                        (marking operation runs concurrently)\n\n</concurrent-end type=\"GMP work packet processing\"/>\n\n...                                       (application threads run. STW pauses stop    \n                                          and start application threads to run\n                                          partial GC cycles.)\n\n<exclusive-start/>                        (STW pause starts)\n\n<gc-start type=\"global mark phase\"/>      (2nd STW GMP subincrement starts)\n\n...   \n\n<concurrent-start type=\"GMP work packet processing\"/> (2nd concurrent GMP subincrement starts)\n\n...\n\n<exclusive-end/>\n\n...                                       (application threads run. Partial GC cycles may run)\n\n<concurrent-end type=\"GMP work packet processing\" />  (2nd concurrent GMP subincrement ends)\n...\n\n</concurrent-end>\n\n...                                       (application threads run. Partial cycles\n                                          and GMP increments interleave)\n\n<exclusive-start/>                        (STW pause starts)\n\n...\n\n<gc-start type=\"global mark phase\"/>      (final STW GMP subincrement starts.)\n\n<gc-op type=\"mark increment\" />           (STW copy forward operation completed)\n\n<gc-op  type=\"class unload\" />            (STW class unload operation completed)\n\n<gc-end>                                  (1st GMP STW subincrement ends)\n...   \n<gc-end type=\"global mark phase\"/>        (final STW GMP subincrement ends. No concurrent subincrement runs)\n\n<cycle-end type=\"global mark phase\"/>     (end of global mark cycle)\n\n<exclusive-end/>                          (STW pause ends)    \n\n<exclusive-start/>                        (STW pause starts)\n\n<cycle-start type=\"partial gc\" />         (partial cycle starts)\n\n...\n\n<gc-op type=\"sweep\" />                    (Sweep operation associated with global mark cycle runs)\n\n...\n\n<cycle-end type=\"partial gc\"/>            (partial GC cycle ends)\n\n<exclusive-end/>                          (STw pause ends)\n
"},{"location":"vgclog_examples/#global-mark-phase","title":"Global mark phase","text":"

The first activity of the global mark cycle is an STW pause, recorded by an <exclusive-start> element that precedes the <cycle-start type=\"global mark phase\"/> element. The garbage collector pauses application threads to run the initial operations.

<exclusive-start id=\"1152\" timestamp=\"2021-02-26T11:17:25.033\" intervalms=\"1931.263\">\n  <response-info timems=\"3.082\" idlems=\"1.041\" threads=\"2\" lastid=\"00000000006EDE00\" lastname=\"RunDataWriter.1\" />\n</exclusive-start>\n

The <allocation-taxation> element indicates that an allocation taxation threshold triggered the cycle. The taxation threshold is recorded as 1024 MB (1,073,741,824), which is half the total memory of the eden space (2048 MB), as expected for threshold triggers of global mark cycles and increments. For more information about taxation thresholds for the balanced policy, see balanced examples.

<allocation-taxation id=\"1153\" taxation-threshold=\"1073741824\" timestamp=\"2021-02-26T11:17:25.034\" intervalms=\"1931.251\" />\n

Details about the start of the global mark GC cycle are recorded by the <cycle-start> element. The cycle is recorded as type global mark phase with id=1154. Any subsequent elements that are associated with this cycle have a contextid=1154 to match the global mark GC cycle id. You can use the contextid value to distinguish increments and operations of the global mark GC cycle from the partial cycles that interleave with it.

<cycle-start id=\"1154\" type=\"global mark phase\" contextid=\"0\" timestamp=\"2021-02-26T11:17:25.034\" intervalms=\"374365.075\" />\n

The cycle begins with the STW subincrement of a global mark phase increment. The STW subincrement is recorded by using the <gc-start> element of type global mark phase.

<gc-start id=\"1155\" type=\"global mark phase\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:25.034\">\n  <mem-info id=\"1156\" free=\"1442840576\" total=\"4294967296\" percent=\"33\">\n    <remembered-set count=\"2197888\" freebytes=\"162912768\" totalbytes=\"171704320\" percent=\"94\" regionsoverflowed=\"3\" regionsstable=\"130\" regionsrebuilding=\"0\"/>\n  </mem-info>\n</gc-start>\n

The <gc-start> element provides a snapshot of the free memory available in the heap and the status of the remembered set. At the start of the increment, the heap is 33% free; 1376 MB (1442840576 B) of the total 4096 MB (4294967296 B).

The <remembered-set> element records the status of the remembered set metastructure, a structure that records object references that cross different regions. During the rebuilding of the remembered set metastructure, any regions that cannot be rebuilt into a remembered set due to a lack of memory resource in the metastructure are marked as overflow regions. Partial GC cycles cannot reclaim memory from overflow regions.

The aim of the global mark cycle is to create a new record of object liveness by populating the remembered set. The global mark cycle also attempts to rebuild the remembered set information for the overflowed regions, which can be seen in the remembered set statistics. After the global mark cycle completes, the remembered set reflects a closer snapshot of the current liveness of the heap. This more accurate snapshot of object liveness optimizes the pruning of the set, which is run by the partial GC cycle when it consumes the object liveness snapshot.

The logs show that at the start of this STW subincrement, the remembered set count is 2,197,888 cards, the metastructure is using 94% of its total available memory, and three overflow regions need to be rebuilt.

The <gc-op> element records that the STW subincrement runs a mark operation. This operation begins the process of building a record of object liveness across the heap.

<gc-op id=\"1157\" type=\"mark increment\" timems=\"122.825\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:25.157\">\n  <trace-info objectcount=\"7726701\" scancount=\"7584109\" scanbytes=\"213445656\" />\n</gc-op>\n

The <trace-info> element records information about the marking and scanning stages of the mark increment operation. objectcount records the number of objects that were marked, ready for tracing. After marking live objects, a scan is run to trace objects and references. The following values are recorded:

In the example, the mark increment operation marked 7,726,701 objects and scanned 7,584,109 of these marked objects. The 7,584,109 of scanned objects take up 203.5 MB (213445656 B) of memory. The number of scanned objects is less than the number of marked objects because only objects that have children require scanning. Also, the scanning part of the marking operation might be interrupted by the garbage collector if a trigger threshold for a partial cycle or global cycle is reached during the marking operation.

The STW global mark phase subincrement ends, as recorded by <gc-end>, which records a snapshot of the memory status in the heap in a similar way to <gc-start>.

<gc-end id=\"1158\" type=\"global mark phase\" contextid=\"1154\" durationms=\"123.139\" usertimems=\"977.851\" systemtimems=\"0.000\" stalltimems=\"1.453\" timestamp=\"2021-02-26T11:17:25.157\" activeThreads=\"8\">\n  <mem-info id=\"1159\" free=\"1442840576\" total=\"4294967296\" percent=\"33\">\n    <remembered-set count=\"3263968\" freebytes=\"158648448\" totalbytes=\"171704320\" percent=\"92\" regionsoverflowed=\"0\" regionsstable=\"0\" regionsrebuilding=\"133\"/>\n  </mem-info>\n</gc-end>\n

The following comparison can be made between the snapshot at the beginning and end of this STW global mark phase subincrement:

The beginning of the second part of the global mark phase increment, the GMP work packet processing subincrememt, is recorded by <concurrent-start>. The child element <concurrent-mark-start> records the scan target of this subincrement as 242.74 MB (254,532,672 B).

<concurrent-start id=\"1160\" type=\"GMP work packet processing\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:25.157\">\n  <concurrent-mark-start scanTarget=\"254532672\" />\n</concurrent-start>\n

Now that the STW global mark phase subincrement is complete, application threads are restarted.

<exclusive-end id=\"1161\" timestamp=\"2021-02-26T11:17:25.157\" durationms=\"123.936\" />\n

The GMP work packet processing subincrement continues to run concurrently. The end of this operation is recorded by using the <concurrent-end> element.

<concurrent-end id=\"1162\" type=\"GMP work packet processing\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:25.469\" terminationReason=\"Work target met\">\n<gc-op id=\"1163\" type=\"mark increment\" timems=\"311.867\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:25.469\">\n  <trace-info scanbytes=\"254708852\" />\n</gc-op>\n</concurrent-end>\n

The child element <trace-info> shows that the processing scanned 242.91 MB (254,708,852 B), which slightly exceeds the 108.25 MB scan target.

Application threads continue to run and allocate memory. The garbage collector stops and starts the application threads to run partial GC cycles that reclaim free space in the eden space and some older regions. To see an example of how a balanced partial GC cycle appears in the logs, see the balanced partial GC cycle.

Following some partial GC cycles, an allocation taxation threshold is reached that triggers an STW pause followed by another global mark phase increment. The element <gc-start> in the following log excerpt has a contextid=1154 and type global mark phase, which indicates that this is a global mark phase subincrement associated with the global mark cycle example.

<exclusive-start id=\"1175\" timestamp=\"2021-02-26T11:17:28.993\" intervalms=\"1978.886\">\n  <response-info timems=\"5.111\" idlems=\"1.714\" threads=\"2\" lastid=\"00000000006EDE00\" lastname=\"RunDataWriter.1\" />\n</exclusive-start>\n<allocation-taxation id=\"1176\" taxation-threshold=\"1073741824\" timestamp=\"2021-02-26T11:17:28.994\" intervalms=\"1978.879\" />\n<gc-start id=\"1177\" type=\"global mark phase\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:28.994\">\n  <mem-info id=\"1178\" free=\"1451229184\" total=\"4294967296\" percent=\"33\">\n    <remembered-set count=\"3325824\" freebytes=\"158401024\" totalbytes=\"171704320\" percent=\"92\" regionsoverflowed=\"2\" regionsstable=\"0\" regionsrebuilding=\"133\"/>\n  </mem-info>\n</gc-start>\n

The <allocation-taxation> element shows that the allocation taxation threshold, which triggers this global mark phase increment, is set to 1024 MB, half of the size of the eden space, as expected.

<gc-start> records that the heap has 1384 MB (1,451,229,184 B) of free memory available at the beginning of this global mark phase increment. This value compares to the 1376 MB (1,442,840,576 B) of free memory available at the end of the previous global mark phase increment. Although free memory was reclaimed by the partial GC cycles that ran between these global mark phase increments, free memory was allocated to objects when application threads ran, resulting in a net reduction of free memory available.

The status of the heap at the beginning and end of STW subincrements are automatically recorded. For this STW subincrement, there are no <gc-op> elements recorded; <gc-end> immediately follows <gc-start> in the logs. For some STW subincrements, a mark operation is run.

<gc-end id=\"1179\" type=\"global mark phase\" contextid=\"1154\" durationms=\"0.289\" usertimems=\"1.000\" systemtimems=\"0.000\" stalltimems=\"0.000\" timestamp=\"2021-02-26T11:17:28.994\" activeThreads=\"8\">\n  <mem-info id=\"1180\" free=\"1451229184\" total=\"4294967296\" percent=\"33\">\n    <remembered-set count=\"3325824\" freebytes=\"158401024\" totalbytes=\"171704320\" percent=\"92\" regionsoverflowed=\"2\" regionsstable=\"0\" regionsrebuilding=\"133\"/>\n  </mem-info>\n</gc-end>\n

The second part of the increment, the GMP work packet processing subincrement, is recorded by using the <concurrent-start> and <concurrent-end> elements.

<concurrent-start id=\"1181\" type=\"GMP work packet processing\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:28.994\">\n  <concurrent-mark-start scanTarget=\"258671414\" />\n</concurrent-start>\n<exclusive-end id=\"1182\" timestamp=\"2021-02-26T11:17:28.994\" durationms=\"0.816\" />\n\n<concurrent-end id=\"1183\" type=\"GMP work packet processing\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:29.273\" terminationReason=\"Work target met\">\n<gc-op id=\"1184\" type=\"mark increment\" timems=\"279.311\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:29.274\">\n  <trace-info scanbytes=\"258767612\" />\n</gc-op>\n</concurrent-end>\n

The log excerpt shows the concurrent GMP work packet processing subincrement achieved the scan target of 246.69 MB (258671414 B). 246.78 MB (258767612 B) were scanned.

More partial cycles run. This pattern of interleaving of global mark increments with partial GC cycles repeats until a final global mark increment completes the global mark cycle. The final global mark phase increment consists of an STW global mark phase subincrement that includes mark increment and class unload operations.

<exclusive-start id=\"1217\" timestamp=\"2021-02-26T11:17:36.864\" intervalms=\"1986.124\">\n  <response-info timems=\"0.287\" idlems=\"0.104\" threads=\"2\" lastid=\"00000000006EDE00\" lastname=\"RunDataWriter.1\" />\n</exclusive-start>\n<allocation-taxation id=\"1218\" taxation-threshold=\"1073741824\" timestamp=\"2021-02-26T11:17:36.865\" intervalms=\"1986.101\" />\n<gc-start id=\"1219\" type=\"global mark phase\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:36.865\">\n  <mem-info id=\"1220\" free=\"1438646272\" total=\"4294967296\" percent=\"33\">\n    <remembered-set count=\"3514496\" freebytes=\"157646336\" totalbytes=\"171704320\" percent=\"91\" regionsoverflowed=\"3\" regionsstable=\"0\" regionsrebuilding=\"133\"/>\n  </mem-info>\n</gc-start>\n<gc-op id=\"1221\" type=\"mark increment\" timems=\"164.843\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:37.030\">\n  <trace-info objectcount=\"7715572\" scancount=\"7665293\" scanbytes=\"214739196\" />\n  <cardclean-info objects=\"3962203\" bytes=\"117924792\" />\n  <finalization candidates=\"206\" enqueued=\"30\" />\n  <ownableSynchronizers candidates=\"601780\" cleared=\"16925\" />\n  <references type=\"soft\" candidates=\"718240\" cleared=\"2858\" enqueued=\"2832\" dynamicThreshold=\"18\" maxThreshold=\"32\" />\n  <references type=\"weak\" candidates=\"2321\" cleared=\"142\" enqueued=\"0\" />\n  <references type=\"phantom\" candidates=\"8\" cleared=\"0\" enqueued=\"0\" />\n  <stringconstants candidates=\"9522\" cleared=\"0\"  />\n  <object-monitors candidates=\"7142\" cleared=\"7066\"  />\n</gc-op>\n<gc-op id=\"1222\" type=\"classunload\" timems=\"0.704\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:37.030\">\n  <classunload-info classloadercandidates=\"185\" classloadersunloaded=\"13\" classesunloaded=\"13\" anonymousclassesunloaded=\"0\" quiescems=\"0.000\" setupms=\"0.644\" scanms=\"0.043\" postms=\"0.016\" />\n</gc-op>\n<gc-end id=\"1223\" type=\"global mark phase\" contextid=\"1154\" durationms=\"169.521\" usertimems=\"1244.810\" systemtimems=\"3.000\" stalltimems=\"27.792\" timestamp=\"2021-02-26T11:17:37.034\" activeThreads=\"8\">\n  <mem-info id=\"1224\" free=\"1438646272\" total=\"4294967296\" percent=\"33\">\n    <pending-finalizers system=\"30\" default=\"0\" reference=\"2832\" classloader=\"0\" />\n    <remembered-set count=\"2241440\" freebytes=\"162738560\" totalbytes=\"171704320\" percent=\"94\" regionsoverflowed=\"3\" regionsstable=\"127\" regionsrebuilding=\"0\"/>\n  </mem-info>\n</gc-end>\n

Comparing the memory at the start and end of this final global mark phase increment shows the following status:

Following the final global mark increment, the global mark cycle completes and the GC ends the STW pause.

<cycle-end id=\"1225\" type=\"global mark phase\" contextid=\"1154\" timestamp=\"2021-02-26T11:17:37.034\" />\n<exclusive-end id=\"1226\" timestamp=\"2021-02-26T11:17:37.034\" durationms=\"170.186\" />\n

The operations to create a record of object liveness across the heap, which began with the global mark cycle, is followed by a sweep phase. The sweep phase is triggered by the end of the global mark cycle to be included in the next partial GC cycle that runs.

"},{"location":"vgclog_examples/#sweep-phase","title":"Sweep phase","text":"

The sweep operation has the following two objectives:

While the global sweep operation is logically associated with the global mark phase, it does not run in the same global mark cycle. Instead, the sweep operation runs in the same STW increment as the first partial GC cycle that runs after the completion of the global mark cycle. This can be seen in the following log excerpt. After the log records the end of the global mark cycle, it records an STW pause followed by a partial gc cycle of id=1229. The global sweep operation that runs after the global mark phase is recorded in the <gc-op> element that is tagged as id=1229.

<exclusive-start id=\"1227\" timestamp=\"2021-02-26T11:17:38.804\" intervalms=\"1940.125\">\n...\n<cycle-start id=\"1229\" type=\"partial gc\" contextid=\"0\" timestamp=\"2021-02-26T11:17:38.805\" intervalms=\"3926.202\" />\n...\n</gc-start>\n...\n</gc-start>\n<gc-op id=\"1232\" type=\"sweep\" timems=\"9.472\" contextid=\"1229\" timestamp=\"2021-02-26T11:17:38.815\" />\n<gc-op id=\"1233\" type=\"copy forward\" timems=\"308.258\" contextid=\"1229\" timestamp=\"2021-02-26T11:17:39.124\">\n...\n<gc-op id=\"1234\" type=\"classunload\" timems=\"0.012\" contextid=\"1229\" timestamp=\"2021-02-26T11:17:39.125\">\n...\n<gc-end>\n...\n</gc-end>\n<cycle-end id=\"1237\" type=\"partial gc\" contextid=\"1229\" timestamp=\"2021-02-26T11:17:39.125\" />\n<exclusive-end id=\"1238\" timestamp=\"2021-02-26T11:17:39.125\" durationms=\"320.792\" />\n

A record of object liveness is now complete.

"},{"location":"vgclog_examples/#summary_3","title":"Summary","text":"

Analyzing the structure and elements of this example log output shows that this example balanced global mark GC cycle has the following characteristics:

"},{"location":"vgclog_examples/#balanced-global-gc-cycle","title":"balanced global GC cycle","text":"

The following global GC cycle example is taken from a balanced verbose GC log. The output is broken down into sections to explain the GC processing that is taking place.

A balanced global cycle is triggered if the VM is close to throwing an out of memory exception. This situation occurs only under tight memory conditions when the garbage collector cannot reclaim enough memory by using only partial and global mark cycles.

To search for a balanced global cycle or increment, you can search for the type attribute value global garbage collect of the cycle or increment element.

If the balanced global cycle is triggered during a balanced global mark GC cycle, a new global cycle is not recorded. Instead, the global mark cycle's global mark phase increment switches to a global garbage collect increment that is run as an STW increment. This switch is recorded in the logs by using a <cycle-continue> element, which precedes the gc-start element that records the new global garbage collect increment.

If the balanced global cycle is not triggered during a balanced global mark cycle, the global cycle is recorded as a new cycle by using the <cycle-start> element.

The element <sys-start reason=\"explicit\"> is used in the logs to record a cycle that was triggered explicitly rather than by the garbage collector. For example, the trigger reason is recorded as explicit if a cycle is triggered by an application calling System.gc(). For more information about explicitly or implicitly triggering a GC cycle, see Garbage collection.

The global cycle operations run as a single GC increment during an STW pause.

Table showing the balanced global cycle's GC increment and corresponding XML elements. GC increment GC operations STW or concurrent XML element of GC increment Details single STW mark-sweep operations, optionally followed by a compact operation STW <cycle-start>, <gc-end> Contains detailed information about where free memory is located and remembered set statistics

If the global cycle is triggered during a global mark cycle, the global cycle follows a general structure in the verbose GC log as shown. Some child elements are omitted for clarity:

...                                        (global mark cycle increment runs)\n\n<af-start/>                                (allocation failure trigger recorded)\n\n<concurrent-end/>                          (global mark cycle concurrent subincrement finishes )\n\n<allocation-taxation/>                     (memory threshold trigger recorded)\n\n<cycle-continue/>                          (change of cycle type from global mark to global)\n\n</gc-start type=\"global garbage collect\"/> (global cycle STW increment starts)\n\n<mem-info>                                 (memory status before operations)\n\n <mem></mem>                               (status of different types of memory)\n\n</mem-info>         \n\n</gc-start type=\"global garbage collect\"/>\n\n<allocation-stats/>                        (Snapshot of how memory was divided up between\n                                           ... application threads before current cycle started)\n<gc-op> type=\"mark\" </gc-op>                (mark operation completed)\n\n<gc-op> type=\"class unload\" </gc-op>        (class unload operation completed)\n\n<gc-op> type=\"sweep\" </gc-op>               (sweep operation completed)\n\n<gc-op> type=\"compact\" </gc-op>             (compact operation completed)\n\n<gc-end type=\"global garbage collect\">      (global cycle STW increment ends)\n\n<mem-info>                                  (memory status after operations)\n\n<mem></mem>                                 (status of different types of memory)\n\n</mem-info>         \n\n</gc-end type=\"global garbage collect\">\n\n<cycle-end type = \"global garbage collect\"/> (cycle ends)\n\n<allocation-satisfed/>                      (required allocation has been achieved)\n\n<exclusive-end>                             (STW pause ends)\n

The following example shows a balanced global cycle that is triggered during a global mark cycle.

The start of the GMP work processing subincrement of the global mark cycle, which runs concurrently with application threads, is recorded by using the <concurrent-start> element.

<concurrent-start id=\"2009\" type=\"GMP work packet processing\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:43.109\">\n  <concurrent-mark-start scanTarget=\"18446744073709551615\" />\n</concurrent-start>\n

After the start of the concurrent subincrement, the logs record an allocation failure by using <af-start>. The <concurrent-end> element attribute terminationReason shows that a termination of the concurrent increment was requested by the garbage collector.

<af-start id=\"2010\" threadId=\"00000000008AA780\" totalBytesRequested=\"24\" timestamp=\"2021-03-05T12:16:43.109\" intervalms=\"1212.727\" />\n<concurrent-end id=\"2011\" type=\"GMP work packet processing\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:43.110\" terminationReason=\"Termination requested\">\n<gc-op id=\"2012\" type=\"mark increment\" timems=\"0.893\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:43.110\">\n  <trace-info scanbytes=\"584612\" />\n</gc-op>\n</concurrent-end>\n

The next element, the <cycle-continue> element, records information about the switch of cycle type from a global mark cycle, recorded as type global mark phase, to a global cycle, recorded as type global garbage collect.

<cycle-continue id=\"2013\" oldtype=\"global mark phase\" newtype=\"global garbage collect\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:43.110\" />\n

A global cycle increment is recorded by <gc-start> and has the same contextid as the global mark cycle's elements. The global cycle operations are run during an STW pause and as a modification to the global mark cycle rather than a new cycle. The memory snapshot within the <gc-start> element is taken before the global increment's operations run and can be compared with a similar snapshot that is taken afterward to understand the effect on the heap.

<gc-start id=\"2014\" type=\"global garbage collect\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:43.110\">\n  <mem-info id=\"2015\" free=\"0\" total=\"838860800\" percent=\"0\">\n    <mem type=\"eden\" free=\"0\" total=\"524288\" percent=\"0\" />\n    <remembered-set count=\"12832\" freebytes=\"33331072\" totalbytes=\"33382400\" percent=\"99\" regionsoverflowed=\"0\" regionsstable=\"0\" regionsrebuilding=\"1593\"/>\n  </mem-info>\n</gc-start>\n

At the start of the global cycle's increment, the amount of memory available in the heap is zero. In some cases, the heap is close to full, and in other cases, the memory is full.

The next element <allocation-stats> shows a snapshot of how memory was divided up between application threads before the current cycle started.

<allocation-stats totalBytes=\"524200\" >\n  <allocated-bytes non-tlh=\"0\" tlh=\"524200\" arrayletleaf=\"0\"/>\n</allocation-stats>\n

The <allocation-stats> element shows that very little allocation took place. Global cycles are triggered due to an allocation failure, so the low memory allocation values are expected.

The following operations, each recorded by a <gc-op> element, run as part of the global cycle's increment:

<gc-op id=\"2016\" type=\"global mark\" timems=\"357.859\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:43.468\">\n  <trace-info objectcount=\"37461962\" scancount=\"37447916\" scanbytes=\"828311396\" />\n  <cardclean-info objects=\"311\" bytes=\"22632\" />\n  <finalization candidates=\"195\" enqueued=\"2\" />\n  <ownableSynchronizers candidates=\"2089\" cleared=\"0\" />\n  <references type=\"soft\" candidates=\"3059\" cleared=\"0\" enqueued=\"0\" dynamicThreshold=\"0\" maxThreshold=\"32\" />\n  <references type=\"weak\" candidates=\"10797\" cleared=\"0\" enqueued=\"0\" />\n  <references type=\"phantom\" candidates=\"6\" cleared=\"0\" enqueued=\"0\" />\n  <stringconstants candidates=\"10031\" cleared=\"0\"  />\n</gc-op>\n<gc-op id=\"2017\" type=\"classunload\" timems=\"0.123\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:43.468\">\n  <classunload-info classloadercandidates=\"25\" classloadersunloaded=\"0\" classesunloaded=\"0\" anonymousclassesunloaded=\"0\" quiescems=\"0.000\" setupms=\"0.123\" scanms=\"0.000\" postms=\"0.000\" />\n</gc-op>\n<gc-op id=\"2018\" type=\"sweep\" timems=\"5.120\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:43.474\" />\n<gc-op id=\"2019\" type=\"compact\" timems=\"762.323\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:44.236\">\n  <compact-info movecount=\"8024461\" movebytes=\"163375400\" />\n  <remembered-set-cleared processed=\"777104\" cleared=\"777104\" durationms=\"2.188\" />\n</gc-op>\n

The global cycle's increment ends. The end of the increment is recorded with <gc-end> and provides another snapshot of memory allocation on the heap, similar to <gc-start>.

<gc-end id=\"2020\" type=\"global garbage collect\" contextid=\"2003\" durationms=\"1126.788\" usertimems=\"7971.788\" systemtimems=\"1.000\" stalltimems=\"1016.256\" timestamp=\"2021-03-05T12:16:44.237\" activeThreads=\"8\">\n  <mem-info id=\"2021\" free=\"1572864\" total=\"838860800\" percent=\"0\">\n    <mem type=\"eden\" free=\"1572864\" total=\"1572864\" percent=\"100\" />\n    <pending-finalizers system=\"2\" default=\"0\" reference=\"0\" classloader=\"0\" />\n    <remembered-set count=\"874496\" freebytes=\"29884416\" totalbytes=\"33382400\" percent=\"89\" regionsoverflowed=\"0\" regionsstable=\"0\" regionsrebuilding=\"0\"/>\n  </mem-info>\n</gc-end>\n

Comparing the snapshot at the beginning and end of this STW global mark phase subincrement shows that memory was reclaimed and regions reassigned to create an empty eden space, equal to 1.5 MB (1,572,864 B). Because global cycles are triggered when memory conditions are tight, the global cycle is able to reclaim only a small amount of memory.

The cycle ends (<cycle-end>). The following <allocation-satisfied> element indicates that the allocation request that caused the allocation failure can now complete successfully.

<cycle-end id=\"2022\" type=\"global garbage collect\" contextid=\"2003\" timestamp=\"2021-03-05T12:16:44.237\" />\n<allocation-satisfied id=\"2023\" threadId=\"00000000008A9E00\" bytesRequested=\"24\" />\n<af-end id=\"2024\" timestamp=\"2021-03-05T12:16:44.237\" threadId=\"00000000008AA780\" success=\"true\" />\n

The STW pause ends with the <exclusive-end> element.

<exclusive-end id=\"2025\" timestamp=\"2021-03-05T12:16:44.237\" durationms=\"1130.358\" />\n
"},{"location":"vgclog_examples/#summary_4","title":"Summary","text":"

Analyzing the structure and elements of this example log output shows that this global cycle has the following characteristics:

"},{"location":"x/","title":"-X","text":""},{"location":"x/#-x","title":"-X","text":"

Displays help on nonstandard options.

"},{"location":"x/#syntax","title":"Syntax","text":"
    -X\n
"},{"location":"x_jvm_commands/","title":"Using -X options","text":""},{"location":"x_jvm_commands/#using-x-command-line-options","title":"Using -X command-line options","text":"

Use these options to configure the Eclipse OpenJ9\u2122 virtual machine (VM). Unlike standard options, options prefixed with -X are nonstandard and are typically unique to a Java\u2122 virtual machine implementation. However, in some cases, -X option names are common to different VM implementations and might have the same function.

For options that take a <size> parameter, add a suffix to the size value: \"k\" or \"K\" to indicate kilobytes, \"m\" or \"M\" to indicate megabytes, \"g\" or \"G\" to indicate gigabytes, or \"t\" or \"T\" to indicate terabytes.

For example, to set the -Xmx value to 16 MB, you can specify -Xmx16M, -Xmx16m, -Xmx16384K, -Xmx16384k, or -Xmx16777216 on the command line.

"},{"location":"xaggressive/","title":"-Xaggressive","text":""},{"location":"xaggressive/#-xaggressive","title":"-Xaggressive","text":"

Enables performance optimizations and new platform exploitation that are expected to be the default in future releases.

"},{"location":"xaggressive/#syntax","title":"Syntax","text":"
    -Xaggressive\n
"},{"location":"xalwaysclassgc/","title":"-Xalwaysclassgc","text":""},{"location":"xalwaysclassgc/#-xalwaysclassgc","title":"-Xalwaysclassgc","text":"

Always perform dynamic class unloading during global garbage collection.

"},{"location":"xalwaysclassgc/#syntax","title":"Syntax","text":"
    -Xalwaysclassgc\n
"},{"location":"xalwaysclassgc/#default-behavior","title":"Default behavior","text":"

If you don't set this option, the default behavior is defined by -Xclassgc.

This option can be used with all Eclipse OpenJ9\u2122 GC policies.

"},{"location":"xalwaysclassgc/#see-also","title":"See also","text":""},{"location":"xaot/","title":"-Xaot","text":""},{"location":"xaot/#-xaot-xnoaot","title":"-Xaot / -Xnoaot","text":"

Use this option to control the behavior of the ahead-of-time (AOT) compiler. When the AOT compiler is active, the compiler selects the methods to be AOT compiled with the primary goal of improving startup time.

AOT compilation allows the compilation of Java\u2122 classes into native code for subsequent executions of the same program. The AOT compiler works with the class data sharing framework.

The AOT compiler generates native code dynamically while an application runs and caches any generated AOT code in the shared data cache. Subsequent VMs that execute the method can load and use the AOT code from the shared data cache without incurring the performance decrease experienced with JIT-compiled native code.

"},{"location":"xaot/#performance","title":"Performance","text":"

Because AOT code must persist over different program executions, AOT-generated code does not perform as well as JIT-generated code. AOT code usually performs better than interpreted code.

In a VM without an AOT compiler or with the AOT compiler disabled, the JIT compiler selectively compiles frequently used methods into optimized native code. There is a time cost associated with compiling methods because the JIT compiler operates while the application is running. Because methods begin by being interpreted and most JIT compilations occur during startup, startup times can be increased.

Startup performance can be improved by using the shared AOT code to provide native code without compiling. There is a small time cost to load the AOT code for a method from the shared data cache and bind it into a running program. The time cost is low compared to the time it takes the JIT compiler to compile that method.

"},{"location":"xaot/#default-behavior","title":"Default behavior","text":"

The AOT compiler is enabled by default, but is only active for classes that are found in the shared classes cache. See Introduction to class data sharing for information about the shared classes cache, how class sharing is enabled, and what options are available to modify class sharing behavior.

"},{"location":"xaot/#syntax","title":"Syntax","text":"Setting Action Default -Xaot Enable AOT yes -Xaot:<parameter>[=<value>] (See Note) Enable AOT with modifications -Xnoaot Disable AOT

Note: You can concatenate several parameters in a comma-separated list, for example: -Xaot:<parameter1>[=<value1>], <parameter2>[=<value2>].

Specify the -Xaot option only once. By default, if you specify this option multiple times, only the last option takes effect. You can use the -XX:+MergeCompilerOptions option to merge all the existing instances of the -Xaot options logically.

"},{"location":"xaot/#parameters-for-xaot","title":"Parameters for -Xaot","text":"Parameter Effect verbose Reports information about the AOT and JIT compiler configuration and method compilation. count Specifies the number of times a method is called before it is compiled. exclude Excludes specified methods when AOT code is compiled. limit Includes specified methods when AOT code is compiled. limitFile Compiles only the methods listed in the specified limit file. loadExclude Excludes specified methods when AOT code is loaded. loadLimit Includes specified methods when AOT code is loaded. loadLimitFile Loads only the methods listed in the specified limit file."},{"location":"xaot/#verbose","title":"verbose","text":"
    -Xaot:verbose\n
Reports information about the AOT and JIT compiler configuration and method compilation."},{"location":"xaot/#count","title":"count","text":"
    -Xaot:count=<n>\n
Specifies the number of times, <n>, a method is called before it is compiled or loaded from an existing shared classes cache. Setting -Xaot:count=0 forces the AOT compiler to compile everything on first execution, which is useful for problem determination."},{"location":"xaot/#exclude","title":"exclude","text":"
    -Xaot:exclude={<method_name>}\n

Excludes a Java method when AOT code is compiled from the shared classes cache. Use this option if the method causes the program to fail.

<method_name> is the method or methods that are to be excluded; the wildcard * may be used. Specify as much of the full package, class and method as necessary.

For example, -Xaot:exclude={test/sample/MyClass.testMethod()V} excludes the single method specified. However, -Xaot:exclude={test/sample/MyClass.testMethod()*} excludes the method regardless of return type. Similarly, -Xaot:exclude={*} excludes all methods.

Note: exclude has the same effect regardless of whether it's specified on -Xjit or -Xaot. In consequence, if you specify -Xaot:exclude, JIT compilation is also prevented and the methods specified are always interpreted.

"},{"location":"xaot/#limit","title":"limit","text":"
    -Xaot:limit={<method_name>}\n

Only the Java methods specified are included when AOT code is compiled from the shared classes cache. <method_name> is the method or methods that are to be included (the wildcard * may be used, see -Xaot:exclude for details).

Note: limit has the same effect regardless of whether it's specified on -Xjit or -Xaot. In consequence, if you specify -Xaot:limit, JIT compilation is also restricted to those methods specified; other methods are always interpreted.

"},{"location":"xaot/#limitfile","title":"limitFile","text":"
    -Xaot:limitFile=(<filename>,<m>,<n>)\n

Compiles or loads only the methods listed on lines <m> to, and including, <n> in the specified limit file, <filename>. Methods not listed in the limit file and methods listed on lines outside the range are not compiled or loaded.

Note: limitFile has the same effect regardless of whether it's specified on -Xjit or -Xaot. In consequence, if you specify -Xaot:limitFile, JIT compilation is also restricted to those methods specified; other methods are always interpreted.

"},{"location":"xaot/#loadexclude","title":"loadExclude","text":"
    -Xaot:loadExclude={<method_name>}\n

Excludes the specified Java methods when AOT code is loaded from the shared classes cache. In consequence, the compiler does a JIT compilation on those methods instead.

<method_name> is the method or methods that are to be excluded (the wildcard * may be used, see -Xaot:exclude for details). This option does not prevent the method from being compiled.

Note: loadExclude can only be specified on -Xaot; it does not have an equivalent on -Xjit.

"},{"location":"xaot/#loadlimit","title":"loadLimit","text":"
    -Xaot:loadLimit={<method_name>}\n

Only the Java methods specified are included when AOT code is loaded from the shared classes cache. In consequence, the compiler does a JIT compilation on other methods instead.

<method_name> is the method or methods that are to be included (the wildcard * may be used; see -Xaot:exclude for details).

Note: loadLimit can only be specified on -Xaot; it does not have an equivalent on -Xjit. This option filters what AOT code the compiler is allowed to load from the shared classes cache.

"},{"location":"xaot/#loadlimitfile","title":"loadLimitFile","text":"
    -Xaot:loadLimitFile=(<filename>,<m>,<n>)\n

Loads only the methods listed on lines <m> to, and including, <n> in the specified limit file. In consequence, the compiler does a JIT compilation on other methods instead.

<filename>. Methods not listed in the limit file and methods listed on lines outside the range are not loaded.

Note: loadLimitFile can only be specified on -Xaot; it does not have an equivalent on -Xjit.

"},{"location":"xaot/#see-also","title":"See also","text":""},{"location":"xargencoding/","title":"-Xargencoding","text":""},{"location":"xargencoding/#-xargencoding","title":"-Xargencoding","text":"

The java and javaw launchers accept arguments and class names containing any character that is in the character set of the current locale. You can also specify any Unicode character in the class name and arguments by using Java\u2122 escape sequences.

To do this, use the -Xargencoding command-line option.

"},{"location":"xargencoding/#syntax","title":"Syntax","text":"
    -Xargencoding:<parameter>\n
"},{"location":"xargencoding/#parameters","title":"Parameters","text":""},{"location":"xargencoding/#no-parameter","title":"No parameter","text":"
    -Xargencoding\n
You can use Unicode escape sequences in the argument list that you pass to this option. To specify a Unicode character, use escape sequences in the form \\u####, where # is a hexadecimal digit (0-9, A-F). For example, to specify a class that is called HelloWorld and use Unicode encoding for both capital letters, use this command:
java -Xargencoding \\u0048ello\\u0057orld\n
"},{"location":"xargencoding/#utf8","title":"utf8","text":"
    -Xargencoding:utf8\n
Use utf8 encoding."},{"location":"xargencoding/#latin","title":"latin","text":"
    -Xargencoding:latin\n
Use ISO8859_1 encoding."},{"location":"xbootclasspath/","title":"-Xbootclasspath","text":""},{"location":"xbootclasspath/#-xbootclasspath","title":"-Xbootclasspath","text":"

This Oracle\u00ae HotSpot\u2122 option specifies the search path for bootstrap classes and resources. The default is to search for bootstrap classes and resources in the internal VM directories and .jar files. The option is recognized by the Eclipse OpenJ9\u2122 VM.

"},{"location":"xbootclasspath/#syntax","title":"Syntax","text":"Limited to... Setting Effect -Xbootclasspath:<path> Sets the search path for bootstrap classes and resources. -Xbootclasspath/p:<path> Prepends the specified resources to the front of the bootstrap class path. -Xbootclasspath/a:<path> Appends the specified resources to the end of the bootstrap class path. where <path> represents directories and compressed or Java\u2122 archive files separated with colons (:). On Windows\u2122 systems, use a semicolon (;) as a separator.

Oracle advise that you should \"not deploy applications that use this option to override a class in rt.jar, because this violates the JRE binary code license.\"

"},{"location":"xceehdlr/","title":"-XCEEHDLR","text":""},{"location":"xceehdlr/#-xceehdlr","title":"-XCEEHDLR","text":"

(31-bit z/OS\u00ae only)

Controls Eclipse OpenJ9\u2122 VM Language Environment\u00ae condition handling.

"},{"location":"xceehdlr/#syntax","title":"Syntax","text":"
    -XCEEHDLR\n
"},{"location":"xceehdlr/#explanation","title":"Explanation","text":"

Use the -XCEEHDLR option if you want the new behavior for the Java\u2122 and COBOL interoperability batch mode environment, because this option makes signal and condition handling behavior more predictable in a mixed Java and COBOL environment.

When the -XCEEHDLR option is enabled, a condition triggered by an arithmetic operation while executing a Java Native Interface (JNI) component causes the VM to convert the Language Environment condition into a Java ConditionException.

When the -XCEEHDLR option is used the VM does not install POSIX signal handlers for the following signals:

Instead, user condition handlers are registered by the VM, using the CEEHDLR() method. These condition handlers are registered every time a thread calls into the VM. Threads call into the VM using the Java Native Interface and including the invocation interfaces, for example JNI\\_CreateJavaVM.

The Java runtime continues to register POSIX signal handlers for the following signals:

Signal chaining using the libjsig.so library is not supported.

When the -XCEEHDLR option is used, condition handler actions take place in the following sequence:

  1. All severity 0 and severity 1 conditions are percolated.
  2. If a Language Environment condition is triggered in JNI code as a result of an arithmetic operation, the VM condition handler resumes executing Java code as if the JNI native code had thrown a com.ibm.le.conditionhandling.ConditionException exception. This exception class is a subclass of java.lang.RuntimeException. Note: The Language Environment conditions that correspond to arithmetic operations are CEE3208S through CEE3234S. However, the Language Environment does not deliver conditions CEE3208S, CEE3213S, or CEE3234S to C applications, so the VM condition handler will not receive them.
  3. If the condition handling reaches this step, the condition is considered to be unrecoverable. RAS diagnostic information is generated, and the VM ends by calling the CEE3AB2() service with abend code 3565, reason code 0, and cleanup code 0.

Restriction: You cannot use -Xsignal:userConditionHandler=percolate and -XCEEHDLR together.

"},{"location":"xceehdlr/#see-also","title":"See also","text":""},{"location":"xcheck/","title":"-Xcheck","text":""},{"location":"xcheck/#-xcheck","title":"-Xcheck","text":"

You can use the -Xcheck option to run checks during Eclipse OpenJ9\u2122 virtual machine (VM) startup, such as memory checks or checks on JNI functions.

"},{"location":"xcheck/#syntax","title":"Syntax","text":"
    -Xcheck:<parameter>\n
"},{"location":"xcheck/#parameters","title":"Parameters","text":"Parameter Effect classpath Checks the classpath and reports errors such as a missing directory or JAR file. dump Checks the operating system for settings that might truncate system dumps. (AIX\u00ae and Linux\u00ae only) gc Runs additional checks on garbage collection. jni Runs additional checks for JNI functions. memory Identifies memory leaks inside the VM using strict checks that cause the VM to exit on failure. vm Performs additional checks on the VM."},{"location":"xcheck/#classpath","title":"classpath","text":"
    -Xcheck:classpath\n
Checks the classpath and reports errors such as a missing directory or JAR file."},{"location":"xcheck/#dump","title":"dump","text":"

AIX and Linux only

    -Xcheck:dump\n

Checks operating system settings during VM startup. Messages are issued if the operating system has settings that might truncate system dumps.

On AIX systems, the following messages are possible:

This message indicates that the AIX operating system user limit is set to restrict the size of system dumps to the value indicated. If a system dump is produced by the VM it might be truncated, and therefore of greatly reduced value in investigating the cause of crashes and other issues. For more information about how to set user limits on AIX, see Setting system resource limits on AIX and Linux systems. This message indicates that the AIX operating system Enable full CORE dumpoption is set to FALSE. This setting might result in truncated system dumps. For more information about how to set this option correctly on AIX, see Setting system resource limits on AIX and Linux systems.

On Linux systems, the following messages are possible:

This message indicates that the Linux operating system user limit is set to restrict the size of system dumps to the value indicated. If a system dump is produced by the VM, it might be truncated and therefore of greatly reduced value in investigating the cause of crashes and other issues. Review the documentation that is provided for your operating system to correctly configure the value for ulimits. For further information, see Setting system resource limits on AIX and Linux systems. This message means that an external program, abrt-hook-ccpp, is configured in the operating system to intercept any system dump files that are generated. This program is part of the Automatic Bug Reporting Tool (ABRT). For more information, see Automatic Bug Reporting Tool. This tool might interfere with the VM's system dump file processing by renaming or truncating system dumps. Review the configuration of the ABRT tool and messages that are written by the tool in/var/log/messages. If problems occur when generating system dumps from the VM, consider disabling ABRT. This message means that an external program, apport, is configured in the operating system to intercept any system dump files that are generated. For more information about this tool, see: Apport The tool might interfere with the VM's system dump file processing by renaming or truncating system dumps. Review the configuration of the Apport tool and messages that are written by the tool in /var/log/apport.log. If problems occur when generating system dumps from the VM, consider disabling the Apport tool. This message indicates that the Linux /proc/sys/kernel/core_pattern option is set to rename system dumps. The tokens that are used in the operating system dump name might interfere with the VM's system dump file processing, in particular with file names specified in the VM -Xdump options. If problems occur when generating system dumps from the VM, consider changing the /proc/sys/kernel/core_pattern setting to the default value of core."},{"location":"xcheck/#gc","title":"gc","text":"
    -Xcheck:gc[:help][:<scan options>][:<verify options>][:<misc options>]\n
Runs additional checks on garbage collection. By default, no checks are made. There are many scan, verify, and miscellaneous suboptions available. If you do not specify any, all possible scan and verify suboptions are run, plus the miscellaneous verbose and check suboptions. For more information, see the output of -Xcheck:gc:help."},{"location":"xcheck/#jni","title":"jni","text":"
    -Xcheck:jni[:help][:<option>]\n
Runs additional checks for JNI functions. By default, no checks are made. For more information, see the output of -Xcheck:jni:help."},{"location":"xcheck/#memory","title":"memory","text":"
    -Xcheck:memory[:<option>]\n
Identifies memory leaks inside the VM by using strict checks that cause the VM to exit on failure. Restriction: You cannot include -Xcheck:memory in the options file (see -Xoptionsfile).

The available parameters are as follows:

:all (Default if no options specified) Enables checking of all allocated and freed blocks on every free and allocate call. This check of the heap is the most thorough. It typically causes the VM to exit on nearly all memory-related problems soon after they are caused. This option has the greatest affect on performance. :callsite=<number_of_allocations>

Displays callsite information every <number_of_allocations>. De-allocations are not counted. Callsite information is presented in a table with separate information for each callsite. Statistics include:

Callsites are presented as sourcefile:linenumber for C code and assembly function name for assembler code.

Callsites that do not provide callsite information are accumulated into an \"unknown\" entry.

:failat=<number_of_allocations>

Causes memory allocation to fail (return NULL) after <number_of_allocations>. For example, setting <number_of_allocations> to 13 causes the 14th allocation to return NULL. De-allocations are not counted. Use this option to ensure that VM code reliably handles allocation failures. This option is useful for checking allocation site behavior rather than setting a specific allocation limit.

:ignoreUnknownBlocks Ignores attempts to free memory that was not allocated using the -Xcheck:memory tool. Instead, the -Xcheck:memory statistics that are printed out at the end of a run indicates the number of \"unknown\" blocks that were freed. :mprotect=[top|bottom] Locks pages of memory on supported platforms, causing the program to stop if padding before or after the allocated block is accessed for reads or writes. An extra page is locked on each side of the block returned to the user. If you do not request an exact multiple of one page of memory, a region on one side of your memory is not locked. The top and bottom options control which side of the memory area is locked. top aligns your memory blocks to the top of the page (lower address), so buffer underruns result in an application failure. bottom aligns your memory blocks to the bottom of the page (higher address) so buffer overruns result in an application failure. Standard padding scans detect buffer underruns when using top and buffer overruns when using bottom. :nofree Keeps a list of blocks that are already used instead of freeing memory. This list, and the list of currently allocated blocks, is checked for memory corruption on every allocation and deallocation. Use this option to detect a dangling pointer (a pointer that is \"dereferenced\" after its target memory is freed). This option cannot be reliably used with long-running applications (such as WebSphere\u00ae Application Server), because \"freed\" memory is never reused or released by the VM. :noscan Checks for blocks that are not freed. This option has little effect on performance, but memory corruption is not detected. This option is compatible only with subAllocator, callsite, and callsitesmall. :quick Enables block padding only and is used to detect basic heap corruption. Every allocated block is padded with sentinel bytes, which are verified on every allocate and free. Block padding is faster than the default of checking every block, but is not as effective. :skipto=<number_of_allocations> Causes the program to check only on allocations that occur after <number_of_allocations>. De-allocations are not counted. Use this option to speed up VM startup when early allocations are not causing the memory problem. The VM performs approximately 250+ allocations during startup. :subAllocator[=<size_in_MB>] Allocates a dedicated and contiguous region of memory for all VM allocations. This option helps to determine if user JNI code or the VM is responsible for memory corruption. Corruption in the VM subAllocator heap suggests that the VM is causing the problem; corruption in the user-allocated memory suggests that user code is corrupting memory. Typically, user and VM allocated memory are interleaved. :zero Newly allocated blocks are set to 0 instead of being filled with the 0xE7E7xxxxxxxxE7E7 pattern. Setting these blocks to 0 helps you to determine whether a callsite is expecting zeroed memory, in which case the allocation request is followed by memset(pointer, 0, size)."},{"location":"xcheck/#vm","title":"vm","text":"
    -Xcheck:vm[:<option>]\n
Performs additional checks on the VM. By default, no checking is performed. For more information, run -Xcheck:vm:help."},{"location":"xclassgc/","title":"-Xclassgc","text":""},{"location":"xclassgc/#-xclassgc-xnoclassgc","title":"-Xclassgc / -Xnoclassgc","text":"

These options enable or disable the garbage collection (GC) of storage that is associated with Java classes that are no longer being used by the Eclipse OpenJ9\u2122 VM.

When enabled, GC occurs only on class loader changes. To always enable dynamic class unloading regardless of class loader changes, set -Xalwaysclassgc.

Note: Disabling class GC is not recommended because unlimited native memory growth can occur, which can lead to out-of-memory errors.

"},{"location":"xclassgc/#syntax","title":"Syntax","text":"Setting Action Default -Xclassgc Enables dynamic class unloading on demand yes -Xnoclassgc Disables dynamic class unloading

These options can be used with all OpenJ9 GC policies.

"},{"location":"xclassgc/#see-also","title":"See also","text":""},{"location":"xcodecache/","title":"-Xcodecache","text":""},{"location":"xcodecache/#-xcodecache","title":"-Xcodecache","text":"

Use this option to tune performance.

This option sets the size of each block of memory that is allocated to store the native code of compiled Java\u2122 methods. By default, this size is selected internally according to the processor architecture and the capability of your system. The maximum value you can specify is 32 MB. If you set a value larger than 32 MB, the JIT ignores the input and sets the value to 32 MB.

Note: The JIT compiler might allocate more than one code cache for an application. Use the -Xcodecachetotal option to set the maximum amount of memory that is used by all code caches.

"},{"location":"xcodecache/#syntax","title":"Syntax","text":"
    -Xcodecache<size>\n
See Using -X command-line options for more information about specifying the <size> parameter."},{"location":"xcodecachetotal/","title":"-Xcodecachetotal","text":""},{"location":"xcodecachetotal/#-xcodecachetotal","title":"-Xcodecachetotal","text":"

Use this option to set the maximum size limit for the JIT code cache. This option also affects the size of the JIT data cache.

"},{"location":"xcodecachetotal/#syntax","title":"Syntax","text":"
    -Xcodecachetotal<size>\n

The default size is 256 MB for a 64-bit VM and 64 MB for a 31/32-bit VM.

See Using -X command-line options for more information about specifying the <size> parameter.

"},{"location":"xcodecachetotal/#explanation","title":"Explanation","text":"

By default, the total JIT code cache size is 256 MB for a 64-bit VM and 64 MB for a 31/32-bit VM or 25% of the physical memory available to the VM process, whichever is lesser. Long-running, complex, server-type applications can fill the JIT code cache, which can cause performance problems because not all of the important methods can be JIT-compiled. Use the -Xcodecachetotal option to increase or decrease the maximum code cache size to a setting that suits your application. The minimum size of the code cache is restricted to 2 MB.

The value that you specify is rounded up to a multiple of the code cache block size, as specified by the -Xcodecache option. If you specify a value for the -Xcodecachetotal option that is smaller than the default setting, that value is ignored.

When you use this option, the maximum size limit for the JIT data cache, which holds metadata about compiled methods, is increased or decreased proportionally to support the JIT compilations.

The maximum size limits, for both the JIT code and data caches, that are in use by the VM are shown in Javadump output. Look for lines that begin with 1STSEGLIMIT. Use this information together with verbose JIT tracing to determine suitable values for this option on your system. For example Javadump output, see Java dump: Storage Management (MEMINFO).

"},{"location":"xcodecachetotal/#see-also","title":"See also","text":""},{"location":"xcomp/","title":"-Xcomp","text":""},{"location":"xcomp/#-xcomp","title":"-Xcomp","text":"

The use of this option is deprecated; use -Xjit:count=0 instead.

"},{"location":"xcomp/#syntax","title":"Syntax","text":"
    -Xcomp\n
"},{"location":"xcompactexplicitgc/","title":"-Xcompactexplicitgc","text":""},{"location":"xcompactexplicitgc/#xcompactexplicitgc-xnocompactexplicitgc","title":"\u2011Xcompactexplicitgc / \u2011Xnocompactexplicitgc","text":"

These options enable or disable full compaction each time System.gc() is called.

Compaction takes place on global garbage collections if you specify -Xcompactgc or if compaction triggers are met.

"},{"location":"xcompactexplicitgc/#syntax","title":"Syntax","text":"Setting Action Default -Xcompactexplicitgc Enable compaction yes -Xnocompactexplicitgc Disable compaction"},{"location":"xcompactexplicitgc/#see-also","title":"See also","text":""},{"location":"xcompactgc/","title":"-Xcompactgc","text":""},{"location":"xcompactgc/#-xcompactgc-xnocompactgc","title":"-Xcompactgc / -Xnocompactgc","text":"

These options enable or disable full compaction on system and global garbage collection (GC) activities.

"},{"location":"xcompactgc/#syntax","title":"Syntax","text":"Setting Action -Xcompactgc Enable full compaction -Xnocompactgc Disable full compaction"},{"location":"xcompactgc/#default-behavior","title":"Default behavior","text":"

If a compaction option is not specified, the garbage collector compacts based on a series of triggers. These triggers attempt to compact only when it is beneficial to the future performance of the VM.

These options are not applicable to the following GC policies:

"},{"location":"xcompactgc/#see-also","title":"See also","text":""},{"location":"xcompilationthreads/","title":"-XcompilationThreads","text":""},{"location":"xcompilationthreads/#-xcompilationthreads","title":"-XcompilationThreads","text":"

Use this option to specify the number of compilation threads that are used by the JIT compiler.

"},{"location":"xcompilationthreads/#syntax","title":"Syntax","text":"
    -XcompilationThreads<n>\n
Where <n> is the number of threads. The minimum value is 1. The default and maximum values depend on whether the VM is running with the JITServer feature enabled and if so, whether the VM is running as a JITServer server, as shown in the following table: JIT compiler scenario Default value Maximum value JIT and JITServer client Determined by internal JIT heuristics that consider the number of CPUs that the VM is allowed to use 15 JITServer server 63 999 Any number outside this range is ignored. Setting the compilation threads to zero does not disable the JIT compiler. If you want to disable the JIT, use the -Xint option."},{"location":"xcompilationthreads/#explanation","title":"Explanation","text":"

When multiple compilation threads are used, the JIT might generate several diagnostic log files. A log file is generated for each compilation thread. The naming convention for the log file generated by the first compilation thread uses the following pattern:

<specified_filename>.<date>.<time>.<pid>\n

The first compilation thread has ID 0. Log files generated by the second and subsequent compilation threads append the ID of the corresponding compilation thread as a suffix to the log file name. The pattern for these log file names is as follows:

<specified_filename>.<date>.<time>.<pid>.<compilation_thread_ID>\n

For example, the second compilation thread has ID 1. The result is that the corresponding log file name has the form:

<specified_filename>.<date>.<time>.<pid>.1\n
"},{"location":"xcompilationthreads/#see-also","title":"See also","text":""},{"location":"xcompressedrefs/","title":"-Xcompressedrefs","text":""},{"location":"xcompressedrefs/#-xcompressedrefs-xnocompressedrefs","title":"-Xcompressedrefs / -Xnocompressedrefs","text":"

(64-bit only)

These options enable or disable the use of compressed references.

Restriction: You cannot include -Xcompressedrefs in the options file (see -Xoptionsfile).

"},{"location":"xcompressedrefs/#syntax","title":"Syntax","text":"Setting Action Default -Xcompressedrefs Enable compression yes (see Default behavior) -Xnocompressedrefs Disable compression"},{"location":"xcompressedrefs/#default-behavior","title":"Default behavior","text":"

Compressed references are enabled by default when -Xmx \u2264 57 GB.

z/OS\u00ae: This threshold value assumes that you have APAR OA49416 installed. If you do not have the APAR installed, the threshold value is 25 GB.

AIX\u00ae and Linux\u00ae: For the metronome garbage collection policy, the threshold is 25 GB.

"},{"location":"xcompressedrefs/#see-also","title":"See also","text":""},{"location":"xconcurrentbackground/","title":"-Xconcurrentbackground","text":""},{"location":"xconcurrentbackground/#-xconcurrentbackground","title":"-Xconcurrentbackground","text":"

Specifies the number of low-priority background threads that are attached to assist the mutator threads in concurrent mark operations. This option maps directly to the HotSpot -XX:ParallelCMSThreads=N and -XX:ConcGCThreads=N options.

"},{"location":"xconcurrentbackground/#syntax","title":"Syntax","text":"
    -Xconcurrentbackground<n>\n
"},{"location":"xconcurrentbackground/#default-behavior","title":"Default behavior","text":"

The default value is 1.

Note: This value is reported in the header section of a verbose GC log with the entry <attribute name=\"gcthreads Concurrent Mark\" value=\"1\" />.

This option is not supported with the balanced GC policy (-Xgcpolicy:balanced) or metronome GC policy (-Xgcpolicy:metronome).

"},{"location":"xconcurrentbackground/#see-also","title":"See also","text":""},{"location":"xconcurrentlevel/","title":"-Xconcurrentlevel","text":""},{"location":"xconcurrentlevel/#-xconcurrentlevel","title":"-Xconcurrentlevel","text":"

This option indicates the ratio between the amount of heap allocated and the amount of heap marked, which is known as the allocation tax rate.

"},{"location":"xconcurrentlevel/#syntax","title":"Syntax","text":"
    -Xconcurrentlevel<number>\n
"},{"location":"xconcurrentlevel/#default-behavior","title":"Default behavior","text":"

The default is 8.

This option is not supported with the balanced GC policy (-Xgcpolicy:balanced) or metronome GC policy (-Xgcpolicy:metronome).

"},{"location":"xconcurrentslack/","title":"-Xconcurrentslack","text":""},{"location":"xconcurrentslack/#-xconcurrentslack","title":"-Xconcurrentslack","text":"

Attempts to keep the specified amount of the heap space free in concurrent collectors by starting the concurrent operations earlier.

Using this option can sometimes alleviate pause time problems in concurrent collectors at the cost of longer concurrent cycles, affecting total throughput.

"},{"location":"xconcurrentslack/#syntax","title":"Syntax","text":"
    -Xconcurrentslack<size>\n
See Using -X command-line options for more information about specifying the <size> parameter."},{"location":"xconcurrentslack/#default-behavior","title":"Default behavior","text":"

The default value is 0, which is optimal for most applications.

This option is not supported with the balanced GC policy (-Xgcpolicy:balanced), the optimize for throughput policy (-Xgcpolicy:optthruput), or metronome GC policy (-Xgcpolicy:metronome).

"},{"location":"xconmeter/","title":"-Xconmeter","text":""},{"location":"xconmeter/#-xconmeter","title":"-Xconmeter","text":"

This option determines the usage of which area, LOA (large object area) or SOA (small object area), is metered and therefore which allocations are taxed during concurrent mark operations.

"},{"location":"xconmeter/#syntax","title":"Syntax","text":"
    -Xconmeter:<parameter>\n
"},{"location":"xconmeter/#parameters","title":"Parameters","text":""},{"location":"xconmeter/#soa","title":"soa","text":"
    -Xconmeter:soa\n
(Default) Applies the allocation tax to allocations from the small object area (SOA)."},{"location":"xconmeter/#loa","title":"loa","text":"
    -Xconmeter:loa\n
Applies the allocation tax to allocations from the large object area (LOA)."},{"location":"xconmeter/#dynamic","title":"dynamic","text":"
    -Xconmeter:dynamic\n
The collector dynamically determines which area to meter based on which area is exhausted first, whether it is the SOA or the LOA."},{"location":"xconmeter/#default-behavior","title":"Default behavior","text":"

By default, allocation tax is applied to the SOA.

This option is not supported with the balanced GC policy (-Xgcpolicy:balanced) or metronome GC policy (-Xgcpolicy:metronome).

"},{"location":"xdisablejavadump/","title":"-Xdisablejavadump","text":""},{"location":"xdisablejavadump/#-xdisablejavadump","title":"-Xdisablejavadump","text":"

Turns off Java dump generation on errors and signals.

"},{"location":"xdisablejavadump/#syntax","title":"Syntax","text":"
    -Xdisablejavadump\n
"},{"location":"xdisablejavadump/#default-behavior","title":"Default behavior","text":"

By default, Javadump generation is enabled.

"},{"location":"xdisablejavadump/#see-also","title":"See also","text":""},{"location":"xdump/","title":"-Xdump","text":""},{"location":"xdump/#-xdump","title":"-Xdump","text":"

OpenJ9 produces various types of diagnostic information for analysis when different events occur, such as a general protection fault. The dumps produced are controlled by dump agents, which are initialized when the OpenJ9 virtual machine (VM) starts. The default settings for the dump agents are sufficient for most cases. However, you can use the -Xdump option on the command line to fine tune the dump agent settings. For example, you can use the -Xdump option to add and remove dump agents for various VM events, update default dump settings, and limit the number of dumps that are produced.

A large set of options and suboptions are available for controlling dumps, which provides a lot of flexibility.

"},{"location":"xdump/#xdump-option-builder","title":"Xdump Option Builder","text":"

Use the Xdump Option Builder tool to help you specify the correct options and avoid incompatibilities.

"},{"location":"xdump/#syntax","title":"Syntax","text":"
    -Xdump:<parameter>\n

The following table lists the help options for -Xdump, which provide usage and configuration information:

Command Result -Xdump:help Displays general dump help. -Xdump:events Lists available trigger events. -Xdump:request Lists additional VM requests. -Xdump:tokens Lists recognized label tokens. -Xdump:what Shows registered agents on startup. -Xdump:<agent>:help Displays dump agent usage information.

The following options can be used to control the production of diagnostic data:

Parameter Result -Xdump:none Removes all default dump agents and any preceding dump options. -Xdump:dynamic Enable support for pluggable agents -Xdump:nofailover Discards dumps when the default or specified dump location is full. -Xdump:directory=<path> Specifies a directory for all dump types to be written to. This directory path is prefixed to the path of all non-absolute dump file names, including the file names for the default dump agents. -Xdump:suspendwith=<offset> Modifies the signal that is used to suspend VM threads while a dump file is being written. Use <offset> to change the default signal number. (Linux\u00ae only) -Xdump:<agent>:<suboptions> Provides detailed suboptions per dump agent that provide more granular control.

Dump agents can be configured at a very granular level by specifying suboptions. The <events> suboption is the prime trigger mechanism. If no events are specified explicitly, then the default settings for the corresponding agent are added. For more information, see Default dump agents. You can update the default dump settings by using the defaults suboption. The full set of suboptions are listed in the following table:

Dump agent suboptions Result -Xdump:<agent>:none Removes the dump agent. -Xdump:<agent>:defaults Prints the default options for the dump agent. -Xdump:<agent>:events=<events> Triggers a dump agent when a specific event occurs. -Xdump:<agent>:exec=<command> Starts an external application for the dump agent. -Xdump:<agent>:file=<filename> Specifies where to write the dump for the dump agent. -Xdump:<agent>:filter=<filter> Filters dumps by wildcards or events. -Xdump:<agent>:msg_filter=<filter> Filters on text strings within an exception message. -Xdump:<agent>:opts=<options> Used by specific dump agents to select the type of dump file to produce. -Xdump:<agent>:priority=<0-999> Specifies the priority that the dump agents run in. -Xdump:<agent>:range=<ranges> Starts and stops a dump agent on a particular occurrence of a VM. -Xdump:<agent>:request=<requests> Asks the VM to prepare the state before starting the dump agent.

You can have multiple -Xdump options on the command line. You can also have multiple dump types triggered by multiple events. For example, the following command turns off the creation of heap dump files, and creates a dump agent that produces a heap dump file and a Java\u2122 dump file when either a vmstart or vmstop event occurs:

java -Xdump:heap:none -Xdump:heap+java:events=vmstart+vmstop -mp . -m <class> [args...]\n

Note: Multiple suboptions that follow an Xdump suboption must be split with a comma (,), for example:

java -Xdump:java:events=vmstart,file=/STDERR/ -version\n

For more detailed information on these parameters and suboptions, including examples, see Parameters.

"},{"location":"xdump/#dump-agents","title":"Dump agents","text":"

A dump agent performs diagnostic tasks when triggered. Most dump agents save information on the state of the VM in some form of dump or trace file for later analysis. An exception is the \"tool\" agent, which can be used to trigger external processes when specific events occur.

Dump agent Description stack Stack dumps are very basic dumps in which the status and Java stack of the thread is written to stderr. console Console dumps are very basic dumps, in which the status of every Java thread is written to stderr. system System dumps capture the raw process image or address space of an application. tool The tool option allows external processes to be started when an event occurs. java Java dumps are an internally generated and formatted analysis of the VM, giving information that includes the Java threads present, the classes loaded, and heap statistics. heap Heap dumps capture all object instances in the heap, including each object address, type or class name, size, and references to other objects. snap Take a snap of the trace buffers, which contain tracepoint data. ceedump LE CEEDUMP dumps are z/OS\u00ae formatted summary system dumps that show stack traces for each thread that is in the VM process, together with register information and a short dump of storage for each register. jit JIT compiler dumps contain diagnostic data in a binary format. exit Shut down the VM."},{"location":"xdump/#default-dump-agents","title":"Default dump agents","text":"

During VM initialization a set of dump agents are added by default. You can override this set of dump agents using -Xdump on the command line. To show the registered dump agents, user the Xdump:what option on the command line. The following sample output shows the default dump agents that are in place on a Linux system:

java -Xdump:what\n\nRegistered dump agents\n----------------------\n-Xdump:system:\n    events=gpf+abort+traceassert+corruptcache,\n    file=/home/user/core.%Y%m%d.%H%M%S.%pid.%seq.dmp,\n    range=1..0,\n    priority=999,\n    request=serial\n----------------------\n-Xdump:system:\n    events=systhrow,\n    filter=java/lang/OutOfMemoryError,\n    file=/home/user/core.%Y%m%d.%H%M%S.%pid.%seq.dmp,\n    range=1..1,\n    priority=999,\n    request=exclusive+compact+prepwalk\n----------------------\n-Xdump:heap:\n    events=systhrow,\n    filter=java/lang/OutOfMemoryError,\n    file=/home/user/heapdump.%Y%m%d.%H%M%S.%pid.%seq.phd,\n    range=1..4,\n    priority=500,\n    request=exclusive+compact+prepwalk,\n    opts=PHD\n----------------------\n-Xdump:java:\n    events=gpf+user+abort+traceassert+corruptcache,\n    file=/home/user/javacore.%Y%m%d.%H%M%S.%pid.%seq.txt,\n    range=1..0,\n    priority=400,\n    request=exclusive+preempt\n----------------------\n-Xdump:java:\n    events=systhrow,\n    filter=java/lang/OutOfMemoryError,\n    file=/home/user/javacore.%Y%m%d.%H%M%S.%pid.%seq.txt,\n    range=1..4,\n    priority=400,\n    request=exclusive+preempt\n----------------------\n-Xdump:snap:\n    events=gpf+abort+traceassert+corruptcache,\n    file=/home/user/Snap.%Y%m%d.%H%M%S.%pid.%seq.trc,\n    range=1..0,\n    priority=300,\n    request=serial\n----------------------\n-Xdump:snap:\n    events=systhrow,\n    filter=java/lang/OutOfMemoryError,\n    file=/home/user/Snap.%Y%m%d.%H%M%S.%pid.%seq.trc,\n    range=1..4,\n    priority=300,\n    request=serial\n----------------------\n-Xdump:jit:\n    events=gpf+abort,\n    file=/home/user/jitdump.%Y%m%d.%H%M%S.%pid.%seq.dmp,\n    range=1..0,\n    priority=200,\n    request=serial\n----------------------\n
"},{"location":"xdump/#dump-agent-tokens","title":"Dump agent tokens","text":"

You can use tokens to add context to dump file names and directories, and to pass command-line arguments to the tool agent. The tokens available are listed in the following tables:

Token Description %Y Year (4 digits) %y Year (2 digits) %m Month (2 digits) %d Day of the month (2 digits) %H Hour (2 digits) %M Minute (2 digits) %S Second (2 digits) %home Java home directory %last Last dump %pid Process ID %seq Dump counter %tick msec counter %uid User name

The following tokens are applicable only to z/OS:

Token Description %asid Address space ID %job Job name %jobid Job ID %sysname SYSNAME sysparm &DS Dump Section. An incrementing sequence number used for splitting TDUMP files to be less than 2 GB in size. (64-bit only)"},{"location":"xdump/#merging-dump-agents","title":"Merging dump agents","text":"

If you configure more than one dump agent, each responds to events according to its configuration. However, the internal structures representing the dump agent configuration might not match the command line because dump agents are merged for efficiency. Two sets of options can be merged as long as none of the agent settings conflict. This means that the list of installed dump agents and their parameters produced by -Xdump:what might not be grouped in the same way as the original -Xdump options that configured them.

For example, you can use the following command to specify that a dump agent creates a Java dump file on class unload:

java -Xdump:java:events=unload -Xdump:what\n

This command does not create a new agent, as can be seen in the results from the -Xdump:what option.

...\n----------------------\n-Xdump:java:\n    events=gpf+user+abort+unload+traceassert+corruptcache,\n    file=/home/user/javacore.%Y%m%d.%H%M%S.%pid.%seq.txt,\n    range=1..0,\n    priority=400,\n    request=exclusive+preempt\n----------------------\n

The configuration is merged with the existing Java dump agent for events gpf, user, abort, traceassert, and corruptcache, because none of the specified options for the new unload agent conflict with those for the existing agent.

In the previous example, if one of the parameters for the unload agent is changed so that it conflicts with the existing agent, then it cannot be merged. For example, the following command specifies a different priority, forcing a separate agent to be created:

java -Xdump:java:events=unload,priority=100 -Xdump:what\n

The results of the -Xdump:what option in the command are as follows.

...\n----------------------\n-Xdump:java:\n    events=unload,\n    file=/home/user/javacore.%Y%m%d.%H%M%S.%pid.%seq.txt,\n    range=1..0,\n    priority=100,\n    request=exclusive+preempt\n----------------------\n-Xdump:java:\n    events=gpf+user+abort+traceassert+corruptcache,\n    file=/home/user/javacore.%Y%m%d.%H%M%S.%pid.%seq.txt,\n    range=1..0,\n    priority=400,\n    request=exclusive+preempt\n----------------------\n

To merge dump agents, the request, filter, opts, file, and range parameters must match exactly. If you specify multiple agents that filter on the same string, but keep all other parameters the same, the agents are merged. For example:

java -Xdump:none -Xdump:java:events=uncaught,filter=java/lang/NullPointerException -Xdump:java:events=unload,filter=java/lang/NullPointerException -Xdump:what\n

The results of this command are as follows:

Registered dump agents\n----------------------\n-Xdump:java:\n    events=unload+uncaught,\n    filter=java/lang/NullPointerException,\n    file=/home/user/javacore.%Y%m%d.%H%M%S.%pid.%seq.txt,\n    range=1..0,\n    priority=400,\n    request=exclusive+preempt\n----------------------\n
"},{"location":"xdump/#dump-events","title":"Dump events","text":"

Dump agents are triggered by events occurring during operation of the OpenJ9 VM. Some events can be filtered to improve the relevance of the output.

The following table shows the events that are available as dump agent triggers:

Event Triggered when.... Filters on.... gpf A General Protection Fault (GPF) occurs. Not applicable user The VM receives the SIGQUIT (Linux, macOS\u00ae, AIX\u00ae, z/OS) or SIGBREAK (Windows\u2122) signal from the operating system. Not applicable user2 The VM receives the SIGUSR2 (Linux, AIX, z/OS, and macOS) signal from the operating system. Not applicable abort The VM receives the SIGABRT signal from the operating system. Not applicable vmstart The virtual machine is started. Not applicable vmstop The virtual machine stops. Exit code; for example, filter=#129..#192#-42#255 load A class is loaded. Class name; for example, filter=java/lang/String unload A class is unloaded. Not applicable throw An exception is thrown explicitly in Java code. Use 'systhrow' for unexpected VM exceptions. Exception class name; for example, filter=java/lang/OutOfMem* catch An exception is caught. Exception class name; for example, filter=*Memory* uncaught A Java exception is not caught by the application. Exception class name; for example, filter=*MemoryError systhrow A Java exception is about to be thrown by the VM. This is different from the 'throw' event because it is only triggered for error conditions detected internally in the VM. Exception class name; for example, filter=java/lang/OutOfMem*. thrstart A new thread is started. Not applicable blocked A thread becomes blocked. Not applicable thrstop A thread stops. Not applicable fullgc A garbage collection cycle is started. Not applicable slow A thread takes longer than 50 ms to respond to an internal VM request. Time taken; for example, filter=#300ms will trigger when a thread takes longer than 300 ms to respond to an internal VM request. allocation A Java object is allocated with a size matching the given filter specification. Object size; a filter must be supplied. For example, filter=#5m will trigger on objects larger than 5 Mb. Ranges are also supported; for example, filter=#256k..512k will trigger on objects 256 - 512 Kb in size. traceassert An internal error occurs in the VM. Not applicable corruptcache The VM finds that the shared classes cache is corrupt. Not applicable excessivegc An excessive amount of time is being spent in the garbage collector. Not applicable

Notes:

-Xdump:system:events=user2,request=exclusive+prepwalk\n
"},{"location":"xdump/#parameters","title":"Parameters","text":"

-Xdump:<agent>:<suboptions> descriptions and examples.

"},{"location":"xdump/#help","title":"help","text":"

To print usage information for a specific dump agent, use -Xdump:<agent>:help

"},{"location":"xdump/#noneoptions","title":"none:<options>","text":"

Use the -Xdump:none option to add and remove dump agents for various VM events, update default dump settings (such as the dump name), and limit the number of dumps that are produced.

The option can be used to affect all agents by specifying -Xdump:none:<options> or specific agents by specifying -Xdump:<agent>:none:<suboptions>

where <suboptions> is one of the following control types:

Explanations for these suboptions are provided elsewhere in this topic.

To remove all default dump agents and any preceding dump options, use -Xdump:none. Use this option so that you can subsequently specify a completely new dump configuration.

You can also remove dump agents of a particular type. Here are some examples:

To turn off all heap dumps (including default agents) but leave Java dumps enabled, use the following option:

-Xdump:java+heap:events=vmstop -Xdump:heap:none\n

To turn off all dump agents for corruptcache events:

-Xdump:none:events=corruptcache\n

To turn off just system dumps for corruptcache events:

-Xdump:system:none:events=corruptcache\n

To turn off all dumps when a java/lang/OutOfMemory error is thrown:

-Xdump:none:events=systhrow,filter=java/lang/OutOfMemoryError\n

To turn off just system dumps when a java/lang/OutOfMemory error is thrown:

-Xdump:system:none:events=systhrow,filter=java/lang/OutOfMemoryError\n

If you remove all dump agents by using -Xdump:none with no further -Xdump options, the VM still provides these basic diagnostic outputs:

Note: Removing dump agents and specifying a new dump configuration can require a long set of command-line options. To reuse command-line options, save the new dump configuration in a file and use the -Xoptionsfile option. For more information, see -Xoptionsfile.

"},{"location":"xdump/#defaults","title":"defaults","text":"

Each dump type has default options. To view the default options for a particular dump type, use -Xdump:<agent>:defaults.

You can change the default options at run time. For example, you can direct Java dump files into a separate directory for each process, and guarantee unique files by adding a sequence number to the file name using:

-Xdump:java:defaults:file=dumps/%pid/javacore-%seq.txt\n

Or, for example, on z/OS, you can add the jobname to the Java dump file name using:

-Xdump:java:defaults:file=javacore.%job.%H%M%S.txt\n

This option does not add a Java dump agent; it updates the default settings for Java dump agents. Further Java dump agents will then create dump files using this specification for filenames, unless overridden.

Note: Changing the defaults for a dump type will also affect the default agents for that dump type added by the VM during initialization. For example, if you change the default file name for Java dump files, that will change the file name used by the default Java dump agents. However, changing the default range option will not change the range used by the default Java dump agents, because those agents override the range option with specific values.

"},{"location":"xdump/#eventsevent","title":"events=<event>","text":"

To trigger a dump as a result of an event, use the -Xdump:<agent>:events=<event> suboption. For a list of possible events, see Dump events.

For example, the following command instructs the VM to create a dump agent at startup that produces a Heap dump whenever the vmstop event happens:

-Xdump:heap:events=vmstop\n
"},{"location":"xdump/#execcommand","title":"exec=<command>","text":"

The exec suboption is used by the tool dump agent to specify an external application to start. You can set a specific command to run for a particular dump agent with the following command:

-Xdump:<agent>:exec=<command>\n
"},{"location":"xdump/#filefilename","title":"file=<filename>","text":"

The file suboption specifies where the diagnostics information is written for the specified dump type. The syntax is -Xdump:<agent>:file=<filename>.

For example, to create a Heap dump called my.dmp when a vmstop event is received, use:

java -Xdump:heap:events=vmstop,file=my.dmp\n

When producing system dump files on z/OS platforms, use the dsn option instead of the file option. For example:

java -Xdump:system:events=vmstop,dsn=%uid.MYDUMP\n
"},{"location":"xdump/#writing-to-stdoutstderr","title":"Writing to STDOUT/STDERR","text":"

Add one of the following options to write a Java dump file to STDOUT or STDERR respectively:

-Xdump:java:file=/STDOUT/\n-Xdump:java:file=/STDERR/\n
"},{"location":"xdump/#tokens","title":"Tokens","text":"

You can use tokens to add context to dump file names. For a list of tokens, see Dump agent tokens.

"},{"location":"xdump/#file-location","title":"File location","text":"

The location for the dump file is selected from the following options, in this order:

  1. The location specified by the -Xdump:<agent>:file suboption on the command line (if that location includes a path). This location applies to the specified dump agent type only.
  2. The location specified by the -Xdump:directory option on the command line. This location applies to all dump agent types.
  3. The location specified by the relevant environment variable:

    Dump agent type z/OS operating systems Other operating systems Java dumps _CEE_DMPTARG IBM_JAVACOREDIR Heap dumps _CEE_DMPTARG IBM_HEAPDUMPDIR System dumps JAVA_DUMP_TDUMP_PATTERN IBM_COREDIR JIT dumps _CEE_DMPTARG IBM_COREDIR Snap traces _CEE_DMPTARG IBM_COREDIR
  4. The current working directory of the OpenJ9 VM process.

If the directory does not exist, it is created.

If the dump file cannot be written to the selected location, the VM reverts to using the following locations, in this order:

  1. On Windows platforms only, the system default location is C:\\WINDOWS.
  2. The location specified by the TMPDIR environment variable.
  3. The C:\\Temp on Windows operating systems, or the /tmp directory on other operating systems.

This VM action does not apply to system dumps on z/OS operating systems that use the dsn option. You can prevent the VM reverting to different dump locations by using the -Xdump:nofailover option.

"},{"location":"xdump/#filterfilter","title":"filter=<filter>","text":"

Some VM events occur thousands of times during the lifetime of an application. Dump agents can use filters and ranges to avoid producing an excessive number of dump files. The following syntax must be used:

-Xdump:<agent>:filter=<filter>\n
"},{"location":"xdump/#wildcards","title":"Wildcards","text":"

You can use a wildcard in your exception event filter by placing an asterisk only at the beginning or end of the filter. The following command does not work because the second asterisk is not at the end:

-Xdump:java:events=throw,filter=*InvalidArgumentException#*.myVirtualMethod\n

To fix the problem, change this filter to the following string:

-Xdump:java:events=throw,filter=*InvalidArgumentException#MyApplication.*\n
"},{"location":"xdump/#class-loading-and-exception-events","title":"Class loading and exception events","text":"

You can filter class loading (load) and exception (throw, catch, uncaught, systhrow) events by the name of the class that is being loaded, thrown or caught. For example:

-Xdump:java:events=load,filter=java/lang/String\n-Xdump:java:events=throw,filter=java/lang/ArrayStoreException\n-Xdump:java:events=catch,filter=java/lang/NullPointerException\n

In addition, you can filter throw, uncaught, and systhrow exception events by the name of the method that throws the exception. The name of the parent class must include the full package name, using the forward slash (/) as a separator. Use a dot (.) to separate the method name from the class name. You can use an asterisk (*) as a wildcard character, to include all methods (optional portions are shown in brackets). For example:

-Xdump:java:events=throw,filter=ExceptionClassName[#com/ibm/ThrowingClassName.throwingMethodName[#stackFrameOffset]]\n

For example, to trigger a Java dump when method MyApplication.myMethod() throws a NullPointerException exception, use the following syntax:

-Xdump:java:events=throw,filter=java/lang/NullPointerException#com/ibm/MyApplication.myMethod\n

The stack frame offset allows you to filter on the name of a method that calls the throwing method. This option is useful if the exception is being thrown from a general purpose or utility class. For example, to trigger a Java dump when a method called by MyApplication.main() throws a NullPointerException, use the following syntax:

-Xdump:java:events=throw,filter=java/lang/NullPointerException#com/ibm/MyApplication.main#1\n

The default value of the stack frame offset is zero.

You can filter the catch exception events by Java method name (optional portions are shown in brackets). For example:

-Xdump:java:events=catch,filter=ExceptionClassName[#com/ibm/CatchingClassName.catchingMethodName]\n

You can filter throw, uncaught, and systhrowexception events by Java method name (optional portions are shown in brackets):

-Xdump:java:events=throw,filter=ExceptionClassName[#com/ibm/ThrowingClassName.throwingMethodName[#stackFrameOffset]]\n

You can filter the catch exception events by Java method name (optional portions are shown in brackets):

-Xdump:java:events=catch,filter=ExceptionClassName[#com/ibm/CatchingClassName.catchingMethodName]\n

Note: The filters apply to the stacktrace and fire every time the same exception is rethrown, which might result in multiple Java core files.

"},{"location":"xdump/#vmstop-event","title":"vmstop event","text":"

You can filter the VM shut down event (vmstop) by using one or more exit codes:

-Xdump:java:events=vmstop,filter=#129..192#-42#255\n
"},{"location":"xdump/#slow-event","title":"slow event","text":"

You can filter the slow event to change the time threshold from the default of 50 ms:

-Xdump:java:events=slow,filter=#300ms\n
"},{"location":"xdump/#allocation-event","title":"allocation event","text":"

You must filter the allocation event to specify the size of objects that cause a trigger. You can set the filter size from zero up to the maximum value of a 32-bit pointer on 32-bit platforms, or the maximum value of a 64-bit pointer on 64-bit platforms. Setting the lower filter value to zero triggers a dump on all allocations.

For example, to trigger dumps on allocations greater than 5 Mb in size, use:

-Xdump:stack:events=allocation,filter=#5m\n

To trigger dumps on allocations between 256 Kb and 512 Kb in size, use:

-Xdump:stack:events=allocation,filter=#256k..512k\n
"},{"location":"xdump/#other-events","title":"Other events","text":"

If you apply a filter to an event that does not support filtering, the filter is ignored.

"},{"location":"xdump/#msg_filterfilter","title":"msg_filter=<filter>","text":"

You can use the msg_filter suboption to filter on text strings within an exception message, allowing you to reduce the number of dump files produced. This option is supported only for the following events: throw, catch, systhrow, and uncaught.

Use the following syntax to include message filtering in your dump output:

-Xdump:<agent>:events=<event>,msg_filter=<filter>`\n

where <filter> is a text string from the exceptions that you want to include in the dump file. This suboption supports asterisks as wild cards.

The following example filters java/lang/VerifyError exceptions that contain the text string class format:

-Xdump:java:events=throw,filter=java/lang/VerifyError,msg_filter=*class format*\n
"},{"location":"xdump/#optsoptions","title":"opts=<options>","text":"

The full syntax is -Xdump:<agent>:opts=<options>.

The heap dump agent uses this suboption to specify the type of file to produce. On z/OS, the system dump agent uses this suboption to specify the type of dump to produce.

"},{"location":"xdump/#heap-dumps","title":"Heap dumps","text":"

You can specify a PHD heap dump file (PHD), a classic text heap dump file (CLASSIC), or both. The default is a PHD file. For example:

-Xdump:heap:opts=PHD  \n-Xdump:heap:opts=CLASSIC\n-Xdump:heap:opts=PHD+CLASSIC\n
"},{"location":"xdump/#zos-system-dumps","title":"z/OS system dumps","text":"

You can specify a system transaction dump (IEATDUMP), an LE dump (CEEDUMP), or both. The default is an IEADUMP file. For example:

-Xdump:system:opts=IEATDUMP\n-Xdump:system:opts=CEEDUMP\n-Xdump:system:opts=IEATDUMP+CEEDUMP\n

The ceedump agent is the preferred way to specify LE dumps, for example:

-Xdump:ceedump:events=gpf\n
"},{"location":"xdump/#tool-dumps","title":"Tool dumps","text":"

The tool dump agent supports two suboptions that can be specified using the opts subption. You can run the external process asynchronously with opts=ASYNC. You can also specify a delay in milliseconds that produces a pause after starting the command. These two options can be used independently or together. The following examples show different options for starting a new process that runs myProgram:

-Xdump:tool:events=vmstop,exec=myProgram\n

Without the opts suboption, the tool dump agent starts the process, and waits for the process to end before continuing.

-Xdump:tool:events=vmstop,exec=myProgram,opts=ASYNC\n

When opts=ASYNC is specified, the tool dump agent starts the process, and continues without waiting for the new process to end.

-Xdump:tool:events=vmstop,exec=myProgram,opts=WAIT1000\n

This option starts the process, waits for the process to end, and then waits a further 1 second (1000 milliseconds) before continuing.

-Xdump:tool:events=vmstop,exec=myProgram,opts=ASYNC+WAIT10000\n

Finally, the last example starts the process and waits for 10 seconds before continuing, whether the process is still running or not. This last form is useful if you are starting a process that does not end, but requires time to initialize properly.

"},{"location":"xdump/#priority0-999","title":"priority=<0-999>","text":"

One event can generate multiple dump files. The agents that produce each dump file run sequentially and their order is determined by the priority keyword set for each agent. The full syntax for this command is -Xdump:<agent>:priority=<0-999>.

Examination of the output from -Xdump:what shows that a gpf event produces a snap trace, a Java dump file, and a system dump file. In this example, the system dump runs first, with priority 999. The snap dump runs second, with priority 500. The Java dump runs last, with priority 10:

-Xdump:heap:events=vmstop,priority=123\n

The maximum value allowed for priority is 999. Higher priority dump agents are started first.

If you do not specifically set a priority, default values are taken based on the dump type. The default priority and the other default values for a particular type of dump, can be displayed by using -Xdump:<type>:defaults. For example:

java -Xdump:heap:defaults -version\n

Default -Xdump:heap settings:

  events=gpf+user\n  filter=\n  file=/home/user/heapdump.%Y%m%d.%H%M%S.%pid.phd\n  range=1..0\n  priority=500\n  request=exclusive+compact+prepwalk\n  opts=PHD\n
"},{"location":"xdump/#rangeranges","title":"range=<ranges>","text":"

You can start and stop dump agents on a particular occurrence of a VM event by using the range suboption: -Xdump:<agent>:range=<ranges>

For example:

-Xdump:java:events=fullgc,range=100..200\n

Note: range=1..0 against an event means \"on every occurrence\".

The VM default dump agents have the range suboption set to 1..0 for all events except systhrow. Most systhrow events with filter=java/lang/OutOfMemoryError have the range suboption set to 1..4, which limits the number of dump files produced on OutOfMemory conditions to a maximum of 4. For more information, see Default dump agents.

If you add a new dump agent and do not specify the range, a default of 1..0 is used.

"},{"location":"xdump/#requestrequests","title":"request=<requests>","text":"

Use the request suboption to ask the VM to prepare the state before starting the dump agent: -Xdump:<agent>:request=<requests>

The available suboptions are listed in the following table:

suboption value Description exclusive Request exclusive access to the VM. compact Run garbage collection. This option removes all unreachable objects from the heap before the dump file is generated. prepwalk Prepare the heap for walking. You must also specify exclusive when you use this option. serial Suspend other dumps until this dump is finished. preempt Applies to the Java dump agent and controls whether native threads in the process are forcibly pre-empted in order to collect stack traces. If this option is not specified, only Java stack traces are collected in the Java dump.

You can specify more than one request option by using +. For example:

-Xdump:heap:request=exclusive+compact+prepwalk\n

The VM exclusive access mechanism allows a VM thread to halt the activity of other VM threads in a controlled way by using internal VM locks. When the request=exclusive option is specified for a dump agent, the VM thread that is producing the dump waits for threads that are running Java code to halt, and for garbage collection operations to complete, before the dump file is written. This process helps ensure that the dump has consistent data. When the dump is complete, the mechanism allows the other threads to resume.

By default, only system dumps for OutOfMemoryError exceptions request exclusive access. Other system dump events typically result from a crash. In these cases, exclusive access is not requested because acquiring locks during a crash can be problematic.

If system dumps are requested by using the com.ibm.jvm.Dump.SystemDump() API, the default system dump agent settings are used, and exclusive access is not requested. However, if you intend to use the system dump file for Java heap memory analysis, use the following option to request exclusive access when the dump is taken:

-Xdump:system:defaults:request=exclusive+compact+prepwalk\n

These settings avoid capturing a dump file with in-flight data during garbage collection. As an alternative, you can use the com.ibm.jvm.Dump.triggerDump() API and specify request=exclusive+compact+prepwalk on the API call.

For more information about the com.ibm.jvm.Dump API, see the API reference information.

The default setting of the request suboption for Java dump files is request=exclusive+preempt. To change the settings so that Java dump files are produced without pre-empting threads to collect native stack traces, use the following option:

-Xdump:java:request=exclusive\n

The Java dump agent ignores the request=exclusive setting if a user event occurs and another event already has exclusive access. In this scenario, the Java dump agent shares the access instead. This behavior is useful because it allows you to obtain a Java dump file during a deadlock situation, when exclusive access is not released. However, the resulting Java dump file, even in other situations, might omit thread stacks and contain inconsistent thread information, as indicated by the following line in the file:

1TIPREPINFO    Exclusive VM access not taken: data may not be consistent across javacore sections\n

On operating systems other than Windows, you can enforce exclusive access and obtain a complete dump file by specifying that the user2 event triggers the Java dump agent instead of the user event. For example:

-Xdump:java:events=user2,request=exclusive+preempt\n

When a user2 event occurs, for example, when you enter kill -USR2 <pid> on the command line, the Java dump agent accepts the request=exclusive setting and waits for exclusive access before creating the Java dump file.

For more information about events, see Dump events.

In general, the default request options are sufficient.

"},{"location":"xdump/#dump-output","title":"Dump output","text":"

Dump output is written to different files, depending on the type of dump and the platform. File names include a time stamp.

Dump type File name (AIX, Linux, macOS, Windows) File name (z/OS) System dump core.%Y%m%d.%H%M%S.%pid.dmp %uid.JVM.TDUMP.%job.D%Y%m%d.T%H%M%S (31-bit), %uid.JVM.%job.D%y%m%d.T%H%M%S.X&DS (64-bit) See Note Java dump javacore.%Y%m%d.%H%M%S.%pid.%seq.txt javacore.%Y%m%d.%H%M%S.%pid.%seq.txt Heap dump heapdump.%Y%m%d.%H%M%S.%pid.phd heapdump.%Y%m%d.T%H%M%S.phd JIT dump jitdump%Y%m%d.%H%M%S.%pid.%seq.dmp jitdump%Y%m%d.%H%M%S.%pid.%seq.dmp LE CEEDUMP - CEEDUMP.%Y%m%d.%H%M%S.%pid See Note

The tokens used in this table, for example %Y, are described in Dump agent tokens.

Note: On z/OS, the system dump file name can be set with the JAVA_DUMP_TDUMP_PATTERN environment variable. The CEEDUMP, which is not produced by default, is stored in the directory specified by _CEE_DMPTARG or the current directory if _CEE_DMPTARG is not specified.

"},{"location":"xdump/#system-dumps-on-linux","title":"System dumps on Linux","text":"

Linux does not provide an operating system API for generating a system dump from a running process. The VM produces system dumps on Linux by using the fork() API to start an identical process to the parent VM process. The VM then generates a SIGSEGV signal in the child process. The SIGSEGV signal causes Linux to create a system dump for the child process. The parent VM processes and renames the system dump, as required, by the -Xdump options, and might add additional data into the dump file.

The system dump file for the child process contains an exact copy of the memory areas used in the parent. The dump viewer can obtain information about the Java threads, classes, and heap from the system dump. However, the dump viewer, and other system dump debuggers show only the single native thread that was running in the child process.

You can use the Linux kernel.core_pattern setting to specify the name and path for system dumps. The VM dump agents override the Linux system dump name and path by renaming the dump as specified in the -Xdump options. If the kernel.core_pattern setting specifies a different file system to the -Xdump options, the VM dump agents might be unable to change the file path. In this case the VM renames the dump file, but leaves the file path unchanged. You can find the dump file name and location in the JVMDUMP010I message.

Note: If you use the %t specifier in the kernel.core_pattern setting, the VM does not rename the dump. The VM cannot determine the exact time that Linux generated the core file, and therefore cannot be certain which Linux dump file is the correct one to rename.

"},{"location":"xdump/#piped-system-dumps","title":"Piped system dumps","text":"

The Linux option, kernel.core_pattern=|<program>, might be set to pipe system dumps to a system dump processing program (specified by <program>). If such a program is specified and the VM cannot find the system dump, you will see the following messages:

These messages do not necessarily indicate a problem with the system dump. Review the documentation for the program listed in the kernel.core_pattern property to find the location of the system dump and how to configure the program to ensure that the dump file is not truncated.

You can find the current setting of kernel.core_pattern by running one of the following commands. For example,

$ cat /proc/sys/kernel/core_pattern\n|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h\n
$ sysctl kernel.core_pattern\nkernel.core_pattern = |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h\n

The kernel.core_pattern setting is also available in a Java dump. For example:

2CISYSINFO     /proc/sys/kernel/core_pattern = |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h\n

Here are some of the most common system dump processing programs and their default system dump locations:

In container environments, such as OpenShift, piped system dump files are stored in the worker node rather than in the container. Here is one example method for retrieving a dump file that was piped to the systemd-coredump program:

  1. To access the system dump files, you must have access to the cluster as a user that has the cluster-admin role.
  2. Find the worker node of the pod. For example:

    oc get pod --namespace MyNamespace --output \"jsonpath={.spec.nodeName}{'\\n'}\" MyPodname

    Where, MyNamespace and MyPodname are names of your namespace and pod.

  3. Start a debug pod on the worker node. For example:

    oc debug node/MyNode -t

    Where, MyNode is the worker node retrieved in step 2.

  4. List the available system dump files. For example:

#chroot /host coredumpctl\n\nTIME                             PID        UID   GID SIG COREFILE  EXE\n\nWed 2022-08-03 18:52:29 UTC  2923161 1000650000     0  11 present   /opt/java/semeru/jre/bin/java\n
  1. Find the line for the system dump that you want to download, copy the PID number from that row, and then pass it to the info sub-command to search for the dump location. For example:
# chroot /host coredumpctl info 2923161 | grep Storage:\nStorage: /var/lib/systemd/coredump/core.kernel-command-.1000650000.08b9e28f46b348f3aabdffc6896838e0.2923161.1659552745000000.lz4\n
  1. Run a command to print output on a loop so that the debug pod doesn't timeout:

    while true; do echo 'Sleeping'; sleep 8; done

  2. Open a new terminal and then find the debug pod and namespace. For example:

$ oc get pods --field-selector=status.phase==Running --all-namespaces | grep debug\nopenshift-debug-node-pwcn42r47f       worker3-debug       1/1     Running            0                  3m38s\n
  1. Use the namespace (first column) and pod name (second column) that you retrieved in step 7 to download the system dump file from the Storage location that was listed in the output of step 5 on the worker node. Ensure that you prefix the Storage location with /host/. For example:
oc cp --namespace openshift-debug-node-pwcn42r47f worker3-debug:/host/var/lib/systemd/coredump/core.kernel-command-.1000650000.08b9e28f46b348f3aabdffc6896838e0.2923161.1659552745000000.lz4 core.dmp.lz4\n

This example stores the system dump locally in a compressed file, core.dmp.lz4.

  1. After the download completes, in the first terminal window, exit the loop by pressing Ctrl+C and end the debug pod by typing exit.
"},{"location":"xdump/#see-also","title":"See also","text":""},{"location":"xenableexcessivegc/","title":"-Xdisableexcessivegc","text":""},{"location":"xenableexcessivegc/#xenableexcessivegc-xdisableexcessivegc","title":"\u2011Xenableexcessivegc / \u2011Xdisableexcessivegc","text":"

These options enable or disable the throwing of an OutOfMemory exception if excessive time is spent in the GC.

If excessive time is spent in the GC, the option returns null for an allocate request and thus causes an OutOfMemory exception to be thrown.

Note: The OutOfMemory exception is thrown only when the heap has been fully expanded and the percentage of application run time that is spent in garbage collection is at least 95%. This percentage is the default value that triggers an excessive GC event. You can control this value with the -Xgc:excessiveGCratio option.

"},{"location":"xenableexcessivegc/#syntax","title":"Syntax","text":"Setting Effect Default -Xenableexcessivegc Enable exception yes -Xdisableexcessivegc Disable exception

These options can be used with all Eclipse OpenJ9\u2122 GC policies.

"},{"location":"xenableexplicitgc/","title":"-Xdisableexplicitgc","text":""},{"location":"xenableexplicitgc/#xenableexplicitgc-xdisableexplicitgc","title":"\u2011Xenableexplicitgc / \u2011Xdisableexplicitgc","text":"

The options enable or disable garbage collection (GC) when calls are made to System.gc().

"},{"location":"xenableexplicitgc/#syntax","title":"Syntax","text":"Setting Effect Default -Xenableexplicitgc Enable explicit GC calls yes -Xdisableexplicitgc Disable explicit GC calls"},{"location":"xenableexplicitgc/#explanation","title":"Explanation","text":"

Although it is possible to programmatically trigger a global GC by calling System.gc(), performance can be adversely affected by halting the application before it is really necessary. Use this option to prevent the VM responding to application requests for a GC cycle.

The default for all Eclipse OpenJ9\u2122 GC policies is -Xenableexplicitgc except for -Xgcpolicy:nogc, where the default is -Xdisableexplicitgc.

These options can be used with all OpenJ9 GC policies.

"},{"location":"xenablestringconstantgc/","title":"-Xdisablestringconstantgc","text":""},{"location":"xenablestringconstantgc/#xenablestringconstantgc-xdisablestringconstantgc","title":"\u2011Xenablestringconstantgc / \u2011Xdisablestringconstantgc","text":"

These options enable or disable the collection of strings from the string intern table.

"},{"location":"xenablestringconstantgc/#syntax","title":"Syntax","text":"Setting Effect Default -Xenablestringconstantgc Enable collection yes -Xdisablestringconstantgc Disable collection

This option is not supported with the balanced GC policy (-Xgcpolicy:balanced).

"},{"location":"xfastresolve/","title":"-Xfastresolve","text":""},{"location":"xfastresolve/#-xfastresolve","title":"-Xfastresolve","text":"

Tune performance by improving the resolution time for classes when the field count exceeds the specified threshold.

If profiling tools show significant costs in field resolution, change the threshold until the costs are reduced. If you enable this option, additional memory is used when the threshold is exceeded.

Note: The use of this option is deprecated.

"},{"location":"xfastresolve/#syntax","title":"Syntax","text":"
    -Xfastresolve<n>\n
where <n> is the required threshold."},{"location":"xfuture/","title":"-Xfuture","text":""},{"location":"xfuture/#-xfuture","title":"-Xfuture","text":"

As described in the Oracle \"Non-Standard Options\" documentation, this HotSpot option turns on strict class-file format checks. For compatibility, this option is also supported by the Eclipse OpenJ9\u2122 VM.

"},{"location":"xfuture/#syntax","title":"Syntax","text":"
    -Xfuture\n
"},{"location":"xfuture/#explanation","title":"Explanation","text":"

Oracle recommend that you use this flag when you are developing new code because stricter checks will become the default in future releases.

Note: You cannot use this setting in conjunction with -XX:+ClassRelationshipVerifier.

"},{"location":"xfuture/#default-behavior","title":"Default behavior","text":"

By default, strict format checks are disabled.

"},{"location":"xgc/","title":"-Xgc","text":""},{"location":"xgc/#-xgc","title":"-Xgc","text":"

Options that change the behavior of the garbage collector.

"},{"location":"xgc/#syntax","title":"Syntax","text":"
    -Xgc:<parameter>\n
"},{"location":"xgc/#parameters","title":"Parameters","text":"Parameter Effect breadthFirstScanOrdering Sets the scan mode to breadth first. classUnloadingKickoffThreshold Sets a threshold to start an early concurrent global garbage collection (GC) cycle due to recent, heavy class loading activity classUnloadingThreshold Sets a threshold to trigger a class unloading operation in a global GC cycle concurrentScavenge Enables a GC mode with less pause times. dnssExpectedTimeRatioMaximum Sets the maximum percentage of time to spend on local GC pauses dnssExpectedTimeRatioMinimum Sets the minimum percentage of time to spend on local GC pauses dynamicBreadthFirstScanOrdering Sets scan mode to dynamic breadth first. excessiveGCratio Sets a boundary value beyond which GC is deemed to be excessive. hierarchicalScanOrdering Sets scan mode to hierarchical. minContractPercent Sets the minimum percentage of the heap that can be contracted at any given time. maxContractPercent Sets the maximum percentage of the heap that can be contracted at any given time. noConcurrentScavenge Disables concurrent scavenge. noSynchronousGCOnOOM Prevents an application stopping to allow GC activity. overrideHiresTimerCheck Overrides GC operating system checks for timer resolution. preferredHeapBase Sets a memory range for the Java\u2122 heap. (AIX\u00ae, Linux\u00ae, macOS\u00ae, and Windows\u2122 only) scvNoAdaptiveTenure Turns off the adaptive tenure age in the generational concurrent GC policy. scvTenureAge Sets the initial scavenger tenure age in the generational concurrent GC policy. stdGlobalCompactToSatisfyAllocate Prevents the GC from performing a compaction unless absolutely required. synchronousGCOnOOM Stops an application to allow GC activity. targetPausetime Sets the target GC pause time for the metronome and balanced GC policies. targetUtilization Sets application utilization for the metronome GC policy. tlhIncrementSize Sets the size of the thread local heap (TLH) increment. tlhInitialSize Sets the initial size of the thread local heap. tlhMaximumSize Sets the maximum size of the thread local heap. verboseFormat Sets the verbose GC format. verbosegcCycleTime Sets the criteria for verbose GC logging."},{"location":"xgc/#breadthfirstscanordering","title":"breadthFirstScanOrdering","text":"
     -Xgc:breadthFirstScanOrdering\n
This option sets the scan mode for GC operations that evacuate objects in the heap (scavenge operations (gencon) and copy forward operations (balanced)) to breadth first mode. The scan mode reflects the method for traversing the object graph and is also known as Cheney's algorithm."},{"location":"xgc/#classunloadingkickoffthreshold","title":"classUnloadingKickoffThreshold","text":"
     -Xgc:classUnloadingKickoffThreshold=<value>\n
Where <value> is equal to the number of class loaders plus the number of anonymous classes that are loaded since the previous class unloading operation. This option sets a threshold that is used to start an early concurrent global GC cycle due to recent class loading activity. The default value is 80000. This option is applicable to the following GC policies: gencon and optavgpause."},{"location":"xgc/#classunloadingthreshold","title":"classUnloadingThreshold","text":"
     -Xgc:classUnloadingThreshold=<value>\n
Where <value> is equal to the number of class loaders plus the number of anonymous classes that are loaded since the previous class unloading operation. This option sets a threshold that is used to trigger an optional GC class unloading operation in a global GC cycle, irrespective of how the global GC cycle is triggered. The default value is 6. This option is applicable to the following GC policies: gencon, optavgpause, and optthruput."},{"location":"xgc/#concurrentscavenge","title":"concurrentScavenge","text":"

(64-bit only)

    -Xgc:concurrentScavenge\n

This option supports pause-less garbage collection mode when you use the Generational Concurrent (gencon) garbage collection policy (the default policy). This option cannot be used with any other GC policies.

If you set this option, the VM attempts to reduce GC pause times for response-time sensitive, large-heap applications. This mode can be enabled with hardware-based support (Linux on IBM Z\u00ae and z/OS\u00ae) and software-based support (64-bit: Linux on (x86-64, POWER\u00ae, IBM Z\u00ae) AIX\u00ae, macOS\u00ae, and z/OS).

Note: Linux on IBM Z and z/OS

This option is supported by all generations of IBM Z hardware to enable pause-less GC with two modes of operation: hardware-based and software-based operations. IBM z13\u2122 and earlier hardware operates in software-based pause-less GC mode; IBM z14\u2122 and later hardware (with supported software) operates in hardware-based mode.

Hardware-based pause-less GC is supported on IBM z14 and later hardware running the following software:

Operating systems:

Hypervisors:

If these requirements are not met, the option is ignored.

Note: On z/OS, the virtual storage used might exceed the Java maximum heap size. Set the z/OS memory limit, specified by ulimit -M, to a larger value than the maximum heap size.

"},{"location":"xgc/#dnssexpectedtimeratiomaximum","title":"dnssExpectedTimeRatioMaximum","text":"
    -Xgc:dnssExpectedTimeRatioMaximum=<value>\n
Setting Value Default <value> [percentage] 5 for gencon, 5 for balanced

The maximum percentage of time spent in local garbage collection pauses. For the gencon policy, this refers to the amount of time spent on the nursery area of the heap (scavenge operation). For the balanced policy, this refers to the amount of time spent on the eden regions of the heap (PGC operation).

This option applies only to the gencon and balanced GC policies.

"},{"location":"xgc/#dnssexpectedtimeratiominimum","title":"dnssExpectedTimeRatioMinimum","text":"
    -Xgc:dnssExpectedTimeRatioMinimum=<value>\n
Setting Value Default <value> [percentage] 1 for gencon, 2 for balanced

The minimum percentage of time spent in local garbage collection pauses. For the gencon policy, this refers to the amount of time spent in Scavenge operation (on the nursery area of the heap). For the balanced policy, this refers to the amount of time spent in PGC operations (mostly on the eden and young regions, but also some other regions for de-fragmentation purposes).

This option applies only to the gencon and balanced GC policies.

"},{"location":"xgc/#dynamicbreadthfirstscanordering","title":"dynamicBreadthFirstScanOrdering","text":"
     -Xgc:dynamicBreadthFirstScanOrdering\n
This option sets the scan mode for GC operations that evacuate objects in the heap (scavenge operations (gencon) and copy forward operations (balanced)) to dynamic breadth first mode. This scan mode reflects the method for traversing the object graph and is a variant that adds partial depth first traversal on top of the breadth first scan mode. The aim of dynamic breadth first mode is driven by object field hotness. This mode is the default for the balanced GC policy."},{"location":"xgc/#excessivegcratio","title":"excessiveGCratio","text":"
    -Xgc:excessiveGCratio=<value>\n
Setting Value Default <value> [percentage] 95

where <value> is a percentage of total application run time that is spent in GC.

The default value is 95, which means that anything over 95% of total application run time spent on GC is deemed excessive. This option can be used only when -Xenableexcessivegc is set (enabled by default).

This option can be used with all Eclipse OpenJ9\u2122 GC policies.

"},{"location":"xgc/#hierarchicalscanordering","title":"hierarchicalScanOrdering","text":"
    -Xgc:hierarchicalScanOrdering\n
This option sets the scan mode for the scavenge operation (gencon GC policy) to hierarchical mode. This mode reflects the method for traversing the object graph and adds partial depth first traversal on top of breadth first scan mode. The aim of hierarchical mode is to minimize object distances. This option is the default for the gencon GC policy."},{"location":"xgc/#mincontractpercent","title":"minContractPercent","text":"
    -Xgc:minContractPercent=<n>\n
Setting Value Default <n> [percentage] -

The minimum percentage of the heap that can be contracted at any given time.

This option can be used with all OpenJ9 GC policies.

"},{"location":"xgc/#maxcontractpercent","title":"maxContractPercent","text":"
    -Xgc:maxContractPercent=<n>\n
Setting Value Default <n> [percentage] -

The maximum percentage of the heap that can be contracted at any given time. For example, -Xgc:maxContractPercent=20 causes the heap to contract by as much as 20%.

This option can be used with all OpenJ9 GC policies.

"},{"location":"xgc/#noconcurrentscavenge","title":"noConcurrentScavenge","text":"

(64-bit only)

    -Xgc:noConcurrentScavenge\n

This option disables pause-less garbage collection that you might have enabled with the -Xgc:concurrentScavenge option when using the default gencon GC policy. This option applies only to the gencon GC policy.

Note: No concurrent scavenge is the default state, but the noConcurrentScavenge option is useful as it will disable concurrent scavenge even if it has been enabled by a previous option; the right-most option always takes precedence.

"},{"location":"xgc/#nosynchronousgconoom","title":"nosynchronousGCOnOOM","text":"
    -Xgc:nosynchronousGCOnOOM\n
Setting -Xgc:nosynchronousGCOnOOM implies that when heap memory is full your application stops and issues an out-of-memory message. The default is -Xgc:synchronousGCOnOOM. This option applies only to the metronome GC policy."},{"location":"xgc/#overridehirestimercheck","title":"overrideHiresTimerCheck","text":"
    -Xgc:overrideHiresTimerCheck\n

When the VM starts, the GC checks that the operating system can meet the timer resolution requirements for the requested target pause time. Typically, this check correctly identifies operating systems that can deliver adequate time resolution. However, in some cases the operating system provides a more conservative answer than strictly necessary for GC pause time management, which prevents startup. Specifying this parameter causes the GC to ignore the answer returned by the operating system. The VM starts, but GC pause time management remains subject to operating system performance, which might not provide adequate timer resolution.

Note: Use this option with caution, and only when you are unable to use a supported operating system.

This option applies only to the metronome GC policy.

"},{"location":"xgc/#preferredheapbase","title":"preferredHeapBase","text":"

(AIX, Linux, macOS, and Windows only)

    -Xgc:preferredHeapBase=<address>\n
Setting Value Default <value> [hexadecimal] -

where, <address> is the base memory address for the heap. Use this option with the -Xcompressedrefs option to allocate the heap you specify with the -Xmx option, in a memory range of your choice. If -Xcompressedrefs is not specified, this option has no effect. In the following example, the heap is located at the 4 GB mark, leaving the lowest 4 GB of address space for use by other processes.

-Xgc:preferredHeapBase=0x100000000\n

If the heap cannot be allocated in a contiguous block at the preferredHeapBase address you specified, an error occurs detailing a Garbage Collection (GC) allocation failure startup. When the preferredHeapBase option is used with the -Xlp option, the preferredHeapBase address must be a multiple of the large page size. If you specify an inaccurate heap base address, the heap is allocated with the default page size.

This option can be used with all OpenJ9 GC policies.

"},{"location":"xgc/#scvnoadaptivetenure","title":"scvNoAdaptiveTenure","text":"
    -Xgc:scvNoAdaptiveTenure\n
Turns off the adaptive tenure age in the gencon GC policy. The initial age that is set is maintained throughout the run time of the VM. See scvTenureAge. This option applies only to the gencon GC policy."},{"location":"xgc/#scvtenureage","title":"scvTenureAge","text":"
    -Xgc:scvTenureAge=<n>\n
Setting Value Default <n> [1 - 14] 10

Sets the initial scavenger tenure age in the gencon GC policy. For more information, see gencon policy (default).

This option applies only to the gencon GC policy.

"},{"location":"xgc/#stdglobalcompacttosatisfyallocate","title":"stdGlobalCompactToSatisfyAllocate","text":"
    -Xgc:stdGlobalCompactToSatisfyAllocate\n
Prevents the GC from performing a compaction unless absolutely required to satisfy the current allocation failure by removing the dynamic compaction triggers that look at heap occupancy. This option works only with the following GC policies: This option is not supported with the balanced GC policy (-Xgcpolicy:balanced) or metronome GC policy (-Xgcpolicy:metronome)."},{"location":"xgc/#synchronousgconoom","title":"synchronousGCOnOOM","text":"
    -Xgc:synchronousGCOnOOM\n
GC cycles can occur when the Java heap runs out of memory. If there is no more free space in the heap, using -Xgc:synchronousGCOnOOM stops your application while GC operations remove unused objects. If free space runs out again, consider decreasing the target utilization to allow GC operations more time to complete. Setting -Xgc:nosynchronousGCOnOOM implies that when heap memory is full your application stops and issues an out-of-memory message. The default is -Xgc:synchronousGCOnOOM. This option applies only to the metronome GC policy."},{"location":"xgc/#targetpausetime","title":"targetPausetime","text":"
    -Xgc:targetPausetime=N\n
Sets the target GC pause time, where N is the time in milliseconds. When this option is specified with the metronome policy, the garbage collector operates with pauses that do not exceed the value specified. If this option is not specified when using the metronome policy, the default pause time target is set to 3 milliseconds. For example, running with -Xgc:targetPausetime=20 causes the garbage collector to pause for no longer than 20 milliseconds during GC operations.

When this option is specified with the balanced policy, the GC will use the specified pause time as a soft pause time target. If this option is not specified when using the balanced policy, the default pause time target is set to 200 milliseconds. If the GC pauses are longer than the specified target, then the GC may shrink the amount of eden regions in order to satisfy the target pause time. If the percentage of time spent in PGC pauses is higher than dnssExpectedTimeRatioMaximum and the GC pauses are longer than the specified pause time target, then the target pause time may not be satisfied, in order to balance reaching the target pause time goal and percentage of time in GC pause goal.

Note: Specifying an ultra low targetPausetime with the Balanced GC policy may cause the percentage of time spent in GC pauses to noticeably increase.

This option applies only to the metronome and balanced GC policies.

"},{"location":"xgc/#targetutilization","title":"targetUtilization","text":"
    -Xgc:targetUtilization=N\n

Sets the application utilization to N%; the garbage collector attempts to use at most (100-N)% of each time interval. Reasonable values are in the range of 50-80%. Applications with low allocation rates might be able to run at 90%. The default is 70%.

In the following example, the maximum size of the heap is set to 30 MB. The garbage collector attempts to use 25% of each time interval because the target utilization for the application is set to 75%.

java -Xgcpolicy:metronome -Xmx30m -Xgc:targetUtilization=75 Test\n

This option applies only to the metronome GC policy.

"},{"location":"xgc/#tlhincrementsize","title":"tlhIncrementSize","text":"
    -Xgc:tlhIncrementSize=<bytes>\n
Sets the increment size of the thread local heap (TLH), which plays a key role in cache allocation. Threads start creating TLHs with a predefined initial size (default 2 KB). On every TLH refresh, the requested size for that thread is increased by an increment (default 4 KB). Use this option to control the increment size. This option can be used with all OpenJ9 GC policies."},{"location":"xgc/#tlhinitialsize","title":"tlhInitialSize","text":"
    -Xgc:tlhInitialSize=<bytes>\n
Sets the initial size of the TLH. The default size is 2 KB. This option can be used with all OpenJ9 GC policies."},{"location":"xgc/#tlhmaximumsize","title":"tlhMaximumSize","text":"
    -Xgc:tlhMaximumSize=<bytes>\n
Sets the maximum size of the TLH. The size of the TLH varies from 512 bytes (768 on 64-bit JVMs) to 128 KB, depending on the allocation rate of the thread. Larger TLHs can help reduce heap lock contention, but might also reduce heap utilisation and increase heap fragmentation. Typically, when the maximum TLH size is increased, you should also increase the increment size (-XtlhIncrementSize) proportionally, so that active threads can reach the maximum requested TLH size more quickly. This option can be used with all OpenJ9 GC policies."},{"location":"xgc/#verboseformat","title":"verboseFormat","text":"
    -Xgc:verboseFormat=<format>\n
Setting Value Default <format> default yes deprecated

This option does not apply to the metronome GC policy. The verbose log format for the metronome GC policy is equivalent to -Xgc:verboseFormat=deprecated.

"},{"location":"xgc/#verbosegccycletime","title":"verbosegcCycleTime","text":"
    -Xgc:verbosegcCycleTime=N\n

N is the time in milliseconds that the summary information should be logged.

Note: The cycle time does not mean that the summary information is logged precisely at that time, but when the last GC event that meets this time criterion passes.

This option applies only to the metronome GC policy.

"},{"location":"xgcmaxthreads/","title":"-Xgcmaxthreads","text":""},{"location":"xgcmaxthreads/#-xgcmaxthreads","title":"-Xgcmaxthreads","text":"

Specifies the maximum number of threads that the garbage collector can use for parallel operations. This option behaves in the same way as -Xgcthreads but does not enforce a fixed thread count, which allows the garbage collector to adjust the thread count when used with the -XX:+AdaptiveGCThreading option.

"},{"location":"xgcmaxthreads/#syntax","title":"Syntax","text":"
    -Xgcmaxthreads<number>\n

Where <number> is the maximum number of threads that can be used for parallel operations.

"},{"location":"xgcpolicy/","title":"-Xgcpolicy","text":""},{"location":"xgcpolicy/#-xgcpolicy","title":"-Xgcpolicy","text":"

Controls which garbage collection (GC) policy is used for your Java\u2122 application.

"},{"location":"xgcpolicy/#syntax","title":"Syntax","text":"
    -Xgcpolicy:<parameter>\n
"},{"location":"xgcpolicy/#parameters","title":"Parameters","text":"Parameter Default gencon yes balanced (64-bit only) metronome (AIX\u00ae, Linux\u00ae x86 only) optavgpause optthruput nogc

For a detailed description of the policies, when to use them, and how they work, see Garbage Collection policies. The following GC policies are available:

"},{"location":"xgcpolicy/#gencon","title":"gencon","text":"
    -Xgcpolicy:gencon\n
The generational concurrent policy (default) requires a heap that is divided into two main areas (nursery and tenure) to manage two generation groups (new and older). The policy uses a global GC cycle of concurrent mark-sweep operations, optionally followed by compact operations. The policy also uses a partial GC cycle to run scavenge operations on the nursery area. The partial cycle helps reduce the frequency and duration of the global GC cycle. Note that scavenge is a stop-the-world operation, unless -Xgcpolicy:gencon is specified with the -Xgc:concurrentScavenge option. To learn more about this policy, when to use it, and how it works, see Garbage collection: gencon policy."},{"location":"xgcpolicy/#balanced-64-bit-only","title":"balanced (64-bit only)","text":"
    -Xgcpolicy:balanced\n
The Balanced policy requires a multi-region heap to manage multiple generations of objects. The policy uses a global GC cycle that involves an incremental concurrent mark operation (global mark phase), followed by stop-the-world (STW) sweep operation. The policy also uses a partial GC cycle to run copy forward or mark-compact operations. Regions are individually managed to reduce the maximum pause time on large heaps and increase the efficiency of garbage collection. The policy tries to avoid global collections by matching object allocation and survival rates. With the balanced policy, the global mark and partial GC cycles interleave. The global STW sweep operation runs within the same GC increment as the first partial GC cycle that follows the global mark phase. The balanced policy also exploits large systems that have Non-Uniform Memory Architecture (NUMA) characteristics (x86 and POWER\u2122 platforms only), which might further improve application throughput. Note: If you are using this GC policy in a Docker container that uses the default seccomp Docker profile, you must start the container with --security-opt seccomp=unconfined to exploit NUMA characteristics. These options are not required if you are running in Kubernetes because unconfined is set by default (see Seccomp). To learn more about this policy, how it works, and when to use it, see Garbage collection: balanced policy."},{"location":"xgcpolicy/#balanced-defaults-and-options","title":"balanced defaults and options","text":"

The initial heap size is Xmx/1024, rounded down to the nearest power of 2, where Xmx is the maximum heap size available. You can override this value by specifying the -Xms option on the command line.

The following options can also be specified on the command line with -Xgcpolicy:balanced:

The behavior of the following options is different when specified with -Xgcpolicy:balanced:

-Xcompactgc (default) Forces compaction in each Global GC cycle. -Xnocompactgc Disables internal compaction heuristics in Global GC cycles. -Xcompactexplicitgc (default) Forces compaction in explicit Global GC cycles, such as those invoked by System.gc(). Compaction in implicit Global GC remains optional, triggered by internal heuristics. -Xnocompactexplicitgc Disables compaction in explicit Global GC cycles. Compaction in implicit Global GC remains optional, triggered by internal heuristics. -Xgc:targetPausetime Uses the specified GC pause time as a soft GC pause time target.

The following options are ignored when specified with -Xgcpolicy:balanced:

"},{"location":"xgcpolicy/#optavgpause","title":"optavgpause","text":"
    -Xgcpolicy:optavgpause\n

The optimize for pause time policy requires a flat heap and uses a global GC cycle to run concurrent mark-sweep operations, optionally followed by compact operations. Pause times are shorter than with optthruput, but application throughput is reduced. The impact on throughput occurs because some garbage collection work is taking place in the context of mutator (application) threads, and because GC frequency is increased.

To learn more about this policy and when to use it, see Garbage collection: optavgpause policy.

"},{"location":"xgcpolicy/#optthruput","title":"optthruput","text":"
    -Xgcpolicy:optthruput\n

The optimize for throughput policy requires a flat heap and uses a global GC cycle to run mark-sweep operations, optionally followed by compact operations. Because the application stops during a global GC cycle, long pauses can occur.

To learn more about this policy, how it works, and when to use it, see Garbage collection: optthruput policy.

"},{"location":"xgcpolicy/#metronome-aix-linux-x86-only","title":"metronome (AIX, Linux x86 only)","text":"
    -Xgcpolicy:metronome\n

The metronome policy is an incremental, deterministic garbage collector with short pause times. Applications that are dependent on precise response times can take advantage of this technology by avoiding potentially long delays from GC activity. The metronome policy is supported on specific hardware and operating system configurations.

To learn more about this policy, how it works, and when to use it, see Garbage collection: metronome policy.

"},{"location":"xgcpolicy/#metronome-options","title":"metronome options","text":"

The following options are specific to the metronome GC policy:

-Xgc:targetPausetime option also applies to the metronome GC policy. This option applies only to the metronome and balanced GC policies.

"},{"location":"xgcpolicy/#nogc","title":"nogc","text":"
    -Xgcpolicy:nogc\n

This policy handles only memory allocation and heap expansion, but doesn't reclaim any memory. If the available Java heap becomes exhausted, an OutOfMemoryError exception is triggered and the VM stops.

You should be especially careful when using any of the following techniques with nogc because memory is never released under this policy: - Finalization - Direct memory access - Weak, soft, and phantom references

To learn when to use this policy, see Garbage collection: nogc policy.

This policy can also be enabled with the -XX:+UseNoGC option.

Further details are available at JEP 318: Epsilon: A No-Op Garbage Collector.

"},{"location":"xgcsplitheap/","title":"-Xgc:splitheap","text":""},{"location":"xgcsplitheap/#-xgcsplitheap","title":"-Xgc:splitheap","text":"

(Windows\u2122 32-bit only)

By default, the VM uses a contiguous Java\u2122 heap to store Java objects. However, on Windows 32-bit systems, there are restrictions in the 32-bit memory space that prevents a process accessing more than 2GB of memory, even if there is more memory available. To increase the maximum allocatable heap size, Eclipse OpenJ9\u2122 can split the heap, allowing memory use up to the 4GB limit.

Restrictions:

"},{"location":"xgcsplitheap/#syntax","title":"Syntax","text":"
    -Xgc:splitheap\n
"},{"location":"xgcsplitheap/#explanation","title":"Explanation","text":"

Use -Xgc:splitheap for applications that must run on the 32-bit VM because of 32-bit JNI libraries, a 32-bit operating system, or 32-bit hardware, but need large Java heaps. By using a larger heap, you can allocate more objects before incurring a garbage collection (GC) and you can increase the number of live objects that you can use before an OutOfMemoryError exception occurs.

With a split heap, the old area is committed to its maximum size (set with -Xmox) in a lower region of memory and the new area is committed to its maximum size (set with -Xmnx) in a higher region of memory.

This option is not recommended if your application works in the any of the following ways:

"},{"location":"xgcthreads/","title":"-Xgcthreads","text":""},{"location":"xgcthreads/#-xgcthreads","title":"-Xgcthreads","text":"

Sets the number of threads that the garbage collector uses for parallel operations.

Notes:

This option enforces a fixed thread count and cannot be used with the -XX:+AdaptiveGCThreading option, which enables the garbage collector to adjust the number of parallel threads based on heuristics. If you want to use -XX:+AdaptiveGCThreading, use -Xgcmaxthreads instead of -Xgcthreads.

"},{"location":"xgcthreads/#syntax","title":"Syntax","text":"
    -Xgcthreads<number>\n
"},{"location":"xgcthreads/#explanation","title":"Explanation","text":"

The total number of GC threads is composed of one application thread with the remainder being dedicated GC threads. By default, the number is set to n-1, where n is the number of reported CPUs, up to a maximum of 64. Where SMT or hyperthreading is in place, the number of reported CPUs is larger than the number of physical CPUs. Likewise, where virtualization is in place, the number of reported CPUs is the number of virtual CPUs assigned to the operating system. To set it to a different number, for example 4, use -Xgcthreads4. The minimum valid value is 1, which disables parallel operations, at the cost of performance. No advantage is gained if you increase the number of threads to more than the default setting.

On systems running multiple VMs or in LPAR environments where multiple VMs can share the same physical CPUs, you might want to restrict the number of GC threads used by each VM. The restriction helps prevent the total number of parallel operation GC threads for all VMs exceeding the number of physical CPUs present, when multiple VMs perform garbage collection at the same time.

This option is directly mapped to the HotSpot option -XX:ParallelGCThreads and can be used with all Eclipse OpenJ9\u2122 GC policies.

"},{"location":"xgcworkpackets/","title":"-Xgcworkpackets","text":""},{"location":"xgcworkpackets/#-xgcworkpackets","title":"-Xgcworkpackets","text":"

Specifies the total number of work packets available in the global collector.

"},{"location":"xgcworkpackets/#syntax","title":"Syntax","text":"
    -Xgcworkpackets<number>\n
"},{"location":"xgcworkpackets/#explanation","title":"Explanation","text":"

If you do not specify a value, the collector allocates a number of packets based on the maximum heap size.

This option can be used with all Eclipse OpenJ9\u2122 GC policies.

"},{"location":"xint/","title":"-Xint","text":""},{"location":"xint/#-xint","title":"-Xint","text":"

As described in the Oracle \"Non-Standard Options\" documentation, this VM option runs an application in interpreted-only mode. For compatibility, this option is also supported by the Eclipse OpenJ9\u2122 VM.

"},{"location":"xint/#syntax","title":"Syntax","text":"
    -Xint\n
"},{"location":"xint/#explanation","title":"Explanation","text":"

If you use this option, the OpenJ9 VM uses only the interpreter, disabling the OpenJ9 just-in-time (JIT) and ahead-of-time (AOT) compilers. By default, both these compilers are enabled, although the AOT compiler is not used by the VM unless shared classes are also enabled.

"},{"location":"xjit/","title":"-Xjit","text":""},{"location":"xjit/#-xjit-xnojit","title":"-Xjit / -Xnojit","text":"

Use this option to control the behavior of the JIT compiler.

Specifying -Xjit with no parameters has no effect because the JIT compiler is enabled by default.

Specifying -Xnojit turns off the JIT compiler but does not affect the AOT compiler.

Specify the -Xjit option only once. By default, if you specify this option multiple times, only the last option takes effect. You can use the -XX:+MergeCompilerOptions option to merge all the existing instances of the -Xjit options logically.

You can specify multiple parameters for the -Xjit option by using commas to separate the parameters. For example:

-Xjit:enableGPU,exclude={ilog/rules/engine/sequential/generated/*}

Parameters such as exclude are additive so you can specify them multiple times within the same -Xjit option.

"},{"location":"xjit/#syntax","title":"Syntax","text":"Setting Action Default -Xjit Enable JIT yes -Xjit[:<parameter>=<value>{,<parameter>=<value>}] Enable JIT with options -Xnojit Disable JIT"},{"location":"xjit/#parameters","title":"Parameters","text":"

These parameters can be used to modify the behavior of -Xjit:

Parameter Effect count Specifies the number of times a method is called before it is compiled. disableRMODE64 Allows the JIT to allocate executable code caches above the 2 GB memory bar. enableGPU Allows the JIT to offload certain processing tasks to a graphics processing unit (GPU) exclude Excludes the specified method from compilation. limit Includes the specified method in compilation. limitFile Compile methods that are listed in the limit file. optlevel Forces the JIT compiler to compile all methods at a specific optimization level. verbose Reports information about the JIT and AOT compiler configuration and method compilation. vlog Sends verbose output to a file. perfTool Facilitates JIT-compiled code symbol resolution when profiling the VM on Linux."},{"location":"xjit/#count","title":"count","text":"
    -Xjit:count=<n>\n
Specifies the number of times, <n>, a method is called before it is compiled. For example, setting count=0 forces the JIT compiler to compile everything on first execution, which is useful for problem determination."},{"location":"xjit/#disablermode64","title":"disableRMODE64","text":"

(z/OS\u00ae only)

    -Xjit:disableRMODE64\n
From z/OS V2R3, residency mode for 64-bit applications (RMODE64) is enabled by default. This feature allows the JIT to allocate executable code caches above the 2 GB memory bar, which is the default behavior. Use this option to turn off this JIT behavior."},{"location":"xjit/#enablegpu","title":"enableGPU","text":"

(Windows (x86-64) or Linux (x86-64 and IBM POWER LE))

    -Xjit:enableGPU\n
Enables the JIT compiler to offload certain processing tasks to a graphics processing unit (GPU). The JIT determines which functions to offload based on performance heuristics. Systems must support NVIDIA Compute Unified Device Architecture (CUDA). The JIT requires the CUDA Toolkit 7.5 and your GPU device must have a minimum compute capability of 3.0. To troubleshoot operations between the JIT compiler and the GPU, use -Xjit:enableGPU={verbose}, which provides output showing the processing tasks that are offloaded and their status. To send this output to a file (output.txt), run -Xjit:enableGPU={verbose},vlog=output.txt when you start your application."},{"location":"xjit/#exclude","title":"exclude","text":"
    -Xjit:exclude={<method>}\n

Excludes the specified method from compilation.

<method_name> is the method or methods that are to be excluded; the wildcard * may be used. Specify as much of the full package, class and method as necessary.

For example, -Xjit:exclude={test/sample/MyClass.testMethod()V} excludes the single method specified. However, -Xjit:exclude={test/sample/MyClass.testMethod()*} excludes the method regardless of return type. Similarly, -Xjit:exclude={*} excludes all methods.

Note: exclude has the same effect regardless of whether it is specified on -Xaot or -Xjit. In consequence, if you specify -Xjit:exclude, AOT compilation is also prevented and the methods specified are always interpreted.

"},{"location":"xjit/#limit","title":"limit","text":"
    -Xjit:limit={<method_name>}\n
Only the Java\u2122 methods specified are included when code is compiled or loaded from the shared classes cache. <method_name> is the method or methods that are to be included (the wildcard * can be used, see -Xjit:exclude for details). Note: limit has the same effect regardless of whether it is specified on -Xaot or -Xjit. In consequence, if you specify -Xjit:limit, AOT compilation is also restricted to those methods specified; other methods are always interpreted."},{"location":"xjit/#limitfile","title":"limitFile","text":"
    -Xjit:limitFile=(<vlog_filename>, <m>, <n>)\n
Compile only the methods that are listed on lines <m> to <n> in the specified limit file, where the limit file is a verbose log that you generated with the -Xjit:verbose,vlog=<vlog_filename> option. Methods that are not listed in the limit file and methods that are listed on lines outside the range are not compiled. Note: limitFile has the same effect regardless of whether it is specified on -Xaot or -Xjit. In consequence, if you specify -Xjit:limitFile, AOT compilation is also restricted to those methods specified; other methods are always interpreted."},{"location":"xjit/#optlevel","title":"optlevel","text":"
    -Xjit:optlevel=[noOpt|cold|warm|hot|veryHot|scorching]\n
Forces the JIT compiler to compile all methods at a specific optimization level. Specifying optlevel might have an unexpected effect on performance, including reduced overall performance."},{"location":"xjit/#verbose","title":"verbose","text":"
    -Xjit:verbose\n
Generates a JIT verbose log. The log provides a summary of which methods were compiled by the JIT and some of the compilation heuristic decisions that were taken while the JIT operates inside the Eclipse OpenJ9\u2122 VM.
-Xjit:verbose={compileStart}\n

Prints a line when the JIT is about to start compiling a method.

-Xjit:verbose={compileEnd}\n

Prints a line when the JIT stops compiling a method.

-Xjit:verbose={compilePerformance}\n

Adds the values time (time taken to do the compilation) and mem (the amount of memory that was allocated during the compilation) into each line. This option includes the compileStart and compileEnd suboptions by default.

-Xjit:verbose={disableInlining}\n

Turns off inlining operations.

-Xjit:verbose={inlining}\n

Shows the methods that are inlined.

Note: Suboptions can be chained together by using a pipe (|) symbol. When used, you must enclose the full option name in single quotation marks (') to avoid the shell misinterpreting these characters as pipe commands. For example:

java '-Xjit:verbose={compileStart|compileEnd|inlining}' -version\n
"},{"location":"xjit/#vlog","title":"vlog","text":"
    -Xjit:vlog=<vlog_filename>\n
Sends verbose output to a file, of the format <vlog_filename>.<date>.<time>.<JVM_process_ID>, which is created in your current directory. Running the command multiple times produces multiple distinct versions of this file. If you do not specify this parameter, the output is sent to the standard error output stream (STDERR). This type of log file can be used with the limitFile suboption to target the compilation of specific methods."},{"location":"xjit/#perftool","title":"perfTool","text":"
    -Xjit:perfTool\n
generates a /tmp/perf-<pid>.map file for the JIT-compiled code. This file is used by the Linux\u00ae system profiler, perf, to map the samples in the JIT-compiled code to the corresponding Java method names for profiling the VM.

For more information, see -XX:[+|-]PerfTool.

"},{"location":"xjit/#examples","title":"Examples","text":""},{"location":"xjit/#generating-a-jit-verbose-log","title":"Generating a JIT verbose log","text":"

The following example requests a JIT verbose log of the java -version command:

java -Xjit:verbose,vlog=vlogfile -version\n
"},{"location":"xjit/#analyzing-jit-performance","title":"Analyzing JIT performance","text":"

The following example requests information about the performance of JIT compiler threads, with output written to vlogfile.

java -Xjit:verbose={compilePerformance},vlog=vlogfile -version\n

The output generated by using this command adds the following information to compilation entry:

"},{"location":"xjit/#analyzing-inlining-operations","title":"Analyzing inlining operations","text":"

The following example generates output that contains performance data and inlining operations. The suboptions count and -XcompilationThreads1 are used only to simplify the output. These options are not recommended for production because performance will be affected.

java '-Xjit:verbose={compileStart|compileEnd|inlining},count=5,vlog=vlogfile' -XcompilationThreads1 -version\n
"},{"location":"xjit/#see-also","title":"See also","text":""},{"location":"xjni/","title":"-Xjni","text":""},{"location":"xjni/#-xjni","title":"-Xjni","text":"

Sets JNI options.

"},{"location":"xjni/#syntax","title":"Syntax","text":"
    -Xjni:<parameter>\n
"},{"location":"xjni/#parameters","title":"Parameters","text":""},{"location":"xjni/#arraycachemax","title":"arrayCacheMax","text":"
    -Xjni:arrayCacheMax=<size in bytes>\n    -Xjni:arrayCacheMax=unlimited\n
Sets the maximum size of the array cache. The default size is 128 KB (-Xjni:arrayCacheMax=131072)."},{"location":"xlinenumbers/","title":"-Xlinenumbers","text":""},{"location":"xlinenumbers/#-xlinenumbers-xnolinenumbers","title":"-Xlinenumbers / -Xnolinenumbers","text":"

These options enable or disable line numbers in stack traces for debugging.

"},{"location":"xlinenumbers/#syntax","title":"Syntax","text":"Setting Effect Default -Xlinenumbers Enable yes -Xnolinenumbers Disable"},{"location":"xlinenumbers/#explanation","title":"Explanation","text":"

If you start the Eclipse OpenJ9\u2122 VM with -Xnolinenumbers when creating a new shared classes cache, the Class Debug Area is not created. The option -Xnolinenumbers advises the VM not to load any class debug information, so there is no need for this region. If -Xscdmx is also used on the command line to specify a non zero debug area size, then a debug area is created despite the use of -Xnolinenumbers.

"},{"location":"xloa/","title":"-Xloa","text":""},{"location":"xloa/#-xloa-xnoloa","title":"-Xloa / -Xnoloa","text":"

This option enables or prevents the allocation of a large object area (LOA) during garbage collection (GC).

"},{"location":"xloa/#syntax","title":"Syntax","text":"Setting Effect Default -Xloa Enable LOA yes (see Default behavior) -Xnoloa Disable LOA"},{"location":"xloa/#default-behavior","title":"Default behavior","text":"

By default, allocations are made in the small object area (SOA). If there is no room in the SOA, and an object is larger than 64KB, the object is allocated in the LOA.

If the LOA is not used, it is shrunk to zero after a few collections. You can disable it explicitly by specifying the -Xnoloa option.

"},{"location":"xloa/#explanation","title":"Explanation","text":"

The LOA is an area of the tenure area of the heap set used solely to satisfy allocations for large objects. The LOA is used when the allocation request cannot be satisfied in the main area (the SOA of the tenure heap.

As objects are allocated and freed, the heap can become fragmented in such a way that allocation can be met only by time-consuming compactions. This problem is more pronounced if an application allocates large objects. In an attempt to alleviate this problem, the LOA is allocated. A large object in this context is considered to be any object 64 KB or greater in size. Allocations for new TLH objects are not considered to be large objects.

This option is not supported with the balanced GC policy (-Xgcpolicy:balanced) or metronome GC policy (-Xgcpolicy:metronome), which do not use an LOA. Any LOA options passed on the command line are ignored. These policies address the issues that are solved by an LOA by reorganizing object layout with the VM to reduce heap fragmentation and compaction requirements.

"},{"location":"xloa/#see-also","title":"See also","text":""},{"location":"xloaminimum/","title":"-Xloainitial","text":""},{"location":"xloaminimum/#-xloainitial-xloaminimum-xloamaximum","title":"-Xloainitial / -Xloaminimum / -Xloamaximum","text":"

Specifies the initial, minimum, and maximum proportion of the current tenure space allocated to the large object area (LOA).

The LOA does not shrink to less than the minimum value.

"},{"location":"xloaminimum/#syntax","title":"Syntax","text":"Setting Effect Default -Xloainitial<value> Set initial space 0.05 -Xloaminimum<value> Set minimum space 0.01 -Xloamaximum<value> Set minimum space 0.5"},{"location":"xloaminimum/#see-also","title":"See also","text":"

This option is not supported with the balanced GC policy (-Xgcpolicy:balanced) or metronome GC policy (-Xgcpolicy:metronome), which do not use an LOA.

"},{"location":"xlockreservation/","title":"-XlockReservation","text":""},{"location":"xlockreservation/#-xlockreservation","title":"-XlockReservation","text":"

Enables an optimization that presumes a monitor is owned by the thread that last acquired it.

This optimization minimizes the runtime cost of acquiring and releasing a monitor for a single thread if the monitor is rarely acquired by multiple threads.

"},{"location":"xlockreservation/#syntax","title":"Syntax","text":"
    -XlockReservation\n
"},{"location":"xlockword/","title":"-Xlockword","text":""},{"location":"xlockword/#-xlockword","title":"-Xlockword","text":"

Test whether performance optimizations are negatively impacting an application.

"},{"location":"xlockword/#syntax","title":"Syntax","text":"
    -Xlockword:<parameters>\n
"},{"location":"xlockword/#parameters","title":"Parameters","text":""},{"location":"xlockword/#mode","title":"mode","text":"
    -Xlockword:mode=all\n    -Xlockword:mode=default\n

Locking optimizations typically reduce memory usage and improve performance. However, there might be some situations where a smaller heap size is achieved for an application, but overall application performance decreases.

For example, if your application synchronizes on objects that are not typically synchronized on, such as Java.lang.String, run the following test: Use the following command-line option to revert to behavior that is closer to earlier versions and monitor application performance:

-Xlockword:mode=all\n

If performance does not improve, remove the previous command-line options or use the following command-line option to reestablish the new behavior:

-Xlockword:mode=default\n
"},{"location":"xlockword/#nolockword","title":"nolockword","text":"
    -Xlockword:nolockword=<class_name>\n

Removes the lockword from object instances of the class <class_name>, reducing the space required for these objects. However, this action might have an adverse effect on synchronization for those objects.

You should only use this option for troubleshooting.

"},{"location":"xlockword/#what","title":"what","text":"
    -Xlockword:what\n
Shows the current lockword configuration."},{"location":"xlog/","title":"-Xlog","text":""},{"location":"xlog/#-xlog","title":"-Xlog","text":"

This option is supported for better compatibility with the reference implementation. However, only forms of -Xlog that enable garbage collection (GC) logging are recognized. Note that the behavior of this option changed in Eclipse OpenJ9\u2122 0.24.0.

"},{"location":"xlog/#syntax","title":"Syntax","text":"
    -Xlog[:<parameters>]\n

Note: In Eclipse OpenJ9 version 0.24.0, the -Xsyslog option replaced the existing OpenJ9 -Xlog option for message logging to avoid conflicts with the reference implementation. For backward compatibility, you can control the behavior of the -Xlog option with the -XX:[+|-]LegacyXlogOption option.

"},{"location":"xlog/#explanation","title":"Explanation","text":"

Use of the -Xlog option is supported for GC logging only. The following table describes the behavior of the option depending on what you specify on the command line.

-Xlog option type Behavior An option that returns GC data. For example -Xlog:gc An equivalent OpenJ9 GC logging option is enabled. See the next table for more details. An option that, in the reference implementation, returns GC data and also other data. For example: -Xlog, -Xlog:all, -Xlog:gc+<other_tag>, or -Xlog:gc:stdout An equivalent OpenJ9 GC logging option is enabled as before but because non-GC data is not supported, the following error message is also produced: JVMJ9VM007W Command-line option unrecognised: <option> An option that, in the reference implementation, returns only non-GC data Non-GC data is not supported, so the following error message is produced: JVMJ9VM007W Command-line option unrecognised: <option>

The following table shows some examples of the mapping between -Xlog parameters and the equivalent OpenJ9 GC parameters:

-Xlog parameter OpenJ9 GC equivalent -Xlog:gc -Xlog:gc:stderr -verbose:gc -Xlog:gc:<filename> -Xlog:gc:file=<filename> -Xverbosegclog:<updated_filename>

In the table, the value of <filename> can contain the following tokens, which are processed and passed to the -Xverbosegclog option as <updated_filename>:

"},{"location":"xlog/#see-also","title":"See also","text":""},{"location":"xlp/","title":"-Xlp","text":""},{"location":"xlp/#-xlp","title":"-Xlp","text":"

Requests the Eclipse OpenJ9\u2122 VM to allocate the Java\u2122 object heap and JIT code cache memory with large pages.

Note: This option is deprecated in all versions later than Java 8. Use the -Xlp:codecache and -Xlp:objectheap options instead.

Restriction: This option does not work on macOS\u00ae.

If you use the -Xgc:preferredHeapBase option with -Xlp, the preferredHeapBase address must be a multiple of the large page size. If you specify an inaccurate heap base address, the heap is allocated with the default page size.

To find out the large page sizes available and the current setting, use the -verbose:sizes option. These current settings are the requested sizes and not the sizes obtained. For object heap size information, check the -verbose:gc output.

To use the large pages in the VM, enable the large pages support in the operating system for the machine to be used. The process for enabling the large page support differs in different operating systems. For more information, see Configuring large page memory allocation.

If the configured large page size is greater than the size of the total code cache for JIT, then the page size that is used for code cache allocation is recalculated. The next available lower page size on the system is identified and used for the code cache allocation.

For example, if 1 GB, 2 MB and 4 KB pages are available on a system, the VM checks the total size of the JIT code cache. If the total JIT code cache size is not modified (by using the -Xcodecachetotal option), then for a 64-bit VM, the JIT code cache size will be the default size, 256 MB. In this case, the VM does not use 1 GB pages for the code cache because the size of the page exceeds the total size of the code cache (256 MB for 64-bit systems). Thus, the next available page size lower than 256 MB is used for code cache allocation. In this example, the next available lower size page is 2 MB. 128 pages (of 2 MB each) are allocated for the code cache.

"},{"location":"xlp/#syntax","title":"Syntax","text":"
    -Xlp[<size>]\n

For more information about the <size> parameter, see Using -X command-line options.

"},{"location":"xlp/#explanation","title":"Explanation","text":""},{"location":"xlp/#aix","title":"AIX\u00ae","text":"

If <size> is specified, the VM attempts to allocate the JIT code cache memory by using pages of that size. Allocating large pages by using -Xlp is supported only on the 64-bit VM, not the 32-bit VM.

If a size is not specified, this option requests the VM to allocate the Java object heap (the heap from which Java objects are allocated) with large (16 MB) pages.

If large pages are not available, the Java object heap is allocated with the next smaller page size that is supported by the system. AIX requires special configuration to enable large pages.

The VM supports the use of large pages only to back the Java object heap shared memory segments. The VM uses shmget() with the SHM_LGPG and SHM_PIN flags to allocate large pages. The -Xlp option replaces the environment variable IBM_JAVA_LARGE_PAGE_SIZE, which is now ignored if set.

For more information about configuring AIX support for large pages, see Large pages in the AIX product documentation.

"},{"location":"xlp/#linux","title":"Linux\u00ae","text":"

If <size> is specified, the VM attempts to allocate the JIT code cache memory by using pages of that size. Allocating large pages by using -Xlp is supported only on the 64-bit VM, not the 32-bit VM.

If large pages are not available, the VM does not start and produces an error message. The VM uses shmget() to allocate large pages for the heap. Large pages are supported by systems that have Linux kernels v2.6 or higher.

Note: Linux for IBM Z\u00ae supports only a large page size of 1 M.

Depending on the architecture, 1 MB or 2 MB large pages, when available, are the default size for the object heap and the code cache. The options that control these sizes are Xlp:codecache and -Xlp:objectheap.

"},{"location":"xlp/#windows","title":"Windows\u2122","text":"

If <size> is specified, the VM attempts to allocate the JIT code cache memory by using pages of that size.

Allocating large pages by using -Xlp is supported only on the 64-bit VM, not the 32-bit VM.

"},{"location":"xlp/#zos","title":"z/OS\u00ae","text":"

If <size> is specified but unsuccessful, or if executable pages of that size are not supported, 1 M pageable is attempted. If 1 M pageable is not available, the JIT code cache memory is allocated by using the default or smallest available executable page size.

If <size> is not specified, the 1 M nonpageable size is used. If large pages are not supported by the hardware, or enabled in RACF\u00ae, the VM does not start and produces an error message.

Allocating large pages by using -Xlp is supported only on the 64-bit VM, not the 31-bit VM. The -Xlp[<size>] option supports only a large page size of 2 G and 1 M (nonpageable).

1 M pageable pages, when available, are the default size for the object heap and the code cache. The options that control these sizes are Xlp:codecache and -Xlp:objectheap.

Specifying -Xlp1M uses a 1 M pageable size for the code cache, when available. Specifying -Xlp2G sets the object heap size, but generates a warning that 2 G nonpageable pages cannot be used for the code cache. Use the -Xlp:objectheap:pagesize=2G,nonpageable option to avoid the warning.

"},{"location":"xlp/#limitation-and-workaround","title":"Limitation and workaround","text":"

The VM ends if insufficient operating system resources are available to satisfy the request. However, an error message is not issued. There are a number of reasons why the VM cannot honor a large page request. For example, there might be insufficient large pages available on the system at the time of the request. To check whether the -Xlp request was honored, you can review the output from -verbose:gc. Look for the attributes requestedPageSize and pageSize in the -verbose:gc log file. The attribute requestedPageSize contains the value specified by -Xlp. The attribute pageSize is the actual page size used by the VM.

"},{"location":"xlp/#see-also","title":"See also","text":""},{"location":"xlpcodecache/","title":"-Xlp:codecache","text":""},{"location":"xlpcodecache/#-xlpcodecache","title":"-Xlp:codecache","text":"

Requests the Eclipse OpenJ9\u2122 VM to allocate the JIT code cache by using large page sizes.

If the requested large page size is not available, the VM starts, but the JIT code cache is allocated by using a platform-defined size. A warning is displayed when the requested page size is not available.

To find out the large page sizes available and the current setting, use the -verbose:sizes option. These current settings are the requested sizes and not the sizes obtained. For object heap size information, check the -verbose:gc output.

To use the large pages in the VM, enable the large pages support on your local system. The process for enabling the large page support differs in different operating systems. For more information, see Configuring large page memory allocation.

If the configured large page size is greater than the size of the total code cache for JIT, then the page size that is used for code cache allocation is recalculated. The next available lower page size on the system is identified and used for the code cache allocation.

For example, if 1 GB, 2 MB and 4 KB pages are available on a system, the VM checks the total size of the JIT code cache. If the total JIT code cache size is not modified (by using the -Xcodecachetotal option), then for a 64-bit VM, the JIT code cache size will be the default size, 256 MB. In this case, the VM does not use 1 GB pages for the code cache because the size of the page exceeds the total size of the code cache (256 MB for 64-bit systems). Thus, the next available page size lower than 256 MB is used for code cache allocation. In this example, the next available lower size page is 2 MB. 128 pages (of 2 MB each) are allocated for the code cache.

"},{"location":"xlpcodecache/#syntax","title":"Syntax","text":"

AIX\u00ae, Linux\u00ae, macOS\u00ae, and Windows\u2122:

    -Xlp:codecache:pagesize=<size>\n

z/OS\u00ae:

    -Xlp:codecache:pagesize=<size>,pageable\n

For more information about the <size> parameter, see Using -X command-line options.

"},{"location":"xlpcodecache/#default-values","title":"Default values","text":""},{"location":"xlpcodecache/#aix","title":"AIX","text":"

The code cache page size is controlled by the DATAPSIZE setting of the LDR_CNTRL environment variable. The page size cannot be controlled by the -Xlp:codecache:pagesize=<size> option. Specifying any other page size results in a warning that the page size is not available. The -verbose:sizes output reflects the current operating system setting.

For more information about the LDR_CNTRL environment variable, see Configuring large page memory allocation: AIX systems.

"},{"location":"xlpcodecache/#linux","title":"Linux","text":"

The default size for the code cache depends on the architecture:

"},{"location":"xlpcodecache/#macos","title":"macOS","text":"The default size for the code cache is 4 KB large pages."},{"location":"xlpcodecache/#zos","title":"z/OS","text":"

1 MB pageable pages, when available, are the default size for the code cache.

The -Xlp:codecache:pagesize=<size>,pageable option supports only a large page size of 1 MB pageable large pages. The use of 1 MB pageable large pages for the JIT code cache can improve the runtime performance of some Java\u2122 applications. A page size of 4 KB can also be used.

"},{"location":"xlpcodecache/#see-also","title":"See also","text":""},{"location":"xlpobjectheap/","title":"-Xlp:objectheap","text":""},{"location":"xlpobjectheap/#-xlpobjectheap","title":"-Xlp:objectheap","text":"

Requests the Eclipse OpenJ9\u2122 VM to allocate the Java\u2122 object heap by using large page sizes.

To find out the large page sizes available and the current setting, use the -verbose:sizes option. Note that the current settings are the requested sizes and not the sizes obtained. For object heap size information, check the -verbose:gc output.

"},{"location":"xlpobjectheap/#syntax","title":"Syntax","text":"

AIX\u00ae, Linux\u00ae, macOS\u00ae, and Windows\u2122:

    -Xlp:objectheap:pagesize=<size>[,strict|warn]\n

z/OS\u00ae:

    -Xlp:objectheap:pagesize=<size>[,strict|warn][,pageable|nonpageable]\n

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xlpobjectheap/#parameters","title":"Parameters","text":""},{"location":"xlpobjectheap/#pagesize","title":"pagesize","text":"
    -Xlp:objectheap:pagesize=<size>\n

The large page size that you require.

If the operating system does not have sufficient resources to satisfy the request, the page size you requested might not be available when the VM starts up. By default, the VM starts and the Java object heap is allocated by using a different platform-defined page size. Alternatively, you can use the strict or warn suboptions to customize behavior.

"},{"location":"xlpobjectheap/#default-page-sizes","title":"Default page sizes","text":"

On Linux systems, the default size for the object heap depends on the architecture:

On macOS, the default page size is 4 KB.

On z/OS systems, the default page size is 1 MB pageable large pages. For more information, see pageable|nonpageable.

"},{"location":"xlpobjectheap/#strict-warn","title":"strict | warn","text":"
    -Xlp:objectheap:strict\n    -Xlp:objectheap:warn\n

Note: If both strict and warn are specified, strict takes precedence.

"},{"location":"xlpobjectheap/#pageablenonpageable","title":"pageable|nonpageable","text":"
    -Xlp:objectheap:pageable\n    -Xlp:objectheap:nonpageable\n

On z/OS systems, defines the type of memory to allocate for the Java object heap.

1 MB pageable large pages, when available, are the default size for the object heap.

64-bit VMs support large page sizes of 1 MB nonpageable and 2 GB nonpageable with the following requirements:

31-bit VMs support a large page size of only 1 MB pageable.

A page size of 4 KB can also be used.

"},{"location":"xlpobjectheap/#examples","title":"Examples","text":"
  1. z/OS: To allocate 1 GB of real memory by using 1 MB nonpageable pages when the VM starts, set the following options:
-Xmx1023m -Xms512m -Xlp:objectheap:pagesize=1M,nonpageable\n
  1. z/OS: To allocate 1 GB of real memory by using 2 GB nonpageable pages, set the following options:
-Xmx1023m -Xms512m -Xlp:objectheap:pagesize=2G,nonpageable\n

In this example the heap is allocated on a 2 GB large page. Even though the object heap is only 1 GB, 2 GB of memory are consumed and the large page is never paged out while the VM is running.

"},{"location":"xlpobjectheap/#see-also","title":"See also","text":""},{"location":"xmca/","title":"-Xmca","text":""},{"location":"xmca/#-xmca-xmco","title":"-Xmca / -Xmco","text":"

Sets the expansion step for the memory allocated to store the RAM (-Xmca) and ROM (-Xmco) portions of loaded classes.

Each time more memory is required to store classes in RAM or ROM, the allocated memory is increased by the amount set.

If the expansion step size you choose is too large, OutOfMemoryError is reported. The exact value of a \"too large\" expansion step size varies according to the platform and the specific machine configuration.

You can use the -verbose:sizes option to find out the value that is being used by the VM.

"},{"location":"xmca/#syntax","title":"Syntax","text":"Setting Effect Default -Xmca<size> Set expansion step for RAM 32 KB -Xmco<size> Set expansion step for ROM 128 KB

See Using -X command-line options for more information about the <size> parameter.

This option cannot be used with the metronome GC policy (-Xgcpolicy:metronome) because the heap is always fully expanded.

"},{"location":"xmca/#see-also","title":"See also","text":""},{"location":"xmcrs/","title":"-Xmcrs","text":""},{"location":"xmcrs/#-xmcrs","title":"-Xmcrs","text":"

Sets an initial size for an area in memory that is reserved for any native classes, monitors, and threads that are used by compressed references within the lowest 4 GB memory area.

You can use the -verbose:sizes option to find out the value that is being used by the VM.

Notes:

"},{"location":"xmcrs/#syntax","title":"Syntax","text":"
    -Xmcrs<size>\n

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xmine/","title":"-Xmaxe","text":""},{"location":"xmine/#-xmine-xmaxe","title":"-Xmine / -Xmaxe","text":"

Set the minimum and maximum amounts by which the garbage collector expands the heap.

"},{"location":"xmine/#syntax","title":"Syntax","text":"Setting Default -Xmine<size> 1 MB -Xmaxe<size> 0 (unlimited expansion)

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xmine/#explanation","title":"Explanation","text":"

Typically, the garbage collector expands the heap by the amount required to restore the free space to 30% (or the amount specified by -Xminf).

If heap expansion is required:

For the gencon GC policy, the values apply only to the tenure part of the heap. For the balanced, optthruput, and optavgpause GC policies, these values apply to the whole heap. This option cannot be used with the metronome GC policy (-Xgcpolicy:metronome) because the heap is always fully expanded.

"},{"location":"xmine/#see-also","title":"See also","text":""},{"location":"xminf/","title":"-Xmaxf","text":""},{"location":"xminf/#-xminf-xmaxf","title":"-Xminf / -Xmaxf","text":"

Specifies the minimum and maximum proportion of the heap that must remain free after a global garbage collection (GC) cycle.

If the free space is above or below these limits, the Eclipse OpenJ9\u2122 VM attempts to adjust the heap size so that: -Xminf \u2264 free space \u2264 -Xmaxf.

"},{"location":"xminf/#syntax","title":"Syntax","text":"Setting Effect Default -Xminf<value> Set minimum free space 0.3 -Xmaxf<value> Set maximum free space 0.6

The value range is 0.0 - 1.0.

"},{"location":"xminf/#see-also","title":"See also","text":""},{"location":"xmint/","title":"-Xmaxt","text":""},{"location":"xmint/#-xmint-xmaxt","title":"-Xmint / -Xmaxt","text":"

Sets the minimum and maximum proportion of time to spend in the garbage collection (GC) process as a percentage of the overall running time that included the last three GC runs. Therefore, the time spent in the GC process includes time spent in global mark phase and global GC operations but excludes partial garbage collection pauses because the latter apply only to the eden space.

Restrictions:

"},{"location":"xmint/#syntax","title":"Syntax","text":"Setting Effect Default for balanced policy Default for other policies -Xmint<value> Set minimum time in GC 0.02 0.05 -Xmaxt<value> Set maximum time in GC 0.05 0.13 "},{"location":"xmint/#see-also","title":"See also","text":""},{"location":"xmn/","title":"-Xmn","text":""},{"location":"xmn/#-xmn-xmns-xmnx","title":"-Xmn / -Xmns / -Xmnx","text":"

Sets the initial and maximum size of the nursery area when using the gencon garbage collection (GC) policy (-Xgcpolicy:gencon), and sets the size of eden when using the balanced garbage collection (GC) policy (-Xgcpolicy:balanced). These options are ignored if they are used with any other GC policy.

You can use the -verbose:sizes option to find out the value that is being used by the VM.

"},{"location":"xmn/#syntax","title":"Syntax","text":"Setting Effect Default -Xmn<size> Equivalent to setting both -Xmns and -Xmnx Not set -Xmns<size> Set initial size 25% of -Xms when using gencon and balanced policies -Xmnx<size> Set maximum size 25% of -Xmx when using gencon, and 75% of -Xmx when using balanced

See Using -X command-line options for more information about the <size> parameter.

Restriction: If you try to set -Xmn with either -Xmns or -Xmnx, the VM does not start, returning an error.

Notes:

To set the size of the tenure area of the heap when using gencon GC policy, see -Xmo/-Xmos/-Xmox.

"},{"location":"xmn/#see-also","title":"See also","text":""},{"location":"xmo/","title":"-Xmo","text":""},{"location":"xmo/#-xmo-xmos-xmox","title":"-Xmo / -Xmos / -Xmox","text":"

Sets the size of the tenure area of the heap for the gencon garbage collection (GC) policy.

You can use the -verbose:sizes option to find out the values that the VM is currently using.

"},{"location":"xmo/#syntax","title":"Syntax","text":"Setting Effect Default -Xmo<size> Equivalent to setting both -Xmos and -Xmox not set -Xmos<size> Set initial size of the tenure area of the heap 75% of -Xms -Xmox<size> Set maximum size of the tenure area of the heap -Xmx minus -Xmns

where -Xmx refers to the maximum heap size and -Xmns refers to the minimum size of the nursery area of the heap.

Although the tenure and nursery areas of the heap have independent maximum sizes, -Xmox and -Xmnx, the sum of their current sizes cannot be larger than -Xmx.

To set the size of the nursery area of the heap, see -Xmn/-Xmns/-Xmnx.

For more information about the <size> parameter, see Using -X command-line options.

Restriction: If you try to set -Xmo with either -Xmos or -Xmox, the VM does not start, returning an error.

"},{"location":"xmo/#see-also","title":"See also","text":""},{"location":"xmoi/","title":"-Xmoi","text":""},{"location":"xmoi/#-xmoi","title":"-Xmoi","text":"

Sets the heap expansion allocation increment.

You can use the -verbose:sizes option to find out the values that the VM is currently using.

"},{"location":"xmoi/#syntax","title":"Syntax","text":"Setting Effect Default -Xmoi<size> Sets the heap expansion allocation increment See Notes

Notes:

This option is not supported for the metronome GC policy, because the heap is always fully expanded.

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xmoi/#see-also","title":"See also","text":""},{"location":"xmr/","title":"-Xmr","text":""},{"location":"xmr/#-xmr-xmrx","title":"-Xmr / \u00a0 -Xmrx","text":"

Sets the initial and maximum size of the the garbage collection (GC) remembered set in the gencon GC policy. The remembered set is a list of objects in the tenure area of the heap that have references to objects in the new area.

"},{"location":"xmr/#syntax","title":"Syntax","text":"Setting Effect Default -Xmr<size> Set initial size 16 K -Xmrx<size> Set maximium size

See Using -X command-line options for more information about the <size> parameter.

This option applies only to the gencon GC policy.

"},{"location":"xms/","title":"-Xms","text":""},{"location":"xms/#-xms-xmx","title":"-Xms / -Xmx","text":"

These Oracle\u00ae HotSpot\u2122 options set the initial/minimum Java\u2122 heap size, and the maximum heap size respectively. These options are recognized by the Eclipse OpenJ9\u2122 VM.

Notes:

For the gencon GC policy, you can also use the -Xmo option:

"},{"location":"xms/#syntax","title":"Syntax","text":"Setting Effect Default -Xms<size> Set initial heap size 8 MB -Xmx<size> Set maximum heap size 25% of available memory (25 GB maximum)

See Using -X command-line options for more information about the <size> parameter. See Default settings for the OpenJ9 VM for more about default values.

The -Xmx option can be used with all OpenJ9 GC policies. However, the -Xms option can be used with all GC policies except for the metronome GC policy because the heap is always fully expanded.

"},{"location":"xms/#examples","title":"Examples","text":"-Xms2m -Xmx64m Heap starts at 2 MB and grows to a maximum of 64 MB. -Xms100m -Xmx100m Heap starts at 100 MB and never grows. -Xms50m Heap starts at 50 MB and grows to the default maximum. -Xmx256m Heap starts at default initial value and grows to a maximum of 256 MB."},{"location":"xms/#see-also","title":"See also","text":""},{"location":"xmso/","title":"-Xmso","text":""},{"location":"xmso/#-xmso","title":"-Xmso","text":"

Sets the native stack size for operating system threads.

You can use the -verbose:sizes option to find out the values that the VM is currently using.

When a native method makes a call into the VM, the VM calculates whether the memory required for the call will exceed the -Xmso value. If so, a java/lang/StackOverflowError error is thrown.

Note: Java methods and native methods run on two different stacks and the VM handles switching between them for JNI calls. Each stack is sized using separate options; this option applies to the native stack only. For the Java stack option, see the link in the See also section.

"},{"location":"xmso/#syntax","title":"Syntax","text":"
    -Xmso<size>\n

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xmso/#default-setting","title":"Default setting","text":"

Default values vary by platform. See Default settings for the Eclipse OpenJ9\u2122 VM.

Note: On 64-bit z/OS, the default size is the minimum that can be allocated by the operating system. So if you set a value that is smaller, that value is ignored by the VM.

"},{"location":"xmso/#see-also","title":"See also","text":""},{"location":"xnumanone/","title":"-Xnuma:none","text":""},{"location":"xnumanone/#-xnumanone","title":"-Xnuma:none","text":"

(AIX\u00ae, Linux\u00ae, and Windows\u2122 only)

Use this option to turn off non-uniform memory architecture (NUMA) awareness when using the balanced garbage collection policy.

For workloads that do most of their work in one thread, or workloads that maintain a full heap, turning off NUMA awareness can improve performance.

"},{"location":"xnumanone/#syntax","title":"Syntax","text":"
    -Xnuma:none\n
"},{"location":"xnumanone/#default-behavior","title":"Default behavior","text":"

NUMA awareness is enabled by default.

"},{"location":"xoptionsfile/","title":"-Xoptionsfile","text":""},{"location":"xoptionsfile/#-xoptionsfile","title":"-Xoptionsfile","text":"

Specifies a file that contains VM options and definitions.

The contents of the options file are recorded in the ENVINFO section of a Java\u2122 dump.

"},{"location":"xoptionsfile/#syntax","title":"Syntax","text":"
    -Xoptionsfile=<file_name>\n
where <file_name> specifies a file that contains options that are processed as if they had been entered directly as command-line options."},{"location":"xoptionsfile/#explanation","title":"Explanation","text":"

At startup, the VM automatically adds -Xoptionsfile=<path>/options.default at the beginning of the command line, where <path> is the path to the VM directory.

<path> is the VM directory, as shown in Directory conventions. <path> is the <java_home>/lib directory, where <java_home> is the directory for your runtime environment.

The file options.default can be updated with any options that you want to specify at run time.

The options file does not support these options:

Although you cannot use -Xoptionsfile recursively within an options file, you can use -Xoptionsfile multiple times on the same command line to load more than one options files.

Some options use quoted strings as parameters. Do not split quoted strings over multiple lines using the forward slash line continuation character (\\). The Yen symbol (\u00a5) is not supported as a line continuation character. For example, the following example is not valid in an options file:

-Xevents=vmstop,exec=\"cmd /c \\\necho %pid has finished.\"\n

The following example is valid in an options file:

-Xevents=vmstop, \\\nexec=\"cmd /c echo %pid has finished.\"\n
"},{"location":"xoptionsfile/#example","title":"Example","text":"

Here is an example of an options file:

#My options file\n-X<option1>\n-X<option2>=\\\n<value1>,\\\n<value2>\n-D<sysprop1>=<value1>\n
"},{"location":"xoptionsfile/#see-also","title":"See also","text":""},{"location":"xquickstart/","title":"-Xquickstart","text":""},{"location":"xquickstart/#-xquickstart","title":"-Xquickstart","text":"

This option causes the JIT compiler to run with a subset of optimizations, which can improve the performance of short-running applications.

Note: For compatibility with other Java\u2122 virtual machines, you can also specify the -client option, which results in identical behavior to -Xquickstart.

"},{"location":"xquickstart/#syntax","title":"Syntax","text":"
    -Xquickstart\n
"},{"location":"xquickstart/#default-behavior","title":"Default behavior","text":"

By default, -Xquickstart is disabled.

"},{"location":"xquickstart/#explanation","title":"Explanation","text":"

The JIT compiler is tuned for long-running applications typically used on a server. When you specify this option, the compiler uses a subset of optimizations, which results in faster compilation times that improve startup time. However, longer running applications might run more slowly, especially applications that contain hot methods and other methods using a large amount of processing resource.

When the AOT compiler is active (both shared classes and AOT compilation enabled), -Xquickstart causes all methods to be AOT compiled. The AOT compilation improves the startup time of subsequent runs, but might reduce performance for longer running applications, especially those that contain hot methods.

Note: The implementation of -Xquickstart is subject to change in future releases.

"},{"location":"xrs/","title":"-Xrs","text":""},{"location":"xrs/#-xrs","title":"-Xrs","text":"

Prevents the Eclipse OpenJ9\u2122 runtime environment from handling any internally or externally generated signals such as SIGSEGV and SIGABRT. Any signals that are raised are handled by the default operating system handlers, which you might want if you are using a debugger such as GDB or WinDbg to diagnose problems in JNI code.

Disabling signal handling in the OpenJ9 VM reduces performance by approximately 2-4%, depending on the application.

Note: Setting this option prevents dumps being generated by the OpenJ9 VM for signals such as SIGSEGV and SIGABRT, because the VM is no longer intercepting these signals. Do not use the -Xrs option with the following options:

An error is thrown if either of the options is enabled together with the -Xrs option. To resolve this error, one of the options should be disabled.

"},{"location":"xrs/#syntax","title":"Syntax","text":"
    -Xrs\n    -Xrs:sync\n
"},{"location":"xrs/#parameters","title":"Parameters","text":"

If you specify the sync parameter:

Linux and macOS systems always use the SIGUSR1 signal.

"},{"location":"xrs/#see-also","title":"See also","text":""},{"location":"xrsonrestoresynconrestore/","title":"-Xrs:onRestore / -Xrs:syncOnRestore","text":""},{"location":"xrsonrestoresynconrestore/#-xrsonrestore-xrssynconrestore","title":"-Xrs:onRestore / -Xrs:syncOnRestore","text":"

(Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), Linux on AArch64, and Linux on IBM Z\u00ae only)

The -Xrs option is an existing option for disabling signal handling in the VM. CRIU support adds new suboptions onRestore and syncOnRestore for disabling signal handling when you restore a VM.

If the VM was started with signal handling enabled, then when you restore the VM, the signal handling is enabled by default. It is possible that there are frames with attached signal handlers already on the stack. These frames remain unchanged and their signal handlers remain active. Likewise, some global handlers might not be removed as well. The new options prevent the addition of new signal handlers and force recompilation of Java\u2122 methods that make use of the existing signal handlers.

Restrictions: This option takes effect only when the -XX:+EnableCRIUSupport option is enabled. This option can be used only on restore.

"},{"location":"xrsonrestoresynconrestore/#parameters","title":"Parameters","text":""},{"location":"xrsonrestoresynconrestore/#onrestore","title":"onRestore","text":"
    -Xrs:onRestore\n

The -Xrs:onRestore option is similar to the -Xrs option.

"},{"location":"xrsonrestoresynconrestore/#synconrestore","title":"syncOnRestore","text":"
    -Xrs:syncOnRestore\n

The -Xrs:syncOnRestore option is similar to the -Xrs:sync option.

Although there are similarities between the existing options and the new CRIU related options, there are behavioural differences that limits what can be disabled with the existing options at the restore time.

"},{"location":"xrsonrestoresynconrestore/#see-also","title":"See also","text":""},{"location":"xsamplingexpirationtime/","title":"-XsamplingExpirationTime","text":""},{"location":"xsamplingexpirationtime/#-xsamplingexpirationtime","title":"-XsamplingExpirationTime","text":"

Disables JIT sampling after a specified amount of time.

When the JIT sampling thread is disabled, no processor cycles are used by an idle Eclipse OpenJ9\u2122 VM.

Use this option with care; after the sampling thread is disabled, you cannot reactivate it. However, because the profiling frequency is automatically reduced, you should not have to use this option.

Allow the sampling thread to run for long enough to identify important optimizations.

"},{"location":"xsamplingexpirationtime/#syntax","title":"Syntax","text":"
    -XsamplingExpirationTime<time>\n
where <time> is specified in seconds."},{"location":"xsamplingexpirationtime/#explanation","title":"Explanation","text":"

The JIT sampling thread profiles the running Java\u2122 application to discover commonly used methods. The memory and processor usage of the sampling thread is negligible, and the frequency of profiling is automatically reduced when the OpenJ9 VM is idle, to once per second instead of once every 10ms, or once every 100 seconds if the idle state lasts more than 50 seconds.

"},{"location":"xscdmx/","title":"-Xscdmx","text":""},{"location":"xscdmx/#-xscdmx","title":"-Xscdmx","text":"

Use the -Xscdmx option to control the size of the class debug area when you create a shared classes cache.

"},{"location":"xscdmx/#syntax","title":"Syntax","text":"
    -Xscdmx<size>\n

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xscdmx/#explanation","title":"Explanation","text":"

The -Xscdmx option works in a similar way to the -Xscmx option, which is used to control the overall size of the shared classes cache. The size of -Xscdmx must be smaller than the size of -Xscmx. By default, the size of the class debug area is a percentage of the free class data bytes in a newly created or empty cache.

A class debug area is still created if you use the -Xnolinenumbers option with the -Xscdmx option on the command line.

"},{"location":"xscminaot/","title":"-Xscmaxaot","text":""},{"location":"xscminaot/#-xscminaot-xscmaxaot","title":"-Xscminaot / -Xscmaxaot","text":"

When you create a shared classes cache, you can use these options to set the minimum and maximum number of bytes in the class cache to reserve for AOT data.

Setting -Xscmaxaot is useful if you want a certain amount of cache space guaranteed for non-AOT data.

"},{"location":"xscminaot/#syntax","title":"Syntax","text":"Setting Effect Default -Xscminaot<size> Set minimum size for AOT class cache 0 -Xscmaxaot<size> Set maximum size for AOT class cache The amount of free space in the cache

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xscminaot/#-xscminaot","title":"-Xscminaot","text":"

If -Xscminaot is not specified, no space is reserved for AOT data. However, AOT data is still written to the cache until the cache is full or the -Xscmaxaot limit is reached.

The value of -Xscminaot must not exceed the value of -Xscmx or -Xscmaxaot and should be considerably less than the total cache size, because AOT data can be created only for cached classes. If the value of -Xscminaot equals the value of -Xscmx, no class data or AOT data can be stored.

"},{"location":"xscminaot/#-xscmaxaot","title":"-Xscmaxaot","text":"

The value of this option must not be smaller than the value of -Xscminaot and must not be larger than the value of -Xscmx.

When you run an application with the -Xshareclasses:verbose option, the VM writes to the console the amount of AOT data that is not stored due to the current setting of the maximum AOT data space. You can also get this information by using the MemoryMXBean.getSharedClassCacheMaxAotUnstoredBytes() method in the com.ibm.lang.management API. You can increase the maximum AOT data space size accordingly if you want to add the unstored AOT data to the shared cache.

"},{"location":"xscminaot/#see-also","title":"See also","text":""},{"location":"xscminjitdata/","title":"-Xscmaxjitdata","text":""},{"location":"xscminjitdata/#-xscminjitdata-xscmaxjitdata","title":"-Xscminjitdata / -Xscmaxjitdata","text":"

When you create a shared classes cache, you can use these options to set a minimum and maximum number of bytes in the class cache that can be used for JIT data.

When you run an application with the -Xshareclasses:verbose option, the VM writes to the console the amount of JIT data that is not stored due to the current setting of the the maximum JIT data space. You can also get this information by using the MemoryMXBean.getSharedClassCacheMaxJitDataUnstoredBytes() method in the com.ibm.lang.management API.

You can increase the maximum JIT data space size accordingly if you want to add the unstored data to the shared cache. However, the VM that provided the information no longer has the opportunity to store the JIT data. Subsequent VMs can store JIT data in the shared cache.

"},{"location":"xscminjitdata/#syntax","title":"Syntax","text":"Setting Effect Default -Xscminjitdata<size> Set minimum size for JIT data 0 (See Default behavior) -Xscmaxjitdata<size> Set maximum size for JIT data The amount of free space in the cache

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xscminjitdata/#default-behavior","title":"Default behavior","text":"

If -Xscminjitdata is not specified, no space is reserved for JIT data, although JIT data is still written to the cache until the cache is full or the -Xscmaxjitdata limit is reached.

"},{"location":"xscminjitdata/#explanation","title":"Explanation","text":""},{"location":"xscminjitdata/#-xscminjitdata","title":"-Xscminjitdata","text":"

The value of -Xscminjitdata must not exceed the value of -Xscmx or -Xscmaxjitdata. The value of -Xscminjitdata must always be considerably less than the total cache size, because JIT data can be created only for cached classes. If the value of -Xscminjitdata equals the value of -Xscmx, no class data or JIT data can be stored.

"},{"location":"xscminjitdata/#-xscmaxjitdata","title":"-Xscmaxjitdata","text":"

Setting -Xscmaxjitdata is useful if you want a certain amount of cache space guaranteed for non-JIT data. If this option is not specified, the maximum limit for JIT data is the amount of free space in the cache. The value of this option must not be smaller than the value of -Xscminjitdata, and must not be larger than the value of -Xscmx.

"},{"location":"xscminjitdata/#see-also","title":"See also","text":""},{"location":"xscmx/","title":"-Xscmx","text":""},{"location":"xscmx/#-xscmx","title":"-Xscmx","text":"

For a new shared classes cache, specifies either:

This option applies only if a cache is being created and no cache of the same name exists.

When you run an application with the -Xshareclasses:verbose option, the VM writes to the console the number of bytes that are not stored due to the current setting of the soft maximum size. You can also get this information by using the MemoryMXBean.getSharedClassCacheSoftmxUnstoredBytes() method in the com.ibm.lang.management API.

You can increase the soft maximum size accordingly if you want to add the unstored data to the shared cache. However, the VM that provided the information no longer has the opportunity to store that data. Therefore, increasing the soft maximum size does not necessarily cause any more data to be stored in the shared cache by the current VM, but subsequent VMs can add data to the shared cache.

"},{"location":"xscmx/#syntax","title":"Syntax","text":"
    -Xscmx<size>\n

See Using -X command-line options for more information about the <size> parameter.

"},{"location":"xscmx/#explanation","title":"Explanation","text":""},{"location":"xscmx/#setting-a-soft-maximum-size","title":"Setting a soft maximum size","text":"

If you specify the -Xscmx option with the -XX:SharedCacheHardLimit option, the -Xscmx option sets the soft maximum size of a new shared classes cache, and the -XX:SharedCacheHardLimit option sets the actual maximum size. The value of the -Xscmx option must therefore not exceed the value of -XX:SharedCacheHardLimit.

When the soft maximum limit is reached, no more data can be added into the shared cache, unless there is reserved AOT or JIT data space. If such reserved space exists, AOT or JIT data can still be added into the reserved space. The reserved AOT and JIT data spaces are counted as used space within the soft maximum size, so the soft maximum size should not be less than the minimum reserved space for AOT and JIT data if you specify the -Xscminaot or -Xscminjitdata options.

You can change the soft maximum size by using the -Xshareclasses:adjustsoftmx=<size> option or the MemoryMXBean.setSharedClassCacheSoftmxBytes() method in the com.ibm.lang.management API. By using this API, Java\u2122 applications can dynamically monitor and adjust the cache soft maximum size as required. This function can be useful in virtualized or cloud environments, for example, where the shared cache size might change dynamically to meet business needs.

For example, you might create a 64 MB shared cache and set a smaller value, such as 16 MB, for the -Xscmx option, to limit the data stored in the cache:

-XX:SharedCacheHardLimit=64m -Xscmx16m\n

You can then use the com.ibm.lang.management API from within a Java application to increase the soft maximum value during run time, as load increases. This change allows the application to use more shared cache space than you specified initially.

You can increase the soft maximum size if it is currently less than the actual cache size. If you attempt to reduce the soft maximum size to a value that is less than the number of bytes already used in the cache, the number of used bytes is set as the new soft maximum size.

"},{"location":"xscmx/#cache-size-limits","title":"Cache size limits","text":"

The theoretical cache size limit is 2 GB. The size of the cache that you can specify is limited by the following factors:

Non-persistent caches are stored in shared memory and are removed when a system is rebooted. On systems other than Windows, non-persistent caches are allocated by using the System V IPC shared memory mechanism. To ensure that sufficient shared memory is available for class data sharing, see Setting shared memory values.

Note: By default, a cache is persistent on all platforms, except z/OS.

"},{"location":"xscmx/#see-also","title":"See also","text":""},{"location":"xshareclasses/","title":"-Xshareclasses","text":""},{"location":"xshareclasses/#-xshareclasses","title":"-Xshareclasses","text":"

Use the -Xshareclasses option to enable, disable, or modify class sharing behavior. Class data sharing is enabled by default for bootstrap classes only (the equivalent of specifying -Xshareclasses:bootClassesOnly,nonFatal,silent), unless your application is running in a container.

This option can take a number of parameters, some of which are cache utilities. Cache utilities carry out specific operations on a specified cache without starting the Java virtual machine (VM). Although you can combine multiple suboptions, which are separated by commas, the cache utilities are mutually exclusive.

Some cache utilities can work with caches from previous Java\u2122 versions or caches that are created by VMs with different bit-widths. These caches are referred to as \"incompatible\" caches.

See also the Class data sharing topic, which includes some best practices for using -Xshareclasses.

"},{"location":"xshareclasses/#syntax","title":"Syntax","text":"
    -Xshareclasses:<parameter>\n

When you specify -Xshareclasses without any parameters and without specifying either the -Xscmx or -XX:SharedCacheHardLimit options, a shared classes cache is created with a default size, as follows:

"},{"location":"xshareclasses/#parameters","title":"Parameters","text":""},{"location":"xshareclasses/#adjustmaxaot-cache-utility","title":"adjustmaxaot (Cache utility)","text":"
    -Xshareclasses:adjustmaxaot=<size>\n
Adjusts the maximum shared classes cache space that is allowed for AOT data. When you use the -Xshareclasses:verbose option, the VM writes to the console the number of bytes that are not stored due to the current setting of the -Xscmaxaot option."},{"location":"xshareclasses/#adjustminaot-cache-utility","title":"adjustminaot (Cache utility)","text":"
    -Xshareclasses:adjustminaot=<size>\n
Adjusts the minimum shared classes cache space that is reserved for AOT data. Use the -Xscminaot option to set the initial minimum size."},{"location":"xshareclasses/#adjustmaxjitdata-cache-utility","title":"adjustmaxjitdata (Cache utility)","text":"
    -Xshareclasses:adjustmaxjitdata=<size>\n
Adjusts the maximum shared classes cache space that is allowed for JIT data. When you use the -Xshareclasses:verbose option, the VM writes to the console the number of bytes that are not stored due to the current setting of the -Xscmaxjitdata option."},{"location":"xshareclasses/#adjustminjitdata-cache-utility","title":"adjustminjitdata (Cache utility)","text":"
    -Xshareclasses:adjustminjitdata=<size>\n
Adjusts the minimum shared classes cache space that is reserved for JIT data. Use the -Xscminjitdata option to set the initial minimum size."},{"location":"xshareclasses/#adjustsoftmx-cache-utility","title":"adjustsoftmx (Cache utility)","text":"
    -Xshareclasses:adjustsoftmx=<size>\n
Adjusts the soft maximum size of the cache. When you use the -Xshareclasses:verbose option, the VM writes to the console the number of bytes that are not stored due to the current setting of the soft maximum size. For more information about the soft maximum size, see -Xscmx."},{"location":"xshareclasses/#allowclasspaths","title":"allowClasspaths","text":"
    -Xshareclasses:allowClasspaths\n
Allows a VM to store classpaths into an existing shared cache that was created by using the restrictClasspaths option."},{"location":"xshareclasses/#bootclassesonly","title":"bootClassesOnly","text":"
    -Xshareclasses:bootClassesOnly\n
Disables caching of classes that are loaded by class loaders other than the bootstrap class loader. If you use this suboption, the nonfatal suboption is also set, so this suboption is the equivalent of specifying -Xshareclasses:bootClassesOnly,nonfatal."},{"location":"xshareclasses/#cachedir","title":"cacheDir","text":"
    -Xshareclasses:cacheDir=<directory>\n

Sets the directory in which cache data is read and written. Do not set the cache directory on an NFS mount or a shared mount across systems or LPARs. The following defaults apply:

On all operating systems, the VM writes persistent cache files directly into the directory specified. Persistent cache files can be safely moved and deleted from the file system.

Non-persistent caches are stored in shared memory and have control files that describe the location of the memory. Control files are stored in a javasharedresources subdirectory of the cacheDir specified. Do not move or delete control files in this directory. The listAllCaches utility, the destroyAll utility, and the expire suboption work only in the scope of a given cacheDir.

On AIX, Linux, and macOS systems, if you specify the cacheDir=<directory> option, persistent caches are created with the following permissions (-rw-r--r--):

Otherwise, persistent caches are created with the same permissions as non-persistent caches. The permissions for non-persistent caches are -rw-r-----, or -rw-rw---- if you also specify -Xshareclasses:groupAccess.

Note: It is good practice to set an application-specific cache directory to avoid sharing the default cache directory with the default cache, or other application caches that don't set a cache directory, and means that your application is therefore unaffected by a user running java -Xshareclasses:destroyAll. See Class data sharing: Best practices for using -Xshareclasses.

"},{"location":"xshareclasses/#cachedirperm","title":"cacheDirPerm","text":"(Not Windows)
-Xshareclasses:cacheDirPerm=<permission>\n

Sets Unix-style permissions when you are creating a cache directory. <permission> must be an octal number in the ranges 0700 - 0777 or 1700 - 1777. If <permission> is not valid, the VM ends with an appropriate error message.

The permissions that are specified by this suboption are used only when you are creating a new cache directory. If the cache directory already exists, this suboption is ignored and the cache directory permissions are not changed.

If you set this suboption to 0000, the default directory permissions are used. If you set this suboption to 1000, the machine default directory permissions are used, but the sticky bit is enabled.

If the cache directory is the platform default directory, this suboption is ignored. The permission is set as specified in the following conditions and permissions table.

If you do not set this suboption, the default permissions are used according to the following conditions:

Condition Permissions The cache directory is /tmp/javasharedresources. If this directory already exists with different permissions, the permissions are changed when the cache is opened.\u2020 0777 The cache directory already exists and is not /tmp/javasharedresources Unchanged The cache directory is a new directory and you also specify the groupAcess suboption 0770 The cache directory is a new directory and you do not specify the groupAccess suboption 0700 \u2020On z/OS systems, permissions for existing cache directories are unchanged, to avoid generating RACF\u00ae errors, which generate log messages. Note: It is good practice to explicitly set permissions for the cache directory when the defaults are not appropriate. See Class data sharing: Best practices for using -Xshareclasses."},{"location":"xshareclasses/#cacheretransformed","title":"cacheRetransformed","text":"
    -Xshareclasses:cacheRetransformed\n
Enables caching of classes that are transformed by using the JVMTI RetransformClasses function. For more information, see Redefined and retransformed classes.

The option enableBCI is enabled by default. However, if you use the cacheRetransformed option, this option forces cache creation into -Xshareclasses:disableBCI mode.

"},{"location":"xshareclasses/#checkurltimestamps","title":"checkURLTimestamps","text":"
    -Xshareclasses:checkURLTimestamps\n
Causes timestamps of jar or zip files to be checked every time a class is loaded. If a timestamp has changed, the class is loaded from the jar or zip file and not from the shared cache. This suboption is not enabled by default and reflects the legacy behavior of the shared classes cache. Note: The timestamp of a bootstrap jar or zip file is checked once when it is used for the first time to load a class."},{"location":"xshareclasses/#createlayer","title":"createLayer","text":"

(64-bit only)

    -Xshareclasses:createLayer\n
Creates layered caches. If there are multiple VMs in a race condition while creating a layered cache, more than one new layered cache can be created. To avoid this situation, use the -Xshareclasses:layer=<number> suboption to create a new layered cache with a specific layer number. See layer for more information about layered caches."},{"location":"xshareclasses/#destroy-cache-utility","title":"destroy (Cache utility)","text":"
    -Xshareclasses:destroy\n
Destroys a cache that is specified by the name, cacheDir, and nonpersistent suboptions. A cache can be destroyed only if all VMs that are using it have ended and the user has sufficient permissions."},{"location":"xshareclasses/#destroyall-cache-utility","title":"destroyAll (Cache utility)","text":"
    -Xshareclasses:destroyAll\n
Tries to destroy all the caches that are specified by the cacheDir and nonpersistent suboptions. On Windows and z/OS systems, a cache can be destroyed only if all VMs that are using it have shut down and the user has sufficient permissions. Note: On z/OS, when the destroyAll option is invoked from a 31-bit VM, 64-bit caches are not destroyed. Similarly, when the destroyAll option is invoked from a 64-bit VM, 31-bit caches are not destroyed. The following message is displayed:
JVMSHRC735I: Use a nn-bit VM to perform the requested operation on the\nnn-bit shared cache \"cachename\" as the nn-bit VM\ncannot verify that the shared memory was created by the VM.\n

On AIX, Linux, and macOS systems:

"},{"location":"xshareclasses/#destroyalllayers-cache-utility","title":"destroyAllLayers (Cache utility)","text":"

(64-bit only)

    -Xshareclasses:destroyAllLayers\n
Destroys all shared cache layers that are specified by the name suboption. For example, -Xshareclasses:name=Cache1,destroyAllLayers destroys all layers of the cache called Cache1. If you use the destroy suboption on a layered cache, for example -Xshareclasses:name=Cache1,destroy, only the top layer of the cache is destroyed. For more information about layered caches, see Creating layer caches."},{"location":"xshareclasses/#destroyallsnapshots-cache-utility","title":"destroyAllSnapshots (Cache utility)","text":"(Not Windows)
-Xshareclasses:destroyAllSnapshots\n

Destroys all shared cache snapshots that are available as a result of the specified cacheDir suboption.

"},{"location":"xshareclasses/#destroysnapshot-cache-utility","title":"destroySnapshot (Cache utility)","text":"(Not Windows)
-Xshareclasses:destroySnapshot\n

Destroys a snapshot that is specified by the name and cacheDir suboptions.

"},{"location":"xshareclasses/#disablebci","title":"disableBCI","text":"
    -Xshareclasses:disableBCI\n
Turns off BCI support. This option can be used to override -XXShareClassesEnableBCI."},{"location":"xshareclasses/#enablebci","title":"enableBCI","text":"
    -Xshareclasses:enableBCI\n
This option is enabled by default. Allows a JVMTI ClassFileLoadHook event to be triggered every time, for classes that are loaded from the cache. This mode also prevents caching of classes that are modified by JVMTI agents. For more information about bytecode modification, see Support for bytecode instrumentation. This option is incompatible with the cacheRetransformed option. Using the two options together causes the VM to end with an error message, unless -Xshareclasses:nonfatal is specified. In this case, the VM continues without using shared classes. A cache that is created without the enableBCI suboption cannot be reused with the enableBCI suboption. Attempting to do so causes the VM to end with an error message, unless -Xshareclasses:nonfatal is specified. In this case, the VM continues without using shared classes. A cache that is created with the enableBCI suboption can be reused without specifying this suboption. In this case, the VM detects that the cache was created with the enableBCI suboption and uses the cache in this mode."},{"location":"xshareclasses/#expire-cache-utility","title":"expire (Cache utility)","text":"
    -Xshareclasses:expire=<time_in_minutes>\n
Destroys all caches that are unused for the time that is specified before loading shared classes. This option is not a utility option because it does not cause the VM to exit. On Windows systems, which have NTFS file systems, the expire option is accurate to the nearest hour."},{"location":"xshareclasses/#fatal","title":"fatal","text":"
    -Xshareclasses:fatal\n
The VM does not start if class data sharing fails, for example because there was an error when accessing the cache directory. An error message is generated. This suboption is specified by default unless you use the bootClassesOnly suboption, which is equivalent to -Xshareclasses:bootClassesOnly,nonfatal. You can override this behavior by specifying -Xshareclasses:bootClassesOnly,fatal. See also nonfatal."},{"location":"xshareclasses/#findaotmethods-cache-utility","title":"findAotMethods (Cache utility)","text":"
    -Xshareclasses:findAotMethods=<method_specification>\n    -Xshareclasses:findAotMethods=help\n
Print the AOT methods in the shared classes cache that match the method specifications. Methods that are already invalidated are indicated in the output. Use this suboption to check which AOT methods in the shared classes cache would be invalidated by using the same method specifications with the invalidateAotMethods suboption. To learn more about the syntax to use for <method_specification>, including how to specify more than one method, see Method specification syntax."},{"location":"xshareclasses/#groupaccess","title":"groupAccess","text":"(Not Windows)
-Xshareclasses:groupAccess\n

Sets operating system permissions on a new cache to allow group access to the cache. Group access can be set only when permitted by the operating system umask setting. The default is user access only.

On AIX, Linux, and macOS systems, if a user creates a cache by specifying the groupAccess suboption, other users in the same group must also specify this suboption to be granted access to the same cache.

When groupAccess is specified, the default directory for a cache is /tmp/javasharedresources. Some systems might clear the content of the /tmp directory on a reboot, removing the shared cache. To avoid that problem, you are therefore recommended to use cacheDir to set a different location for the cache. If necessary, use cacheDirPerm to ensure that the cache directory permissions are set appropriately.

In certain situations, warning messages might be generated when the groupAccess suboption is used.

This message can occur when persistent caches are used:

JVMSHRC756W Failed to set group access permission on the shared cache\nfile as requested by the 'groupAccess' sub-option\n

These messages can occur when non-persistent caches are used:

JVMSHRC759W Failed to set group access permission as requested by the\n'groupAccess' sub-option on the semaphore control file associated\nwith shared classes cache.\n\nJVMSHRC760W Failed to set group access permission as requested by the\n'groupAccess' sub-option on the shared memory control file associated\nwith shared classes cache.\n

This message can occur in combination with the snapshotCache suboption:

JVMSHRC761W Failed to set group access permission as requested by the\n'groupAccess' sub-option on the shared cache snapshot file.\n

All of these warning messages mean that the user's umask setting does not allow either, or both, of the group read and write permission to be set on the file. The typical umask setting restricts only the write permission. To resolve the warning, either change the umask setting or remove the groupAccess suboption.

"},{"location":"xshareclasses/#help","title":"help","text":"
    -Xshareclasses:help\n
Lists all the command-line options."},{"location":"xshareclasses/#invalidateaotmethods-cache-utility","title":"invalidateAotMethods (Cache utility)","text":"
    -Xshareclasses:invalidateAotMethods=<method_specification>\n    -Xshareclasses:invalidateAotMethods=help\n
Modify the existing shared cache to invalidate the AOT methods that match the method specifications. Use this suboption to invalidate AOT methods that cause a failure in the application, without having to destroy the shared cache. Invalidated AOT methods remain in the shared cache, but are then excluded from being loaded. VMs that have not processed the methods, or new VMs that use the cache are not affected by the invalidated methods. The AOT methods are invalidated for the lifetime of the cache, but do not prevent the AOT methods from being compiled again if a new shared cache is created. To prevent AOT method compilation into a new shared cache, use the -Xaot:exclude option. For more information, see -Xaot. To identify AOT problems, see Diagnosing a JIT or AOT problem. To revalidate an AOT method, see the revalidateAotMethods suboption. Use the findAotMethod suboption to determine which AOT methods match the method specifications. To learn more about the syntax to use for <method_specification>, including how to specify more than one method, see Method specification syntax."},{"location":"xshareclasses/#layer","title":"layer","text":"

(64-bit only)

    -Xshareclasses:layer=<number>\n
Creates layered caches. This suboption has the same effect as the createLayer suboption, but with the added ability to specify the layer number. For more information about creating a shared classes cache with layers, see Creating layer caches."},{"location":"xshareclasses/#listallcaches-cache-utility","title":"listAllCaches (Cache utility)","text":"
    -Xshareclasses:listAllCaches\n
Lists all the compatible and incompatible caches, and snapshots that exist in the specified cache directory. If you do not specify cacheDir, the default directory is used. Summary information, such as Java version and current usage, is displayed for each cache. Output includes cache-type (persistent or non-persistent) and feature (compressed references (cr) or non-compressed references (non-cr))."},{"location":"xshareclasses/#mprotect","title":"mprotect","text":"AIX, z/OS 31-bit:
-Xshareclasses:mprotect=[default|all|none]\n

Linux, Windows, macOS:

-Xshareclasses:mprotect=[default|all|partialpagesonstartup|onfind|nopartialpages|none]\n

where:

Note: Specifying all has a negative impact on performance. You should specify all only for problem diagnosis and not for production. Specifying values partialpagesonstartup or onfind can also have a negative impact on performance when the cache is being populated. There is no further impact when the cache is full or no longer being modified.

"},{"location":"xshareclasses/#modified","title":"modified","text":"
    -Xshareclasses:modified=<modified_context>\n
Used when a JVMTI agent is installed that might modify bytecode at run time. If you do not specify this suboption and a bytecode modification agent is installed, classes are safely shared with an extra performance cost. The <modified context> is a descriptor that is chosen by the user; for example, myModification1. This option partitions the cache so that only VMs that are using context myModification1 can share the same classes. So if, for example, you run an application with a modification context and then run it again with a different modification context, all classes are stored twice in the cache. For more information, see Sharing modified bytecode. If you are migrating from IBM\u00ae SDK, Java Technology Edition, Version 7, or earlier releases, you must set -Xshareclasses:disableBCI when you use this option to retain the same behavior."},{"location":"xshareclasses/#name","title":"name","text":"
    -Xshareclasses:name=<name>\n
Connects to a cache of a given name, creating the cache if it does not exist. This option is also used to indicate the cache that is to be modified by cache utilities; for example, destroy. Use the listAllCaches utility to show which named caches are currently available. If you do not specify a name, the default name \"sharedcc_%u\" is used. \"%u\" in the cache name inserts the current user name. On operating systems other than Windows, you can specify \"%g\" in the cache name to insert the current group name. Note: It is good practice to explicitly specify a cache for your application. This avoids the application sharing a cache that is enabled by default or with another application that doesn't set a name, and ensures that the size of your application cache can be set appropriately and that cache space is used exclusively for your application. Note that you cannot change the size of a default cache that already exists by using the -Xscmx option, as that option has no effect on a pre-existing cache. See Class data sharing: Best practices for using -Xshareclasses."},{"location":"xshareclasses/#noaot","title":"noaot","text":"
    -Xshareclasses:noaot\n
Disables caching and loading of AOT code. AOT code already in the shared data cache can be loaded."},{"location":"xshareclasses/#nobootclasspath","title":"noBootclasspath","text":"
    -Xshareclasses:noBootclasspath\n
Disables the storage of classes that are loaded by the bootstrap class loader in the shared classes cache. Often used with the SharedClassURLFilter API to control exactly which classes are cached. For more information about shared class filtering, see The Java shared classes Helper API."},{"location":"xshareclasses/#notimestampchecks","title":"noTimestampChecks","text":"
    -Xshareclasses:noTimestampChecks\n
Turns off timestamp checking when finding classes in the shared cache. Use this option only when you know there are no updates to the classes from the class paths or module paths in your application. Otherwise, obsolete classes might be loaded from the shared cache. If this happens, remove the noTimestampChecks option."},{"location":"xshareclasses/#nocheckurltimestamps","title":"nocheckURLTimestamps","text":"
    -Xshareclasses:nocheckURLTimestamps\n
Timestamps of jar or zip files are checked only when they are added to a class loader and used for the first time to look up a class. This is the default behavior, which can improve the performance of class loading from the shared classes cache, especially on Windows systems. To revert to the behavior of the shared classes cache in earlier releases, use the CheckURLTimeStamps suboption. Restriction: When the nocheckURLTimestamps suboption is used (default), if jar or zip files are updated after a class loader starts loading classes from them, an older version of the class might be loaded from the shared classes cache. If this scenario occurs, use the checkURLTimestamps option."},{"location":"xshareclasses/#nojitdata","title":"nojitdata","text":"
    -Xshareclasses:nojitdata\n
Disables caching of JIT data. JIT data already in the shared data cache can be loaded."},{"location":"xshareclasses/#none","title":"none","text":"
    -Xshareclasses:none\n
Added to the end of a command line, disables class data sharing. This suboption overrides class sharing arguments found earlier on the command line. This suboption disables the shared class utility APIs. To disable class data sharing without disabling the utility APIs, use the utilities suboption. For more information about the shared class utility APIs, see The Java shared classes utility API."},{"location":"xshareclasses/#nonfatal","title":"nonfatal","text":"
    -Xshareclasses:nonfatal\n
Allows the VM to start, in most cases, even if class data sharing fails. Normal behavior for the VM is to refuse to start if class data sharing fails. If you select nonfatal and the shared classes cache fails to initialize, the VM attempts to connect to the cache in read-only mode. If this attempt fails, the VM starts without class data sharing. See also fatal. Note: Unless it is important that your application runs with class data sharing, it is good practice to set this parameter. See Creating a shared classes cache. However, cache corruption as a result of a bug in the operating system, VM, or user code might not be detected when opening the cache. In this situation, the cache is used and the application might crash."},{"location":"xshareclasses/#nonpersistent","title":"nonpersistent","text":"
    -Xshareclasses:nonpersistent\n
Uses a non-persistent cache. The cache is lost when the operating system shuts down. Non-persistent and persistent caches can have the same name. On Linux, macOS, and Windows systems, you must always use the nonpersistent suboption when you run utilities such as destroy on a non-persistent cache. Note: On macOS systems, you must set kern.sysv.shmmax and kern.sysv.shmall when using a non-persistent cache."},{"location":"xshareclasses/#nopersistentdiskspacecheck","title":"noPersistentDiskSpaceCheck","text":"
    -Xshareclasses:noPersistentDiskSpaceCheck\n
Instructs the VM not to check for available storage on the file system before creating a persistent shared classes cache. This option prevents an error on file systems that do not support the checking of free space, where a value of 0 is returned and a shared cache cannot be created. Regardless of whether you choose to set this option, if there isn't enough disk space available when the VM writes to the shared cache memory, a SIGBUS or SIGSEGV signal occurs and the VM ends. If you are using the readonly suboption, the VM does not check the available disk space, so you do not need to set the noPersistentDiskSpaceCheck suboption."},{"location":"xshareclasses/#persistent","title":"persistent","text":"
    -Xshareclasses:persistent\n
Uses a persistent cache. The cache is created on disk, which persists beyond operating system restarts. Non-persistent and persistent caches can have the same name. On z/OS, you must always use the persistent suboption when you run utilities such as destroy on a persistent cache. Notes: "},{"location":"xshareclasses/#printallstats-cache-utility","title":"printAllStats (Cache utility)","text":"
    -Xshareclasses:printAllStats\n
Displays detailed information about the contents of the cache that is specified in the name suboption. If the name is not specified, statistics are displayed about the default cache. For layered caches, information is shown for all layers (to see information for the top layer cache only, use printTopLayerStats=all). Every class is listed in chronological order with a reference to the location from which it was loaded. For more information, see Shared classes cache diagnostic utilities."},{"location":"xshareclasses/#printstats-cache-utility","title":"printStats (Cache utility)","text":"
    -Xshareclasses:printStats=<data_type>[+<data_type>]\n
Displays summary information for the cache that is specified by the name, cacheDir, and nonpersistent suboptions. For layered caches, information is shown for all layers (to see information for the top layer cache only, use printTopLayerStats). The most useful information that is displayed is how full the cache is and how many classes it contains. Stale classes are classes that are updated on the file system and which the cache has therefore marked as \"stale\". Stale classes are not purged from the cache and can be reused. Use the printStats=stale option to list all the stale entries and stale bytes. Specify one or more data types, which are separated by a plus symbol (+), to see more detailed information about the cache content. Data types include AOT data, class paths, and ROMMethods. For more information and for a full list of data types, see Shared classes cache diagnostic utilities."},{"location":"xshareclasses/#printtoplayerstats-cache-utility","title":"printTopLayerStats (Cache utility)","text":"
    -Xshareclasses:printTopLayerStats=<data_type>[+<data_type>]\n
Equivalent to printStats but for the top layer cache only. For more information about layered caches, see Creating a layer cache."},{"location":"xshareclasses/#readonly","title":"readonly","text":"
    -Xshareclasses:readonly\n
By default, a shared classes cache is created with read/write access. Use the readonly suboption to open an existing cache with read-only permissions. Opening a cache read-only prevents the VM from making any updates to the cache. If you specify this suboption, the VM can connect to caches that were created by other users or groups without requiring write access. On AIX, Linux, and macOS systems, this access is permitted only if the cache was created by using the -Xshareclasses:cacheDir option to specify a directory with appropriate permissions. If you do not use the -Xshareclasses:cacheDir option, the cache is created with default permissions, which do not permit access by other users or groups. By default, this suboption is not specified. The -Xshareclasses:readonly option is ignored under the following conditions:

If a persistent shared classes cache is started under the mentioned conditions, the cache startup creates a temporary new (writable) top layer. The JITServer AOT cache uses the new top layer to store a small amount of metadata that the cache needs to function. With this top layer, the JITServer AOT cache can be used without modifying the existing layers.

"},{"location":"xshareclasses/#reset","title":"reset","text":"
    -Xshareclasses:reset\n
Causes a cache to be destroyed and then re-created when the VM starts up. This option can be added to the end of a command line as -Xshareclasses:reset."},{"location":"xshareclasses/#restorefromsnapshot-cache-utility","title":"restoreFromSnapshot (Cache utility)","text":"(Not Windows)
-Xshareclasses:restoreFromSnapshot\n

Restores a new non-persistent shared cache from a snapshot file. The snapshot and shared cache have the same name and location, as specified by the name and cacheDir suboptions. The non-persistent cache cannot already exist when the snapshot is restored. Restoring a snapshot does not remove the snapshot file; it can be restored multiple times. On platforms that support persistent caches, the nonpersistent suboption must be specified in order to restore a snapshot.

"},{"location":"xshareclasses/#restrictclasspaths","title":"restrictClasspaths","text":"
    -Xshareclasses:restrictClasspaths\n
Allows only the first VM that is initializing a shared cache to store classpaths in the cache. Subsequent VMs are not allowed to store classpaths in the cache unless the allowClasspaths option is specified. Use the restrictClasspaths option only if the application is designed to create class loaders of type java.net.URLClassloader or its subclass, such that their classpaths are unique to the instance of the application, but the classes that are loaded from these classpaths are the same. In such cases application classpaths that are stored by one VM cannot be used by another VM.

For example, consider two VMs, VM1 and VM2, that are using class paths CP1 and CP2 respectively, where:

These class paths differ only by one entry, which is the tempurl. The url1, url2, url3, url4, and url5 entries never change from run to run, whereas the tempurl entry is always different. This difference means that a class that is loaded from url4 or url5, and stored into the shared cache by VM1, cannot be located by VM2. Therefore, an attempt by VM2 to load a class from url4 or url5 would cause it to store its own classpath CP2 into the shared cache, and also add new metadata for classes that are loaded from url4 or url5. Addition of such unique class paths into the shared cache is not useful. Moreover, the additional metadata might adversely affect the performance of other VMs that connect to the shared cache. Because classes loaded from url4 or url5 are not loaded from the shared cache when the tempurl differs from the original, it is good practice to put the tempurl as the last entry in the class path.

In situations such as that described in the example, the restrictClasspaths option can be used to restrict the addition of classpaths by ensuring that the first VM initializes the shared cache, and then prevents the addition of unique classpaths by subsequent VMs that attach to the shared cache. Note that use of the restrictClasspaths option in any other scenario is likely to negatively impact a VM's performance when it is using an existing cache.

"},{"location":"xshareclasses/#revalidateaotmethods-cache-utility","title":"revalidateAotMethods (Cache utility)","text":"
    -Xshareclasses:revalidateAotMethods=<method_specification>\n    -Xshareclasses:revalidateAotMethods=help\n
Modify the shared cache to revalidate the AOT methods that match the method specifications. Use this suboption to revalidate AOT methods that were invalidated by using the invalidateAotMethods suboption. Revalidated AOT methods are then eligible for loading into a VM, but do not affect VMs where the methods have already been processed. To learn more about the syntax to use for <method_specification>, including how to specify more than one method, see Method specification syntax."},{"location":"xshareclasses/#silent","title":"silent","text":"
    -Xshareclasses:silent\n
Disables all shared class messages, including error messages. Unrecoverable error messages, which prevent the VM from initializing, are displayed."},{"location":"xshareclasses/#snapshotcache-cache-utility","title":"snapshotCache (Cache utility)","text":"(Not Windows)
-Xshareclasses:snapshotCache\n

Creates a snapshot file of an existing non-persistent shared cache. The snapshot has the same name and location as the shared cache, as specified by the name and cacheDir suboptions. The shared cache can be in use when the snapshot is taken, but VMs are blocked when they try to write to the shared cache, while the cache data is copied to the file.

Typically, after a system is reinitialized, the snapshot file is used to restore the copy of the non-persistent cache into shared memory, via the restoreFromSnapshot suboption. Since this process removes all non-persistent caches from shared memory, restoring the cache from the snapshot file can result in better VM startup performance, because the contents of the shared cache, including classes and AOT code, do not have to be re-created.

A snapshot can be created only if the user has sufficient permissions to create the destination snapshot file. If a snapshot of the same name exists already, it is overwritten. On platforms that support persistent caches, the nonpersistent suboption must be specified in order to create a snapshot. For information about removing snapshot files, see the destroySnapshot and destroyAllSnapshots suboptions.

"},{"location":"xshareclasses/#utilities","title":"utilities","text":"
    -Xshareclasses:utilities\n
Can be added to the end of a command line to disable class data sharing. This suboption overrides class sharing arguments found earlier on the command line. This suboption is like none, but does not disable the shared class utility APIs. For more information, see The Java shared classes utility API."},{"location":"xshareclasses/#verbose","title":"verbose","text":"
    -Xshareclasses:verbose\n
Gives detailed output on the cache I/O activity, listing information about classes that are stored and found. Each class loader is given a unique ID (the bootstrap loader is always 0) and the output shows the class loader hierarchy at work, where class loaders ask their parents for a class if they can't find it themselves. It is typical to see many failed requests; this behavior is expected for the class loader hierarchy. The standard option -verbose:class also enables class sharing verbose output if class sharing is enabled."},{"location":"xshareclasses/#verboseaot","title":"verboseAOT","text":"
    -Xshareclasses:verboseAOT\n
Enables verbose output when compiled AOT code is being found or stored in the cache. AOT code is generated heuristically. You might not see any AOT code that is generated at all for a small application. You can disable AOT caching by using the noaot suboption. See the VM Messages Guide for a list of the messages produced."},{"location":"xshareclasses/#verbosehelper","title":"verboseHelper","text":"
    -Xshareclasses:verboseHelper\n
Enables verbose output for the Java Helper API. This output shows you how the Helper API is used by your class loader."},{"location":"xshareclasses/#verboseio","title":"verboseIO","text":"
    -Xshareclasses:verboseIO\n
Gives detailed output on the cache I/O activity, listing information about classes that are stored and found. Each class loader is given a unique ID (the bootstrap loader is always 0) and the output shows the class loader hierarchy at work, where class loaders must ask their parents for a class before they can load it themselves. It is typical to see many failed requests; this behavior is expected for the class loader hierarchy."},{"location":"xshareclasses/#method-specification-syntax","title":"Method specification syntax","text":"

The following examples show how to specify more than one method specification when you are using the findAotMethods, invalidateAotMethods, or revalidateAotMethods suboptions.

Each method specification is defined as follows:

<packagename>/<classname>[.<methodname>[(<parameters>)]]\n

If you want to include more than one method specification in a single option, separate the specifications with a comma and enclose all the specifications in {braces}. For example:

{<packagename/classname>}[.{<methodname>}[({<parameters>})]]\n

If you want to specify parameters to distinguish between methods, you can use -Xshareclasses:findAotMethods=* (with a wildcard) to list all the parameter variations. Copy the signature for the method that you want from the output. For example, the signature for the parameters

(byte[] bytes, int offset, int length, Charset charset)\n

is

([BIILjava/nio/charset/Charset;)\n

Here are some examples:

Method signature Matches... * All AOT methods. java/lang/Object All AOT methods in the java.lang.Object class java/util/* All AOT classes and methods in the java.util package java/util/HashMap.putVal All putVal methods in the java.util.HashMap class java/util/HashMap.hash(Ljava/lang/Object;) The private java.util.HashMap.hash(java.lang.Object) method *.equals All equals methods in all classes {java/lang/Object,!java/lang/Object.clone} All methods in java.lang.Object except clone {java/util/*.*(),java/lang/Object.*(*)} All classes or methods with no input parameter in the java.util package, and all methods in java.lang.Object {java/util/*.*(),!java/util/*.*()} Nothing. "},{"location":"xshareclassesdisableonrestore/","title":"-Xshareclasses:disableOnRestore","text":""},{"location":"xshareclassesdisableonrestore/#-xshareclassesdisableonrestore","title":"-Xshareclasses:disableOnRestore","text":"

(Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), Linux on AArch64, and Linux on IBM Z\u00ae only)

The -Xshareclasses option is an existing option and disableOnRestore is its new parameter that can be used if the CRIU feature is available. This option is disabled by default.

Restrictions:

"},{"location":"xshareclassesdisableonrestore/#parameters","title":"Parameters","text":""},{"location":"xshareclassesdisableonrestore/#disableonrestore","title":"disableOnRestore","text":"
    -Xshareclasses:disableOnRestore\n

The -Xshareclasses:disableOnRestore option disables further use of the shared classes cache (SCC) on restore. You can still use the shared classes utility APIs, for example, to obtain metrics about the shared cache.

The -Xshareclasses:disableOnRestore option is similar to the existing -Xshareclasses:none option but with the following differences:

"},{"location":"xshareclassesdisableonrestore/#see-also","title":"See also","text":""},{"location":"xsigcatch/","title":"-Xnosigcatch","text":""},{"location":"xsigcatch/#-xsigcatch-xnosigcatch","title":"-Xsigcatch / -Xnosigcatch","text":"

These options enable or disable VM signal handling code.

"},{"location":"xsigcatch/#syntax","title":"Syntax","text":"Setting Effect Default -Xsigcatch Enable yes -Xnosigcatch Disable"},{"location":"xsigcatch/#see-also","title":"See also","text":""},{"location":"xsigchain/","title":"-Xnosigchain","text":""},{"location":"xsigchain/#-xsigchain-xnosigchain","title":"-Xsigchain / -Xnosigchain","text":"

These options enable or disable signal handler chaining.

"},{"location":"xsigchain/#syntax","title":"Syntax","text":"Setting Effect Default -Xsigchain Enable yes (except on z/OS\u00ae) -Xnosigchain Disable"},{"location":"xsigchain/#see-also","title":"See also","text":""},{"location":"xsignal/","title":"-Xsignal","text":""},{"location":"xsignal/#-xsignal","title":"-Xsignal","text":"

(z/OS\u00ae only)

This option controls the behavior of Eclipse OpenJ9\u2122 VM signal handlers.

"},{"location":"xsignal/#syntax","title":"Syntax","text":"
    -Xsignal:<parameter>=<value>\n
"},{"location":"xsignal/#parameters","title":"Parameters","text":"

Restriction: You cannot use these parameters together.

"},{"location":"xsignal/#posixsignalhandler","title":"posixSignalHandler","text":"
    -Xsignal:posixSignalHandler=cooperativeShutdown\n

When the VM signal handlers for SIGSEGV, SIGILL, SIGBUS, SIGFPE, SIGTRAP, and SIGABRT end a process, they call exit(), by default. In this case, the z/OS\u2122 Language Environment\u00ae is not aware that the VM ended abnormally.

With -Xsignal:posixSignalHandler=cooperativeShutdown, the VM no longer uses exit() to end the process from the signal handlers. Instead, the VM behaves in one of the following ways:

Language Environment detects that the VM is ending abnormally and initiates Resource Recovery Services.

"},{"location":"xsignal/#userconditionhandler","title":"userConditionHandler","text":"(31-bit z/OS only)
-Xsignal:userConditionHandler=percolate\n

This option results in similar behavior to the -XCEEHDLR option: the VM registers user condition handlers to handle the z/OS exceptions that would otherwise be handled by the VM POSIX signal handlers for the SIGBUS, SIGFPE, SIGILL, SIGSEGV, and SIGTRAP signals.

As with the -XCEEHDLR option, the VM does not install POSIX signal handlers for these signals.

This option differs from the -XCEEHDLR option in that the VM percolates all Language Environment\u00ae conditions that were not triggered and expected by the VM during normal running, including conditions that are severity 2 or greater. The VM generates its own diagnostic information before percolating severity 2 or greater conditions.

The VM is in an undefined state after percolating a severity 2 or greater condition. Applications cannot resume running then call back into, or return to, the VM.

"},{"location":"xsignal/#see-also","title":"See also","text":""},{"location":"xsoftmx/","title":"-Xsoftmx","text":""},{"location":"xsoftmx/#-xsoftmx","title":"-Xsoftmx","text":"

This option sets a \"soft\" maximum limit for the Java\u2122 heap.

"},{"location":"xsoftmx/#syntax","title":"Syntax","text":"
    -Xsoftmx<size>\n
"},{"location":"xsoftmx/#explanation","title":"Explanation","text":"

Use the -Xmx option to set a \"hard\" limit for the maximum size of the heap. By default, -Xsoftmx is set to the same value as -Xmx. The value of -Xms must be less than, or equal to, the value of -Xsoftmx.

See Using -X command-line options for more information about the <size> parameter.

You can set this option on the command line, then modify it at run time by using the MemoryMXBean.setMaxHeapSize() method in the com.ibm.lang.management API. By using this API, Java applications can dynamically monitor and adjust the heap size as required. This function can be useful in virtualized or cloud environments, for example, where the available memory might change dynamically to meet business needs. When you use the API, you must specify the value in bytes, such as 2147483648 instead of 2g.

For example, you might set the initial heap size to 1 GB and the maximum heap size to 8 GB. You might set a smaller value, such as 2 GB, for -Xsoftmx, to limit the heap size that is used initially:

-Xms1g -Xsoftmx2g -Xmx8g\n

You can then use the com.ibm.lang.management API from within a Java application to increase the -Xsoftmx value during run time, as load increases. This change allows the application to use more memory than you specified initially.

If you reduce the -Xsoftmx value, the garbage collector attempts to respect the new limit. However, the ability to shrink the heap depends on a number of factors. There is no guarantee that a decrease in the heap size will occur. If or when the heap shrinks to less than the new limit, the heap will not grow beyond that limit.

When the heap shrinks, the garbage collector might release memory. The ability of the operating system to reclaim and use this memory varies based on the capabilities of the operating system.

Notes:

"},{"location":"xsoftrefthreshold/","title":"-Xsoftrefthreshold","text":""},{"location":"xsoftrefthreshold/#-xsoftrefthreshold","title":"-Xsoftrefthreshold","text":"

Sets the value used by the garbage collector to determine the number of garbage collection (GC) cycles after which a soft reference is cleared if its referent has not been marked.

"},{"location":"xsoftrefthreshold/#syntax","title":"Syntax","text":"
    -Xsoftrefthreshold<value>\n
"},{"location":"xsoftrefthreshold/#default-behavior","title":"Default behavior","text":"

The default value is 32.

This option can be used with all Eclipse OpenJ9\u2122 GC policies.

"},{"location":"xsoftrefthreshold/#explanation","title":"Explanation","text":"

A soft reference (where its referent is not marked) is cleared after a number of GC cycles, which is calculated as: <value> * (proportion of free heap space)

For example, if -Xsoftrefthreshold is set to 32, and the heap is 25% free, soft references are cleared after 8 GC cycles.

"},{"location":"xss/","title":"-Xiss","text":""},{"location":"xss/#-xiss-xss-xssi","title":"-Xiss / -Xss / -Xssi","text":"

Sets the stack size and increment for Java\u2122 threads.

If you exceed the maximum Java thread stack size, a java/lang/OutOfMemoryError message is reported.

You can use the -verbose:sizes option to find out the values that the VM is currently using.

Note: Java methods and native methods run on two different stacks and the VM handles switching between them for JNI calls. Each stack is sized using separate options; these options apply to the Java stack only. For the native stack option, see the link in the See also section.

"},{"location":"xss/#syntax","title":"Syntax","text":"Setting Effect Default -Xiss<size> Set initial Java thread stack size 2 KB -Xss<size> Set maximum Java thread stack size 320 KB (31/32-bit); 1024 KB (64-bit) -Xssi<size> Set Java thread stack size increment 16 KB

See Using -X command-line options for more information about the <size> parameter.

See Default settings for the Eclipse OpenJ9\u2122 VM for more about default values.

"},{"location":"xss/#see-also","title":"See also","text":""},{"location":"xsyslog/","title":"-Xsyslog","text":""},{"location":"xsyslog/#-xsyslog","title":"-Xsyslog","text":"

Enables operating system message logging.

Notes:

"},{"location":"xsyslog/#syntax","title":"Syntax","text":"
    -Xsyslog:<parameter>{,<parameter>}\n
"},{"location":"xsyslog/#parameters","title":"Parameters","text":"

Restriction: The parameters all, none and help must be used on their own and cannot be combined. However, the other parameters can be grouped. For example, to include error, vital and warning messages use -Xsyslog:error,vital,warn.

For message details see OpenJ9 VM messages.

"},{"location":"xsyslog/#help","title":"help","text":"
    -Xsyslog:help\n
Gives details the available parameters. (This parameter cannot be combined with others.)"},{"location":"xsyslog/#error","title":"error","text":"
    -Xsyslog:error\n
Turns on logging for all OpenJ9 VM error messages (default)."},{"location":"xsyslog/#vital","title":"vital","text":"
    -Xsyslog:vital\n
Turns on logging for selected information messages JVMDUMP006I, JVMDUMP032I, and JVMDUMP033I, which provide valuable additional information about dumps produced by the OpenJ9 VM (default)."},{"location":"xsyslog/#info","title":"info","text":"
    -Xsyslog:info\n
Turns on logging for all OpenJ9 VM information messages."},{"location":"xsyslog/#warn","title":"warn","text":"
    -Xsyslog:warn\n
Turns on logging for all OpenJ9 VM warning messages."},{"location":"xsyslog/#config","title":"config","text":"
    -Xsyslog:config\n
Turns on logging for all OpenJ9 VM configuration messages."},{"location":"xsyslog/#all","title":"all","text":"
    -Xsyslog:all\n
Turns on logging for all OpenJ9 VM messages. (This parameter cannot be combined with others.)"},{"location":"xsyslog/#none","title":"none","text":"
    -Xsyslog:none\n
Turns off logging for all OpenJ9 VM messages. (This parameter cannot be combined with others.)"},{"location":"xtgc/","title":"-Xtgc","text":""},{"location":"xtgc/#-xtgc","title":"-Xtgc","text":"

Provides garbage collection tracing options.

"},{"location":"xtgc/#syntax","title":"Syntax","text":"
    -Xtgc:<parameter>{,<parameter>}\n
"},{"location":"xtgc/#parameters","title":"Parameters","text":"Specify one one or more of the following parameters in a comma-separated list:"},{"location":"xtgc/#allocation","title":"allocation","text":"
    -Xtgc:allocation\n
Prints both per thread (TLH) and cumulative allocation cache statistics, such as total bytes allocated since last GC, current TLH sizing, and discarded TLH size.

For more information about the allocation cache, see Allocation caches.

"},{"location":"xtgc/#backtrace","title":"backtrace","text":"
    -Xtgc:backtrace\n
Before a garbage collection, a single line is printed containing the name of the main thread for garbage collection, as well as the value of the osThread slot in the J9VMThread structure."},{"location":"xtgc/#compaction","title":"compaction","text":"
    -Xtgc:compaction\n
Prints extra information showing the relative time spent by threads in the \"move\" and \"fixup\" phases of compaction"},{"location":"xtgc/#concurrent","title":"concurrent","text":"
    -Xtgc:concurrent\n
Prints extra information showing the activity of the concurrent mark background thread"},{"location":"xtgc/#dump","title":"dump","text":"
    -Xtgc:dump\n
Prints a line of output for every free chunk of memory in the system, including \"dark matter\" (free chunks that are not on the free list for some reason, typically because they are too small). Each line contains the base address and the size in bytes of the chunk. If the chunk is followed in the heap by an object, the size and class name of the object is also printed. This argument has a similar effect to the terse argument."},{"location":"xtgc/#file","title":"file","text":"
    -Xtgc:file=<filename>\n
Directs the logs to a file. Otherwise they are directed to stderr."},{"location":"xtgc/#freelist","title":"freeList","text":"
    -Xtgc:freeList\n
Before a garbage collection, prints information about the free list and allocation statistics since the last garbage collection. Prints the number of items on the free list, including \"deferred\" entries (with the scavenger, the unused space is a deferred free list entry). For TLH and non-TLH allocations, prints the total number of allocations, the average allocation size, and the total number of bytes discarded during allocation. For non-TLH allocations, also included is the average number of entries that were searched before a sufficiently large entry was found."},{"location":"xtgc/#parallel","title":"parallel","text":"
    -Xtgc:parallel\n
Produces statistics on the activity of the parallel threads during each operation (mark, sweep, scavenge etc.) of a GC cycle."},{"location":"xtgc/#rootscantime","title":"rootscantime","text":"
    -Xtgc:rootscantime\n
Prints duration of strong and weak roots scanning of a GC cycle."},{"location":"xtgc/#scavenger","title":"scavenger","text":"
    -Xtgc:scavenger\n
Prints extra information after each scavenger collection. A histogram is produced showing the number of instances of each class, and their relative ages, present in the survivor space. The information is obtained by performing a linear walk-through of the space."},{"location":"xtgc/#terse","title":"terse","text":"
    -Xtgc:terse\n
Dumps the contents of the entire heap before and after a garbage collection. For each object or free chunk in the heap, a line of trace output is produced. Each line contains the base address, \"a\" if it is an allocated object, and \"f\" if it is a free chunk, the size of the chunk in bytes, and, if it is an object, its class name."},{"location":"xthr/","title":"-Xthr","text":""},{"location":"xthr/#-xthr","title":"-Xthr","text":""},{"location":"xthr/#syntax","title":"Syntax","text":"
    -Xthr:<parameter>\n
"},{"location":"xthr/#parameters","title":"Parameters","text":""},{"location":"xthr/#adaptspin-noadaptspin","title":"AdaptSpin | noAdaptSpin","text":"
    -Xthr:AdaptSpin\n    -Xthr:noAdaptSpin\n
This tuning option is available to test whether performance optimizations are negatively impacting an application."},{"location":"xthr/#fastnotify-nofastnotify","title":"fastNotify | noFastNotify","text":"
    -Xthr:fastNotify\n    -Xthr:noFastNotify\n
When a large number of threads try to acquire a Java\u2122 monitor, throughput of an application can be reduced. This issue is known as high contention. If high contention occurs when the Java wait and notify features are regularly used, you can use -Xthr:fastNotify to increase throughput. However, -Xthr:noFastNotify is the default setting, because it is faster in all other scenarios."},{"location":"xthr/#cfsyield-nocfsyield-linux-only","title":"cfsYield | noCfsYield (Linux\u00ae only)","text":"
    -Xthr:cfsYield\n    -Xthr:noCfsYield\n
The default value, cfsYield, enables threading optimizations for running on Linux with the Completely Fair Scheduler (CFS) in the default mode (sched_compat_yield=0). The noCfsYield value disables these threading optimizations. You might want to use the noCfsYield value if your application uses the Thread.yield() method extensively, because otherwise you might see a performance decrease in cases where yielding is not beneficial."},{"location":"xthr/#minimizeusercpu","title":"minimizeUserCPU","text":"
    -Xthr:minimizeUserCPU\n
Minimizes user-mode CPU usage in thread synchronization where possible. The reduction in CPU usage might be a trade-off in exchange for decreased performance."},{"location":"xthr/#secondaryspinforobjectmonitors-nosecondaryspinforobjectmonitors","title":"secondarySpinForObjectMonitors | noSecondarySpinForObjectMonitors","text":"
    -Xthr:secondarySpinForObjectMonitors\n    -Xthr:noSecondarySpinForObjectMonitors\n
This tuning option is available to test whether performance optimizations are negatively impacting an application."},{"location":"xtlhprefetch/","title":"-XtlhPrefetch","text":""},{"location":"xtlhprefetch/#-xtlhprefetch","title":"-XtlhPrefetch","text":"

(AIX\u00ae, Windows\u2122 only)

Speculatively prefetches bytes in the thread local heap (TLH) ahead of the current allocation pointer during object allocation. This option helps reduce the performance cost of subsequent allocations.

"},{"location":"xtlhprefetch/#syntax","title":"Syntax","text":"
    -XtlhPrefetch\n

This option can be used with all Eclipse OpenJ9\u2122 GC policies.

"},{"location":"xtrace/","title":"-Xtrace","text":""},{"location":"xtrace/#-xtrace","title":"-Xtrace","text":"

Eclipse OpenJ9\u2122 VM tracing is a powerful feature to help you diagnose problems with minimal effect on performance. Tracing is enabled by default, together with a small set of trace points going to memory buffers. You can enable tracepoints at run time by using levels, components, group names, or individual tracepoint identifiers to trace VM internal operations and instrumented Java\u2122 applications. You can also trace Java methods. See the About trace section that follows for more detail.

Trace data can be output in human-readable or in compressed binary formats. The VM provides a tool to process and convert the compressed binary data into a readable format. See Trace formatter.

Note: You can also control trace by using the com.ibm.jvm.Trace API or by using JVMTI from an external agent.

"},{"location":"xtrace/#xtrace-option-builder","title":"Xtrace Option Builder","text":"

Use the Xtrace Option Builder tool to help you specify the correct options and avoid incompatibilities.

"},{"location":"xtrace/#syntax","title":"Syntax","text":"
-Xtrace:<parameter>\n

You can get help with -Xtraceby using the following options:

"},{"location":"xtrace/#configuring-trace","title":"Configuring trace","text":"

The following parameters can be used to configure trace. (Follow links for more information about individual options.)

Command Result -Xtrace:properties[=<filename>] Configures trace options based on a file -Xtrace:buffers=<size>[dynamic\\|nodynamic] Modifies the size of buffers that are used to store trace data -Xtrace:exception.output=<filename>[,<size>] Redirects exceptions trace data to a file. -Xtrace:methods=<method_specification> Traces methods -Xtrace:output=<filename>[,<size>[,<generations>]] Sends trace data to a file, optionally of a specific size and number of generations. -Xtrace:resume Resumes tracing globally. -Xtrace:resumecount=<count> Enables tracing at a thread level after a specified count. -Xtrace:sleeptime=<time> Pauses trace operations for a specified length of time. -Xtrace:stackdepth=<n> Limits the maximum number of stack frames reported by the jstacktrace trace trigger action. -Xtrace:suspend Suspends tracing globally. -Xtrace:suspendcount=<count> Suspends tracing at a thread level after a specified count. -Xtrace:trigger=<clause> Determines when various triggered trace actions occur, including turning trace on or off.

Note: If an option value contains commas, it must be enclosed in braces. For example: methods={java/lang/*,com/ibm/*}

"},{"location":"xtrace/#controlling-tracepoint-activation","title":"Controlling tracepoint activation","text":"

The following parameters can be used to control tracepoint activation. (Follow links for more information about individual options.)

Command Result -Xtrace:maximal=<tracepoint_specification> Records all associated data. -Xtrace:minimal=<tracepoint_specification> Records only the time stamp and tracepoint identifier. -Xtrace:count=<tracepoint_specification> Counts the tracepoints that are used in a trace configuration. -Xtrace:print=<tracepoint_specification> Prints the specified tracepoints to stderr in real time. -Xtrace:iprint=<tracepoint_specification> Prints the specified tracepoints to stderr in real time with indentation. -Xtrace:exception=<tracepoint_specification> Enables exception tracing. -Xtrace:external<tracepoint_specification> Routes trace data to trace listeners, which are registered by using the JVMTI APIs. -Xtrace:none[=<tracepoint_specification>] Prevents the trace engine from loading if it is the only trace option specified.

Note: These options control which individual tracepoints are activated at run time and the implicit destination of the trace data. All these properties are independent of each other and can be mixed and matched in any way that you choose. For more information, see Tracepoint activation.

"},{"location":"xtrace/#about-trace","title":"About trace","text":"

With the OpenJ9 trace feature, you can trace VM internal operations, Java applications, and Java methods, or any combination of these.

VM internal operations The OpenJ9 virtual machine (VM) is extensively instrumented with tracepoints for tracing operations. Interpreting this trace data requires detailed knowledge of the VM, and is intended to diagnose VM problems. No guarantee is given that tracepoints will not vary from release to release and from platform to platform. Applications VM trace contains an application trace facility that allows tracepoints to be placed in Java code, enabling you to combine trace data with the other forms of trace. This capability is supported by the com.ibm.jvm.Trace API. Note that an instrumented Java application runs only on an OpenJ9 VM. For more information, see Application trace. Java methods Use method trace to debug and trace application code and the system classes provided with the VM. You can trace entry to and exit from Java methods run by the VM. You can select method trace by classname, method name, or both. You can also use wildcards to create complex method selections. For more information about command syntax, see methods.

Trace can produce large amounts of data in a very short time. Before running trace, think carefully about what information you need in order to solve the problem. Here are some considerations:

You must also think carefully about which components need to be traced and what level of tracing is required. For example, if you are tracing a suspected shared classes problem, it might be enough to trace all components at level 1, and j9shr at level 9, while maximal can be used to show parameters and other information for the failing component. Tracepoint components and trace levels are described in the following sections: Tracepoint specification and Trace levels.

There are two types of tracepoints inside the VM:

Trace data can be written to one of the following locations:

"},{"location":"xtrace/#default-tracing","title":"Default tracing","text":"

By default, the equivalent of the following trace command line is always available in the VM:

-Xtrace:maximal=all{level1},exception=j9mm{gclogger}\n

When startup is complete, the equivalent of the following command line is added to enable level 2 trace points:

-Xtrace:maximal=all{level2}\n

Level 2 is used for default tracing that would produce too much data during the startup of the VM. If you set other trace options on the command line, or before the VM finishes startup (through use of JVMTI or the com.ibm.jvm.Trace API), the level 2 trace points are enabled just before your trace options are processed. This behavior ensures that the default level 2 trace points do not override any changes that you specify.

The data generated by the tracepoints is continuously captured in wrapping memory buffers for each thread.

You can find tracepoint information in the following diagnostics data:

"},{"location":"xtrace/#default-memory-management-tracing","title":"Default memory management tracing","text":"

The default trace options are designed to ensure that Javadumps always contain a record of the most recent memory management history, regardless of how much work the VM has performed since the garbage collection cycle was last called.

The exception=j9mm{gclogger} clause of the default trace set specifies that a history of garbage collection cycles that have occurred in the VM is continuously recorded. The gclogger group of tracepoints in the j9mm component constitutes a set of tracepoints that record a snapshot of each garbage collection cycle. These tracepoints are recorded in their own separate buffer, called the exception buffer. The effect is that the tracepoints are not overwritten by the higher frequency tracepoints of the VM.

The GC History section of the Javadump is based on the information in the exception buffer. If a garbage collection cycle has occurred in a traced VM, the Java dump probably contains a GC History section.

"},{"location":"xtrace/#default-assertion-tracing","title":"Default assertion tracing","text":"

The VM includes assertions, implemented as special trace points. By default, internal assertions are detected and diagnostics logs are produced to help assess the error.

Assertion failures often indicate a serious problem, and the VM usually stops immediately. In these circumstances, raise an issue, including the standard error output and any diagnostic files that are produced.

When an assertion trace point is reached, a message like the following output is produced on the standard error stream:

16:43:48.671 0x10a4800    j9vm.209    *   ** ASSERTION FAILED ** at jniinv.c:251:\n((javaVM == ((void *)0)))\n

This error stream is followed with information about the diagnostic logs produced:

JVMDUMP007I JVM Requesting System Dump using 'core.20060426.124348.976.dmp'\nJVMDUMP010I System Dump written to core.20060426.124348.976.dmp\nJVMDUMP007I JVM Requesting Snap Dump using 'Snap0001.20060426.124648.976.trc'\nJVMDUMP010I Snap Dump written to Snap0001.20060426.124648.976.trc\n

Assertions are special trace points. They can be enabled or disabled by using the standard trace command-line options.

Assertion failures might occur early during VM startup, before trace is enabled. In this case, the assert message has a different format, and is not prefixed by a timestamp or thread ID. For example:

** ASSERTION FAILED ** j9vmutil.15 at thrinfo.c:371 Assert_VMUtil_true((\n  publicFlags & 0x200))\n

Assertion failures that occur early during startup cannot be disabled. These failures do not produce diagnostic dumps, and do not cause the VM to stop.

"},{"location":"xtrace/#tracepoint-activation","title":"Tracepoint activation","text":"

The options that control which individual tracepoints are activated at run time and the implicit destination of the trace data are listed under Syntax: Controlling tracepoint activation

In some cases, you must use them with other options. For example, if you specify maximal or minimal tracepoints, the trace data is put into memory buffers. If you are going to send the data to a file, you must use an output option to specify the destination file name.

With the exception of none, all options require at least one <tracepoint_specification>, which is described in the following section. Multiple statements of each type of trace are allowed and their effect is cumulative. If you want to use multiple trace options of the same name, use a properties file. (See properties.)

"},{"location":"xtrace/#tracepoint-specification","title":"Tracepoint specification","text":"

Tracepoints are enabled by specifying component and tracepoint.

If no qualifier parameters are entered, all tracepoints are enabled, except for <exception.output> trace, where the default is all {exception}.

The <tracepoint_specification> syntax can be further broken down as follows:

[!]<component>[{<group>}] or [!]<component>[{<type>}] or [!]<tracepoint_id>[,<tracepoint_id>]\n

Where:

Some tracepoints can be both an exit and an exception; that is, the function ended with an error. If you specify either exit or exception, these tracepoints are included.

Lists of Java components and tracepoint groups can be found in the tables that follow.

The following table lists the possible Java components (<component>). To include all Java components, specify all.

Component name Description avl VM AVL tree support io Class library java.io native code j9bcu VM byte code utilities j9bcverify VM byte code verification j9codertvm VM byte code run time j9dmp VM dump j9jcl VM class libraries j9jit VM JIT interface j9jni VM JNI support j9jvmti VM JVMTI support j9mm VM memory management j9prt VM port library j9scar VM class library interface j9shr VM shared classes j9trc VM trace j9util VM utilities j9vm VM general j9vmutil VM utilities j9vrb VM verbose stack walker map VM mapped memory support mt Java methods (see Note) net Class library TCP/IP networking native code pool VM storage pool support rpc VM RPC support simplepool VM storage pool support sunvmi VM class library interface

Note: When specifying the mt component you must also specify the methods option.

The following table lists all the tracepoint groups (<group>). Each group is associated with one or more Java components:

Component name or names Group name Description j9mm gclogger A set of tracepoints that record each garbage collection cycle. Equivalent to -verbose:gc output j9prt nlsmessage A set of tracepoints that record each NLS message that is issued by the VM. j9jcl, j9vm verboseclass A set of tracepoints that record each class as it is loaded. Equivalent to -verbose:class output. j9jni, j9vm checkjni A set of tracepoints that record JNI function checks. Equivalent to -Xcheck:jni output. j9vm checkmemory A set of tracepoints that record memory checks. Equivalent to -Xcheck:memory output. j9vm checkvm A set of tracepoints that record VM checks. Equivalent to -Xcheck:vm output. j9jit verbose A set of tracepoints that record JIT compiler configuration and method compilation. Equivalent to -Xjit:verbose output. mt compiledMethods A set of tracepoints that record compiled Java methods. mt nativeMethods A set of tracepoints that record Java native methods. mt staticMethods A set of tracepoints that record Java static methods.

Here are some examples:

To trace all tracepoints, specify the following command:

-Xtrace:maximal=all\n
To trace all tracepoints except **j9vrb** and **j9trc**, specify the following command:\n\n    -Xtrace:minimal={all},minimal={!j9vrb,j9trc}\n

To trace all entry and exit tracepoints in j9bcu, specify the following command:

-Xtrace:maximal={j9bcu{entry},j9bcu{exit}}\n
To trace all tracepoints in **j9mm** except tracepoints 20-30, specify the following command:\n\n    -Xtrace:maximal=j9mm,maximal=!j9mm.20-30\n

To trace tracepoints j9prt.5 through j9prt.15, specify the following command:

-Xtrace:print=j9prt.5-15\n
To trace all **j9trc** tracepoints, specify the following command:\n\n    -Xtrace:count=j9trc\n

To trace all entry and exit tracepoints, specify the following command:

-Xtrace:external={all{entry},all{exit}}\n
"},{"location":"xtrace/#trace-levels","title":"Trace levels","text":"

Tracepoints have been assigned levels 0 through 9 that are based on the importance of the tracepoint.

A level 0 tracepoint is the most important. It is reserved for extraordinary events and errors. A level 9 tracepoint is in-depth component detail. To specify a given level of tracing, the level0 through level9 keywords are used. You can abbreviate these keywords to l0 through l9. For example, if level5 is selected, all tracepoints that have levels 0 through 5 are included. Level specifications do not apply to explicit tracepoint specifications that use the TPNID keyword.

The level is provided as a modifier to a component specification, for example:

-Xtrace:maximal={all{level5}}\n

or

-Xtrace:maximal={j9mm{L2},j9trc,j9bcu{level9},all{level1}}\n

In the first example, tracepoints that have a level of 5 or less are enabled for all components. In the second example, all level 1 tracepoints are enabled. All level 2 tracepoints in j9mm are enabled. All tracepoints up to level 9 are enabled in j9bcu.

Note: The level applies only to the current component. If multiple trace selection components are found in a trace properties file, the level is reset to the default for each new component. Level specifications do not apply to explicit tracepoint specifications that use the TPNID keyword.

When the not operator is specified, the level is inverted; that is, !j9mm{level5} disables all tracepoints of level 6 or greater for the j9mm component. The following example enables trace for all components at level 9 (the default), but disables level 6 and higher for the locking component, and level 7 and higher for the storage component:

-Xtrace:print={all},print={!j9trc{l5},j9mm{l6}}\n

Here are some examples:

To count the level zero and level one tracepoints matched, specify the following command:

-Xtrace:count=all{L1}\n

To produce maximal trace of all components at level 5 and j9mm at level 9, specify the following command:

-Xtrace:maximal={all{level5},j9mm{L9}}\n

To trace all components at level 6, but do not trace j9vrb at all, and do not trace the entry and exit tracepoints in the j9trc component, specify the following command:

-Xtrace:minimal={all{l6}},minimal={!j9vrb,j9trc{entry},j9trc{exit}}\n
"},{"location":"xtrace/#parameters","title":"Parameters","text":"

Parameters to use with the -Xtrace option:

"},{"location":"xtrace/#buffers","title":"buffers","text":"

You can modify the size of the buffers to change how much diagnostic output is provided in a snap dump. This buffer is allocated for each thread that makes trace entries. The following table shows how this parameter can be set:

Command Effect -Xtrace:buffers=<size> Creates buffers of the specified <size> in k (KB) or m (MB), allocated as needed to match the rate of trace data generation to the output media. -Xtrace:buffers=<size>dynamic Creates buffers of the specified <size>, allocated as needed to match the rate of trace data generation to the output media. -Xtrace:buffers=<size>nodynamic Creates buffers of the specified <size>, with a maximum allocation of two buffers per thread.

If external trace is enabled, the number of buffers is doubled; that is, each thread allocates two or more buffers. The same buffer size is used for state and exception tracing, but, in this case, buffers are allocated globally. The default is 8 KB per thread.

The dynamic and nodynamic suboptions have meaning only when tracing to an output file.

Note: If nodynamic is specified, you might lose trace data if the volume of trace data exceeds the bandwidth of the trace output file. Message UTE115 is issued when the first trace entry is lost, and message UTE018 is issued when the VM ends.

Here are some command line examples:

To set a buffer size of 2 MB per thread, with dynamic buffering, use:

-Xtrace:buffers=2m\n

To limit each thread to 2 trace buffers, each of 128 KB:

-Xtrace:buffers={128k,nodynamic}\n
"},{"location":"xtrace/#count-tracepoint","title":"count (tracepoint)","text":"
-Xtrace:count=<tracepoint_specification>\n

For further information about <tracepoint_specification> syntax, see Tracepoint specification.

The count option requests that only a count of the selected tracepoints is kept. When the VM ends, all nonzero totals of tracepoints (sorted by tracepoint id) are written to a file, called utTrcCounters, in the current directory. This information is useful if you want to determine the overhead of particular tracepoints, but do not want to produce a large amount (GB) of trace data.

For example, to count the tracepoints that are used in the default trace configuration, use the following command:

-Xtrace:count=all{level1},count=j9mm{gclogger}\n
"},{"location":"xtrace/#exception-tracepoint","title":"exception (tracepoint)","text":"
-Xtrace:exception=<tracepoint_specification>\n

For further information about <tracepoint_specification> syntax, see Tracepoint specification.

When exception trace is enabled, the trace data is collected in internal buffers that are separate from the normal buffers. These internal buffers can then be written to a snap file or written to the file that is specified in an exception.output option.

The exception option allows low-volume tracing in buffers and files that are distinct from the higher-volume information that minimal and maximal tracing have provided. In most cases, this information is exception-type data, but you can use this option to capture any trace data that you want.

This form of tracing is channeled through a single set of buffers, as opposed to the buffer-per-thread approach for normal trace. Buffer contention might occur if high volumes of trace data are collected. A difference exists in the <tracepoint_specification> defaults for exception tracing; see Tracepoint specification.

Notes:

"},{"location":"xtrace/#exceptionoutput","title":"exception.output","text":"

Use exception output to redirect exceptions trace data to a file.

-Xtrace:exception.output=<filename>[,<size>]\n

Where:

Here are some examples:

Exception trace output goes to file /u/traces/exception.trc with no size limit:

-Xtrace:exception.output=/u/traces/exception.trc,maximal\n

Exception trace output goes to file except and wraps at 2 MB:

-Xtrace:exception.output={except,2m},maximal\n

Exception trace output goes to a file whose filename contains today's date in * yyyymmdd* format (for example, traceout.20181025.trc):

-Xtrace:exception.output=traceout.%d.trc,maximal\n

Exception trace output goes to a file whose filename contains the number of the process (the PID number) that generated it (for example, tracefrompid2112.trc):

-Xtrace:exception.output=tracefrompid%p.trc,maximal\n

Exception trace output goes to a file whose filename contains the time in hhmmss format (for example, traceout.080312.trc):

-Xtrace:exception.output=traceout.%t.trc,maximal\n
"},{"location":"xtrace/#external-tracepoint","title":"external (tracepoint)","text":"
-Xtrace:external<tracepoint_specification>\n

For further information about <tracepoint_specification> syntax, see Tracepoint specification.

The external option routes trace data to trace listeners, which are registered by using the JVMTI RegisterTracePointSubscriber() and DeregisterTracePointSubscriber() APIs.

"},{"location":"xtrace/#help","title":"help","text":"
-Xtrace:help\n

Displays general trace help

"},{"location":"xtrace/#iprint-tracepoint","title":"iprint (tracepoint)","text":"
-Xtrace:iprint=<tracepoint_specification>\n

For further information about <tracepoint_specification> syntax, see Tracepoint specification.

The iprint option is the same as the print option, but uses indenting to format the trace.

"},{"location":"xtrace/#maximal-tracepoint","title":"maximal (tracepoint)","text":"
-Xtrace:maximal=<tracepoint_specification>\n

For further information about <tracepoint_specification> syntax, see Tracepoint specification.

When specified, trace data is placed into internal trace buffers that can then be written to a snap file or written to the files that are specified in an output trace option. All associated data is traced.

minimal and maximal traces are independent from any types that follow them. For example, if the maximal option is specified, it does not affect a later option such as print.

"},{"location":"xtrace/#methods","title":"methods","text":"

Using method trace provides a complete and potentially large diagnosis of code paths inside your application and the system classes. Use wild cards and filtering to control method trace so that you can focus on the sections of code that interest you. Note that method trace is powerful but it also has a cost. Application throughput is affected by method trace.

To specify one or more method specifications, use the following syntax:

-Xtrace:methods=<method_specification>[,<method_specification>]\n

The syntax for <method_specification> can be further broken down to the following suboptions:

-Xtrace:methods={[!][*][<package>/]<class>[*],[[*]<method>[*]|[()]]}\n

Where:

To output all method trace information to stderr, use either the print or iprint suboptions:

-Xtrace:print=mt,methods=*.*\n-Xtrace:iprint=mt,methods=*.*\n

The iprint suboption prints to stderr with indentation. To output method trace information in binary format, see the output option

Internal Native Library (INL) native methods inside the VM cannot be traced because they are not implemented by using JNI. The list of methods that are not traceable is subject to change without notice.

Here are some examples:

Tracing entry and exit of all methods in a given class: To trace all method entry and exit of the ReaderMain class in the default package and the java.lang.String class, specify the following command:

-Xtrace:methods={ReaderMain.*,java/lang/String.*},print=mt\n

Tracing entry, exit and input parameters of all methods in a class: To trace all method entry, exit, and input of the ReaderMain class in the default package, specify the following command:

-Xtrace:methods=ReaderMain.*(),print=mt\n

Tracing all methods in a given package: To trace all method entry, exit, and input of all classes in the package com.ibm.socket, specify the following command:

-Xtrace:methods=com/ibm/socket/*.*(),print=mt\n

Multiple method trace: To trace all method entry, exit, and input in the Widget class in the default package and all method entry and exit in the common package, specify the following command:

-Xtrace:methods={Widget.*(),common/*},print=mt\n

Using the ! operator: To trace all methods in the ArticleUI class in the default package except those beginning with \"get\", specify the following command:

-Xtrace:methods={ArticleUI.*,!ArticleUI.get*},print=mt\n

Tracing a specific method in a class: This example traces entry and exit of the substring method of the java.lang.String class. If there is more than one method with the same name, they are all traced. You cannot filter method trace by the signature of the method.

-Xtrace:print=mt,methods={java/lang/String.substring}\n

Tracing the constructor of a class: This example traces entry and exit of the constructors of the java.lang.String class.

-Xtrace:print=mt,methods={java/lang/String.<init>}\n

Here is some example output:

java \"-Xtrace:methods={java/lang*.*},iprint=mt\" HW\n10:02:42.281*0x9e900      mt.4         > java/lang/J9VMInternals.initialize(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.4          > java/lang/J9VMInternals.verify(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.4           > java/lang/J9VMInternals.verify(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.4            > java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.10           < java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.10          < java/lang/J9VMInternals.verify(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.4           > java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.10          < java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.10         < java/lang/J9VMInternals.verify(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.4          > java/lang/J9VMInternals.initialize(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.281 0x9e900      mt.4           > java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.296 0x9e900      mt.10          < java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.296 0x9e900      mt.10         < java/lang/J9VMInternals.initialize(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.296 0x9e900      mt.4          > java/lang/String.<clinit>()V Compiled static method\n10:02:42.296 0x9e900      mt.4           > java/lang/J9VMInternals.initialize(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.296 0x9e900      mt.4            > java/lang/J9VMInternals.verify(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.296 0x9e900      mt.4             > java/lang/J9VMInternals.verify(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.296 0x9e900      mt.10            < java/lang/J9VMInternals.verify(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.296 0x9e900      mt.4             > java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.328 0x9e900      mt.10            < java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.328 0x9e900      mt.10           < java/lang/J9VMInternals.verify(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.328 0x9e900      mt.4            > java/lang/J9VMInternals.initialize(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.328 0x9e900      mt.10           < java/lang/J9VMInternals.initialize(Ljava/lang/Class;)\n                              V Compiled static method\n10:02:42.328 0x9e900      mt.4            > java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.328 0x9e900      mt.10           < java/lang/J9VMInternals.setInitStatus(Ljava/lang/Class;I)\n                              V Compiled static method\n10:02:42.328 0x9e900      mt.10          < java/lang/J9VMInternals.initialize(Ljava/lang/Class;)\n                              V Compiled static method\n

The output lines comprise of:

"},{"location":"xtrace/#minimal-tracepoint","title":"minimal (tracepoint)","text":"
-Xtrace:minimal=<tracepoint_specification>\n

For further information about <tracepoint_specification> syntax, see Tracepoint specification.

When specified, trace data is placed into internal trace buffers that can then be written to a snap file or written to the files that are specified in an output trace option. Only the time stamp and tracepoint identifier are recorded. When the trace is formatted, missing trace data is replaced with the characters \"???\" in the output file.

minimal and maximal traces are independent from any types that follow them. For example, if the minimal option is specified, it does not affect a later option such as print.

"},{"location":"xtrace/#none-tracepoint","title":"none (tracepoint)","text":"
-Xtrace:none[=<tracepoint_specification>]\n

For further information about <tracepoint_specification> syntax, see Tracepoint specification.

-Xtrace:none prevents the trace engine from loading if it is the only trace option specified. However, if other -Xtrace options are on the command line, it is treated as the equivalent of -Xtrace:none=all and the trace engine still loads.

If you specify other tracepoints without specifying -Xtrace:none, the tracepoints are added to the default set.

"},{"location":"xtrace/#output","title":"output","text":"

Sends trace data to a file, optionally of a specific size and number of generations.

-Xtrace:output=<filename>[,<size>[,<generations>]]`\n

Where:

Note: When tracing to a file, buffers for each thread are written when the buffer is full or when the VM ends. If a thread has been inactive for a period of time before the VM ends, what seems to be 'old' trace data is written to the file. When formatted, it then seems that trace data is missing from the other threads, but this is an unavoidable side-effect of the buffer-per-thread design. This effect becomes especially noticeable when you use the generation facility, and format individual earlier generations.

Here are some examples:

Trace output goes to file /u/traces/gc.problem with no size limit:

-Xtrace:output=/u/traces/gc.problem,maximal=j9gc\n

Trace output goes to file trace, which will wrap at 2 MB:

-Xtrace:output={trace,2m},maximal=j9gc\n

Trace output goes to files gc0.trc, gc1.trc, and gc2.trc, each 10 MB in size:

-Xtrace:output={gc#.trc,10m,3},maximal=j9gc\n

Trace output goes to a file, where the filename contains today's date in * yyyymmdd* format (for example, traceout.20181025.trc):

-Xtrace:output=traceout.%d.trc,maximal=j9gc\n

Trace output goes to a file whose name contains the number of the process (the PID number) that generated it (for example, tracefrompid2112.trc):

-Xtrace:output=tracefrompid%p.trc,maximal=j9gc\n

Trace output goes to a file whose name contains the time in hhmmss format (for example, traceout.080312.trc):

-Xtrace:output=traceout.%t.trc,maximal=j9gc\n
"},{"location":"xtrace/#print-tracepoint","title":"print (tracepoint)","text":"
-Xtrace:print=<tracepoint_specification>\n

For further information about <tracepoint_specification> syntax, see Tracepoint specification.

The print option causes the specified tracepoints to be routed to stderr in real time. The VM tracepoints are formatted by using J9TraceFormat.dat. The class library tracepoints are formatted by J9TraceFormat.dat and TraceFormat.dat.

"},{"location":"xtrace/#properties","title":"properties","text":"

You can use properties files to control trace. A properties file saves typing and allows you to create a library of files that are tailored to solving problems in a particular area.

-Xtrace:properties[=<filename>]\n

If <filename> is not specified, the VM searches for a default name of IBMTRACE.properties in the current directory.

All the options that are in the file are processed in the sequence in which they are stored in the file, before the next option that is obtained through the normal mechanism is processed. Therefore, a command-line property always overrides a property that is in the file.

Here is an example of a properties file:

minimal=all\n// maximal=j9mm\nmaximal=j9shr\nbuffers=128k,nodynamic\noutput=c:\\traces\\classloader.trc\nprint=tpnid(j9vm.23-25)\n

The following restrictions apply to the file:

If any error is found when the file is accessed, VM initialization fails with an explanatory error message and return code.

To use a file trace.props stored in the c:\\trc\\gc directory, specify the following command:

-Xtrace:properties=c:\\trc\\gc\\trace.props\n
"},{"location":"xtrace/#resume","title":"resume","text":"

The resume option resumes tracing globally.

-Xtrace:resume\n

The suspend and resume options are not recursive. That is, two suspends that are followed by a single resume cause trace to be resumed.

"},{"location":"xtrace/#resumecount","title":"resumecount","text":"

This trace option determines whether tracing is enabled for each thread.

-Xtrace:resumecount=<count>\n

If <count> is greater than zero, each thread initially has its tracing disabled and must receive <count> resumethis actions before it starts tracing. This option is used with the trigger option.

Note: You cannot use resumecount and suspendcount together because they use the same internal counter.

The following example starts with all tracing turned off. Each thread starts tracing when it has had three resumethis actions performed on it:

-Xtrace:resumecount=3\n
"},{"location":"xtrace/#sleeptime","title":"sleeptime","text":"

You can specify how long the sleep lasts when using the sleep trigger action.

-Xtrace:sleeptime=nnn|aaams|bbbs\n

Where:

The default length of time is 30 seconds. If no units are specified, the default time unit is milliseconds.

"},{"location":"xtrace/#stackdepth","title":"stackdepth","text":"

Use this option to limit the maximum number of stack frames reported by the jstacktrace trace trigger action.

-Xtrace:stackdepth=<n>\n

Where <n> is the maximum number of stack frames reported.

"},{"location":"xtrace/#suspend","title":"suspend","text":"
-Xtrace:suspend\n

Suspends tracing globally for all threads and all forms of tracing but leaves tracepoints activated.

"},{"location":"xtrace/#suspendcount","title":"suspendcount","text":"

This trace option determines whether tracing is enabled for each thread.

-Xtrace:suspendcount=<count>\n

If <count> is greater than zero, each thread initially has its tracing enabled and must receive <count> suspendthis actions before it stops tracing.

You cannot use resumecount and suspendcount together because they both set the same internal counter.

This trace option is for use with the trigger option.

The following example starts with tracing turned on. Each thread stops tracing when it has had three suspendthis actions performed on it:

-Xtrace:suspendcount=3\n
"},{"location":"xtrace/#trigger","title":"trigger","text":"

The trigger parameter determines when various triggered trace actions occur. Supported actions include turning tracing on and off for all threads, turning tracing on or off for the current thread, or producing various dumps.

-Xtrace:trigger=<clause>[,<clause>]\n

This trace option does not control what is traced. It controls only whether the information that has been selected by the other trace options is produced as normal or is blocked.

"},{"location":"xtrace/#types","title":"Types","text":"

Each clause of the trigger parameter can be one of the following types:

You can specify multiple clauses of the same type if required, but you do not need to specify all types.

method
 -Xtrace:trigger=method{<methodspec>[,<entryAction>[,<exitAction>[,<delayCount>[,<matchcount>]]]]}\n

On entering a method that matches <methodspec>, the specified <entryAction> is run. On leaving a method that matches <methodspec>, the specified <exitAction> is run. If you specify a <delayCount>, the actions are performed only after a matching <methodspec> has been entered that many times. If you specify a <matchCount>, <entryAction> and <exitAction> are performed at most that many times.

<methodspec> is the specification of a Java method, consisting of a class and a method name separated by a dot. For example, specify HelloWorld.main. If the class is in a package, the package name must be included, separated by slashes. For example, specify java/lang/String.getBytes.

A wildcard \"*\" can be used at the start or end of the class and method names, or both. For example, you can specify */String.get*. To specify a constructor method, use <init> as the method name. Method signatures cannot be specified, so a method specification applies to all overloaded methods.

tracepoint ID
 -Xtrace:trigger=tpnid{<tpnid>|<tpnidRange>,<action>[,<delayCount>[,<matchcount>]]}\n

On finding the specified active tracepoint ID (<tpnid>) or a tracepoint ID) that falls inside the specified <tpnidRange>, the specified action is run. If you specify a <delayCount>, the action is performed only after the VM finds such an active <tpnid> that many times. If you specify a <matchCount>, <action> is performed at most that many times.

group
 -Xtrace:trigger=group{<groupname>,<action>[,<delayCount>[,<matchcount>]]}\n

On finding any active tracepoint that is defined as being in trace group <groupname>, for example Entry or Exit, the specified action is run. If you specify a <delayCount>, the action is performed only after that many active tracepoints from group <groupname> have been found. If you specify a <matchCount>, <action> is performed at most that many times.

"},{"location":"xtrace/#actions","title":"Actions","text":"

Wherever an action (<action>, <entryAction>, or <exitAction>) must be specified in one of the trigger parameter clauses, you must select from these options:

<action> Effect abort Halt the VM. ceedump This action is applicable to z/OS\u00ae only. For more information, see z/OS LE CEEDUMPs. coredump Produce a system dump. See Dump agents (-Xdump:system) heapdump Produce a heap dump. See Heap dump. javadump Produce a Java dump. See Java dump. jstacktrace Examine the Java stack of the current thread and generate auxiliary tracepoints for each stack frame. The auxiliary tracepoints are written to the same destination as the tracepoint or method trace that triggered the action. You can control the number of stack frames examined with the stackdepth=n option. See the stackdepth option. resume Resume all tracing (except for threads that are suspended by the action of the resumecount property and Trace.suspendThis() calls). resumethis Decrement the suspend count for this thread. If the suspend count is zero or less, resume tracing for this thread. segv Cause a segmentation violation. (Intended for use in debugging.) sleep Delay the current thread for a length of time controlled by the sleeptime option. The default is 30 seconds. See sleeptime option. snap Snap all active trace buffers to a file in the current working directory. The file name has the format: Snapnnnn.yyyymmdd.hhmmssth.ppppp.trc, where nnnn is the sequence number of the snap file since VM startup, yyyymmdd is the date, hhmmssth is the time, and ppppp is the process ID in decimal with leading zeros removed. suspend Suspend all tracing (except for special trace points). suspendthis Increment the suspend count for this thread. If the suspend-count is greater than zero, prevent all tracing for this thread. sysdump (or coredump) Produce a system dump. See Dump agents(-Xdump:system).

Here are some examples of using the trigger option:

To produce a Java dump when a method is entered, specify the following command:

-Xtrace:trigger=method{java/lang/String.getBytes,javadump}\n

To produce a system dump when a method is entered, specify the following command:

-Xtrace:trigger=method{java/lang/String.getBytes,sysdump}\n

To produce a Java dump when a class constructor is called, specify the following command:

\"-Xtrace:trigger=method{java/lang/Thread.<init>,javadump}\"\n

Note: This trace option is enclosed in quotation marks to avoid unwanted shell expansion of some of the characters.

To produce a Java dump when a class static initializer is called, specify the following command:

\"-Xtrace:trigger=method{java/lang/Thread.<clinit>,javadump}\"\n

Note: This trace option is enclosed in quotation marks to avoid unwanted shell expansion of some of the characters.

To produce a Java dump when a method is entered 1000 times and 1001 times, specify the following command:

-Xtrace:trigger=method{java/lang/String.getBytes,javadump,,1000,2}\n

To start tracing this thread when it enters any method in java/lang/String, and to stop tracing the thread after exiting the method, specify the following command:

-Xtrace:resumecount=1\n

-Xtrace:trigger=method{java/lang/String.*,resumethis,suspendthis}

To resume all tracing when any thread enters a method in any class that starts with error, specify the following command:

-Xtrace:trigger=method{*.error*,resume}\n

To trace (all threads) while the application is active; that is, not starting or shut down. (The application name is HelloWorld), specify the following command:

-Xtrace:suspend,trigger=method{HelloWorld.main,resume,suspend}\n

To print a Java stack trace to the console when the mycomponent.1 tracepoint is reached, specify the following command:

-Xtrace:print=mycomponent.1,trigger=tpnid{mycomponent.1,jstacktrace}\n

To write a Java stack trace to the trace output file when the Sample.code() method is called, specify the following command:

-Xtrace:maximal=mt,output=trc.out,methods={mycompany/mypackage/Sample.code},trigger=method{mycompany/mypackage/Sample.code,jstacktrace}\n
"},{"location":"xtrace/#what","title":"what","text":"
-Xtrace:what\n

Shows the current trace settings

"},{"location":"xtrace/#see-also","title":"See also","text":""},{"location":"xtunevirtualized/","title":"-Xtune:virtualized","text":""},{"location":"xtunevirtualized/#-xtunevirtualized","title":"-Xtune:virtualized","text":"

Optimizes Eclipse OpenJ9\u2122 VM function for virtualized environments, such as a cloud, by reducing OpenJ9 VM CPU consumption when idle.

Note: Performance is optimized if there is a large shared classes cache (SCC) and AOT space in the SCC is not capped.

"},{"location":"xtunevirtualized/#syntax","title":"Syntax","text":"
    -Xtune:virtualized\n

This option is recommended for CPU-constrained environments, such as those found in cloud deployments that use containers. Internally, the option makes the JIT compiler more conservative with inlining and recompilation decisions, which saves CPU resources. The Garbage Collector also reduces the rate of heap expansion, which reduces the memory footprint. These changes to reduce the amount of CPU that is consumed are at the expense of a small loss in throughput.

When -Xtune:virtualized is used in conjunction with the -Xshareclasses option, the JIT compiler is more aggressive with its use of AOT-compiled code compared to setting only -Xshareclasses. This action provides additional CPU savings during application start-up and ramp-up, but comes at the expense of an additional small loss in throughput.

"},{"location":"xtunevirtualized/#see-also","title":"See also","text":""},{"location":"xverbosegclog/","title":"-Xverbosegclog","text":""},{"location":"xverbosegclog/#-xverbosegclog","title":"-Xverbosegclog","text":"

Causes garbage collection (GC) output from the -verbose:gc option to be written to a specified file.

"},{"location":"xverbosegclog/#syntax","title":"Syntax","text":"
    -Xverbosegclog[:<filename>[,<x>,<y>]]\n

where <filename> is the name of the file to which output is written. Dump agent tokens can be used in the filename.

If the file cannot be found, the file is created, and output is written to the new file.

If the file cannot be created (for example, if an invalid filename is specified), output is redirected to stderr.

If you do not specify a file name, verbosegc.%Y%m%d.%H%M%S.%pid.txt is used (for example, verbosegc.20180124.093210.1234.txt).

If you specify <x> and <y>, output is redirected to x files, each containing y GC cycles.

"},{"location":"xverbosegclog/#default-behavior","title":"Default behavior","text":"

By default, no verbose GC logging occurs.

"},{"location":"xverbosegclog/#see-also","title":"See also","text":""},{"location":"xverify/","title":"-Xverify","text":""},{"location":"xverify/#-xverify","title":"-Xverify","text":"

As described in the Oracle documentation, this HotSpot option enables or disables the verifier. For compatibility, this option is also supported by the Eclipse OpenJ9\u2122 VM.

"},{"location":"xverify/#syntax","title":"Syntax","text":"Setting Effect Default -Xverify Enables verification for all non-bootstrap classes. -Xfuture verification is not enabled. yes -Xverify:all Enables verification for all classes and enables -Xfuture verification. \u00a0 You cannot use this setting in conjunction with -XX:+ClassRelationshipVerifier. \u00a0 Note: This setting might have an impact on performance. -Xverify:remote For compatibility, this parameter is accepted, but is equivalent to the default -Xverify. -Xverify:none Disables the verifier. \u00a0 Note: This is not a supported configuration and, as noted, was deprecated from Java 13. If you encounter problems with the verifier turned off, remove this option and try to reproduce the problem.

Note: The option -Xverify:none (and its equivalent -noverify) was deprecated in Java 13. Both options might be removed in a future release. OpenJ9 issues a warning if these options are used in Java 13 and later versions.

"},{"location":"xx_jvm_commands/","title":"Using -XX options","text":""},{"location":"xx_jvm_commands/#using-xx-command-line-options","title":"Using -XX command-line options","text":"

Java\u2122 VM command-line options that are specified with -XX: are not checked for validity. If the VM does not recognize the option, the option is ignored. These options can therefore be used across different VM versions without ensuring a particular level of the VM. If you want to turn off this behavior to test whether your -XX options are valid, use the -XX:-IgnoreUnrecognizedXXColonOptions option.

For options that take a <size> parameter, add a suffix to the size value: \"k\" or \"K\" to indicate kilobytes, \"m\" or \"M\" to indicate megabytes, \"g\" or \"G\" to indicate gigabytes, or \"t\" or \"T\" to indicate terabytes.

For example, to set the -XX:MaxDirectMemorySize value to 16 MB, you can specify -XX:MaxDirectMemorySize16M, -XX:MaxDirectMemorySize16m, -XX:MaxDirectMemorySize16384K, or XX:MaxDirectMemorySize16384k on the command line.

"},{"location":"xxactiveprocessorcount/","title":"-XXActiveProcessorCount","text":""},{"location":"xxactiveprocessorcount/#-xxactiveprocessorcount","title":"-XX:ActiveProcessorCount","text":"

This HotSpot option is recognized by Eclipse OpenJ9\u2122 for compatibility. Use this option to override the number of CPUs that the VM automatically detects and uses when creating threads for various subsystems.

"},{"location":"xxactiveprocessorcount/#syntax","title":"Syntax","text":"
    -XX:ActiveProcessorCount=<n>\n

Where <n> is the number of CPUs.

Setting Value Default <n> 1 or greater There is no default value. This option is not enabled by default. If set to 0, there is no effect.

When you set this option the following line in a Java dump file is updated to indicate the number of CPUs specified:

2CIACTIVECPU Active CPUs\n

If this option is not set, the value for this line is 0 Active CPUs.

"},{"location":"xxadaptivegcthreading/","title":"-XX:[+|-]AdaptiveGCThreading","text":""},{"location":"xxadaptivegcthreading/#-xx-adaptivegcthreading","title":"-XX:[+|-]AdaptiveGCThreading","text":"

Restriction: Currently, this feature is available only with the gencon GC policy.

When this option is enabled, the active GC thread count is adjusted for each garbage collection (GC) cycle based on heuristics. That is, when a GC cycle successfully completes, the collector evaluates parallelism using aggregated thread statistics gathered during the completed cycle and projects a new thread count for the next cycle. For example, the thread count might be reduced if it is determined that an unnecessary overhead was incurred as a result of synchronization, lack of work sharing, or CPU availability. Similarly, the thread count may be increased if there's an opportunity to gain benefits from increased parallelism.

Notes:

"},{"location":"xxadaptivegcthreading/#syntax","title":"Syntax","text":"
    -XX:[+|-]AdaptiveGCThreading\n
Setting Effect Default -XX:+AdaptiveGCThreading Enable yes -XX:-AdaptiveGCThreading Disable

This optimization aims to automatically tune the GC thread count. Manually tuning and setting a thread count can be suboptimal because workloads typically change over the lifetime of an application.

You can check the active thread count value that is used by the garbage collector to complete the cycle by inspecting verbose GC output. The following example shows active thread count being reduced from 8 to 3:

<gc-end id=\"8\" type=\"scavenge\" contextid=\"4\" durationms=\"2.248\" usertimems=\"3.694\" systemtimems=\"1.345\" stalltimems=\"11.003\" timestamp=\"2021-03-12T01:35:10.768\" activeThreads=\"8\">\n<gc-end id=\"20\" type=\"scavenge\" contextid=\"16\" durationms=\"7.045\" usertimems=\"6.360\" systemtimems=\"0.955\" stalltimems=\"31.964\" timestamp=\"2021-03-12T01:35:10.777\" activeThreads=\"6\">\n<gc-end id=\"32\" type=\"scavenge\" contextid=\"28\" durationms=\"1.943\" usertimems=\"7.112\" systemtimems=\"0.454\" stalltimems=\"6.076\" timestamp=\"2021-03-12T01:35:10.781\" activeThreads=\"5\">\n<gc-end id=\"44\" type=\"scavenge\" contextid=\"40\" durationms=\"1.253\" usertimems=\"2.910\" systemtimems=\"0.297\" stalltimems=\"2.416\" timestamp=\"2021-03-12T01:35:10.788\" activeThreads=\"4\">\n<gc-end id=\"56\" type=\"scavenge\" contextid=\"52\" durationms=\"1.487\" usertimems=\"3.991\" systemtimems=\"0.447\" stalltimems=\"2.918\" timestamp=\"2021-03-12T01:35:10.790\" activeThreads=\"4\">\n<gc-end id=\"68\" type=\"scavenge\" contextid=\"64\" durationms=\"0.400\" usertimems=\"1.002\" systemtimems=\"0.178\" stalltimems=\"0.658\" timestamp=\"2021-03-12T01:35:10.791\" activeThreads=\"4\">\n<gc-end id=\"80\" type=\"scavenge\" contextid=\"76\" durationms=\"0.187\" usertimems=\"1.099\" systemtimems=\"0.127\" stalltimems=\"0.112\" timestamp=\"2021-03-12T01:35:10.792\" activeThreads=\"3\">\n<gc-end id=\"92\" type=\"scavenge\" contextid=\"88\" durationms=\"0.195\" usertimems=\"0.940\" systemtimems=\"0.114\" stalltimems=\"0.067\" timestamp=\"2021-03-12T01:35:10.796\" activeThreads=\"3\">\n<gc-end id=\"104\" type=\"scavenge\" contextid=\"100\" durationms=\"0.277\" usertimems=\"0.899\" systemtimems=\"0.118\" stalltimems=\"0.139\" timestamp=\"2021-03-12T01:35:10.797\" activeThreads=\"3\">\n
"},{"location":"xxallowvmshutdown/","title":"-XXallowvmshutdown","text":""},{"location":"xxallowvmshutdown/#-xxallowvmshutdown","title":"-XXallowvmshutdown","text":"

This option is provided as a workaround for applications that cannot shut down cleanly, as described in APAR IZ59734.

"},{"location":"xxallowvmshutdown/#syntax","title":"Syntax","text":"
    -XX:allowvmshutdown:[false|true]\n
Setting Effect Default false Disable true Enable yes"},{"location":"xxalwayspretouch/","title":"-XX:[+|-]AlwaysPreTouch","text":""},{"location":"xxalwayspretouch/#-xx-alwayspretouch","title":"-XX:[+|-]AlwaysPreTouch","text":"

This Oracle HotSpot option enables or disables the committing of memory during initial heap inflation or heap expansion.

"},{"location":"xxalwayspretouch/#syntax","title":"Syntax","text":"
    -XX:[+|-]AlwaysPreTouch\n
Setting Effect Default -XX:+AlwaysPreTouch Enable -XX:-AlwaysPreTouch Disable yes"},{"location":"xxcheckpointgcthread/","title":"-XX:CheckpointGCThreads","text":""},{"location":"xxcheckpointgcthread/#-xxcheckpointgcthreads","title":"-XX:CheckpointGCThreads","text":"

(Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), Linux on AArch64, and Linux on IBM Z\u00ae only)

At the VM startup, you can set the number of threads that the garbage collector uses for parallel operations (-Xgcthreads). At the time of taking the checkpoint, the -XX:CheckpointGCThreads option reduces the number of garbage collection (GC) threads that was set at startup.

Restrictions: This option takes effect only when -XX:+EnableCRIUSupport is enabled.

"},{"location":"xxcheckpointgcthread/#syntax","title":"Syntax","text":"
    -XX:CheckpointGCThreads=<number>\n
Setting Value Default <number> Greater than 0 and less than or equal to the number of GC threads at the VM startup 4

If the <number> is greater than the number of GC threads at startup, the VM ignores this option.

"},{"location":"xxcheckpointgcthread/#explanation","title":"Explanation","text":"

When taking a checkpoint, the VM reduces the number of GC threads that was specified at the startup and makes it equal to the thread count specified in the -XX:CheckpointGCThreads option. Since restoring threads adds latency to the overall VM restore time, you can minimize the restore time by reducing the GC thread count. After restoring from the checkpoint, the VM increases the GC thread count. The VM checks the following settings to determine the new GC thread count at the time of restore:

If you have specified the GC thread count at restore in the -Xgcthreads option and the count is greater than the checkpoint GC threads, the VM increases the thread count to the GC thread count set at restore.

If you have not specified the GC thread count in the -Xgcthreads option or if the thread count is less than the checkpoint GC threads, then the VM determines the default thread count (as explained in the -Xgcthreads topic) at restore. If the default thread count is greater than the checkpoint thread count, then the VM increases the thread count to the default thread count.

If the default thread count is lesser than the checkpoint thread count, then the thread count at restore time is same as the checkpoint thread count.

"},{"location":"xxcheckpointgcthread/#see-also","title":"See also","text":""},{"location":"xxclassrelationshipverifier/","title":"-XX:[+|-]ClassRelationshipVerifier","text":""},{"location":"xxclassrelationshipverifier/#-xx-classrelationshipverifier","title":"-XX:[+|-]ClassRelationshipVerifier","text":"

This option enables or disables the recording of class relationships in the verifier to delay validation until triggered by class loading.

Note: You cannot use this setting in conjunction with -Xfuture or -Xverify:all, which itself enables -Xfuture.

"},{"location":"xxclassrelationshipverifier/#syntax","title":"Syntax","text":"
    -XX:[+|-]ClassRelationshipVerifier\n
Setting Effect Default -XX:+ClassRelationshipVerifier Enable -XX:-ClassRelationshipVerifier Disable yes"},{"location":"xxclassrelationshipverifier/#explanation","title":"Explanation","text":"

When enabled, this option delays validating the relationships between classes until the classes are required to be loaded during program execution. In this way, classes that are not required, are never loaded thus reducing VM startup time.

A verify error is thrown if validation fails.

"},{"location":"xxcodecachetotal/","title":"-XX:codecachetotal","text":""},{"location":"xxcodecachetotal/#-xxcodecachetotal","title":"-XX:codecachetotal","text":"

This option is an alias for the -Xcodecachetotal option.

"},{"location":"xxcodecachetotal/#syntax","title":"Syntax","text":"
    -XX:codecachetotal=<size>\n
See Using -X command-line options for more information about specifying the <size> parameter."},{"location":"xxcodecachetotal/#see-also","title":"See also","text":""},{"location":"xxcodecachetotalmaxrampercentage/","title":"-XX:codecachetotalMaxRAMPercentage","text":""},{"location":"xxcodecachetotalmaxrampercentage/#-xxcodecachetotalmaxrampercentage","title":"-XX:codecachetotalMaxRAMPercentage","text":"

This option sets the maximum limit for the total JIT code cache size based on the amount of physical memory available to the VM.

"},{"location":"xxcodecachetotalmaxrampercentage/#syntax","title":"Syntax","text":"
    -XX:codecachetotalMaxRAMPercentage=<number>\n
Setting Value Default <number> Between 1 and 100 (fractional numbers are allowed) 25

Where <number> is the maximum limit that is expressed as a percentage of the available physical memory.

For example, if you specify -XX:codecachetotalMaxRAMPercentage=30, the VM is not allowed to use more than 30% of the available physical memory for the internal JIT code caches.

"},{"location":"xxcodecachetotalmaxrampercentage/#explanation","title":"Explanation","text":"

The default total size of the JIT code cache is computed as the minimum of the following two limits:

In memory constrained environments, the percentage limit is relevant because the code cache size is then based on the available physical memory. The percentage limit prevents the VM from using too much memory for its code caches and thus, leaving too little memory for other VM or JIT data structures.

For example, on a 64-bit system, the platform-specific code cache limit is 256 MB. If the VM is constrained to less than 1024 MB, say 512 MB, then the code cache limit becomes 128 MB (25% of 512 MB) because the percentage limit is less than the platform limit.

To fine-tune the code cache size limit for your specific application as a percentage of the available physical memory, you can use the -XX:codecachetotalMaxRAMPercentage option.

As an alternative, you can use the -XX:codecachetotal or the -Xcodecachetotal options to set the code cache size limit as an absolute value (platform-based limit). The absolute value that is specified with these options takes precedence over the percentage that is specified with the -XX:codecachetotalMaxRAMPercentage option.

Restrictions:

"},{"location":"xxcompactstrings/","title":"-XX:[+|-]CompactStrings","text":""},{"location":"xxcompactstrings/#-xx-compactstrings","title":"-XX:[+|-]CompactStrings","text":"

This HotSpot option is reimplemented by Eclipse OpenJ9\u2122 and when enabled causes an ISO8859-1 (also known as Latin-1) character representation to be used internally for String objects, while preserving full API compatibility.

This feature provides heap space savings by using an 8-bit character set internally. Most benefit is gained when the majority of the String objects that your application uses can be encoded using the ISO8859-1 character encoding.

If the option is not enabled, the JIT compiler is nevertheless optimized so that although there is no saving in heap space, there is also no performance penalty.

Further details are available at JEP 254: Compact Strings.

Note: With OpenJ9, this option is supported on OpenJDK version 8 and later versions, whereas HotSpot supports it only from Java version 9.

"},{"location":"xxcompactstrings/#syntax","title":"Syntax","text":"Setting Effect Default -XX:+CompactStrings Enable String compression yes -XX:-CompactStrings Disable String compression yes"},{"location":"xxcompatibility/","title":"-XX:Compatibility","text":""},{"location":"xxcompatibility/#-xxcompatibility","title":"-XX:Compatibility","text":"

This option enables a compatibility mode that OpenJ9 can run in to support applications that require specific capabilities. For example, support for applications that rely on vendor-specific command line arguments or to make available unspecified APIs.

"},{"location":"xxcompatibility/#syntax","title":"Syntax","text":"
    -XX:Compatibility=<mode>\n

Where, <mode> is the application for which the compatibility mode is provided. The <mode> is case-insensitive.

In release 0.43.0, the compatibility mode is provided for the Elasticsearch application only.

    -XX:Compatibility=Elasticsearch\n

If the -XX:Compatibility option is specified more than once, or with a mode other than \"Elasticsearch\" (not case-sensitive), the VM fails to start.

Although this option is available in all OpenJDK versions, the Elasticsearch application requires OpenJDK version 17 or later.

"},{"location":"xxcompatibility/#explanation","title":"Explanation","text":"

The Elasticsearch application was facing incompatibility issues when it was running on OpenJ9 and required many workarounds. With the Elasticsearch compatibility mode, OpenJ9 accepts and supports HotSpot-specific options or APIs that enhance compatibility to run the Elasticsearch application.

"},{"location":"xxconcgcthreads/","title":"-XX:ConcGCThreads","text":""},{"location":"xxconcgcthreads/#-xxconcgcthreads","title":"-XX:ConcGCThreads","text":"

This Oracle HotSpot option affects the number of threads used by the concurrent garbage collector. This option is recognized by Eclipse OpenJ9\u2122 and provided for compatibility.

"},{"location":"xxconcgcthreads/#syntax","title":"Syntax","text":"
    -XX:ConcGCThreads=<number>\n

Where <number> is the number of low-priority background threads that are attached to assist the mutator threads in concurrent mark.

Within OpenJ9 this option is directly mapped to -Xconcurrentbackground.

"},{"location":"xxcontinuationcache/","title":"-XX:ContinuationCache","text":""},{"location":"xxcontinuationcache/#-xxcontinuationcache","title":"-XX:ContinuationCache","text":"

This option sets the continuation tier 1 and 2 cache size to optimize virtual thread performance.

"},{"location":"xxcontinuationcache/#syntax","title":"Syntax","text":"
    -XX:ContinuationCache:t1=<size>,t2=<size>\n
Setting Value Default t1=<size> 0 to 232 - 1 (4,294,967,295) 1 t2=<size> 0 to 232 - 1 (4,294,967,295) Number of processors x 2

Where t1 is the tier 1 cache and t2 is the tier 2 cache.

The tier 1 cache holds data that is not shareable between threads.

The tier 2 cache holds data that can be shared globally between threads.

"},{"location":"xxcontinuationcache/#explanation","title":"Explanation","text":"

When a virtual thread is created, it is associated with a continuation, which holds the target task of the virtual thread. When a virtual thread starts, the VM saves the current thread (carrier thread) state in an internal data structure that is linked with the continuation. When the associated continuation starts, the VM allocates the memory for the internal data structure and stores its reference in the continuation. When the continuation finishes, the VM stores the internal data structure in a cache instead of freeing the associated memory. New continuations can reuse the cached structure instead of allocating new memory for it. The VM can resume thread execution from the saved state later, typically on a different thread.

If the virtual thread stops, the VM loads the state of the previous thread from the continuation and runs that thread. When the virtual thread does not complete running, the last state of the virtual thread is stored in the continuation during the stop operation. At a later point, the scheduler runs the incomplete virtual thread using the thread state stored in the continuation.

Reusing the cached structure improves the performance of creating virtual threads. The performance benefits are more evident in applications that scale to millions of virtual threads.

The continuation cache is implemented in two tiers, tier 1 and tier 2. You can set the maximum size for the two tiers with the -XX:ContinuationCache option. If an application uses more than 10000 virtual threads, setting a larger cache size might improve performance.

When the size of the cache increases, the number of allocations reduces but the cache lookup time might also increase. Evaluate both the number of allocations and the optimal lookup time to set the appropriate cache size.

"},{"location":"xxcontinuationcache/#see-also","title":"See also","text":""},{"location":"xxcpuloadcompatibility/","title":"-XX:[+|-]CpuLoadCompatibility","text":""},{"location":"xxcpuloadcompatibility/#-xx-cpuloadcompatibility","title":"-XX:[+|-]CpuLoadCompatibility","text":"

This option enables or disables the OpenJDK behavior of the getProcessCpuLoad() and getSystemCpuLoad() methods in OpenJ9.

"},{"location":"xxcpuloadcompatibility/#syntax","title":"Syntax","text":"
    -XX:[+|-]CpuLoadCompatibility\n
Setting Effect Default -XX:+CpuLoadCompatibility Enable -XX:-CpuLoadCompatibility Disable yes"},{"location":"xxcpuloadcompatibility/#explanation","title":"Explanation","text":"

The getProcessCpuLoad() method in the com.sun.management.OperatingSystemMXBean class returns the recent CPU usage value for the Java virtual machine process, while the getSystemCpuLoad() method returns the recent CPU usage value for the whole system. When these methods were called in OpenJ9 for the first time, these methods were returning -1 to indicate that the recent CPU usage is not available. It was difficult to identify whether the reason for the -1 value was an error or because the call was the first call and therefore, no recent CPU usage was available.

In OpenJDK, these methods return 0 value in the case of the first call, which makes it easier to differentiate between the first call behavior and an error that needs further investigation.

The -XX:+CpuLoadCompatibility option is used to enable the OpenJDK behavior of the getProcessCpuLoad() and getSystemCpuLoad() methods in OpenJ9.

"},{"location":"xxcriurestorenonportablemode/","title":"-XX:[+|-]CRIURestoreNonPortableMode","text":""},{"location":"xxcriurestorenonportablemode/#-xx-criurestorenonportablemode","title":"-XX:[+|-]CRIURestoreNonPortableMode","text":"

(Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), Linux on AArch64, and Linux on IBM Z\u00ae only)

This option specifies whether the JIT and AOT compilers generate nonportable compiled code on restore.

Restrictions:

"},{"location":"xxcriurestorenonportablemode/#syntax","title":"Syntax","text":"
    -XX:[+|-]CRIURestoreNonPortableMode\n
Setting Effect Default -XX:+CRIURestoreNonPortableMode Enable yes -XX:-CRIURestoreNonPortableMode Disable"},{"location":"xxcriurestorenonportablemode/#explanation","title":"Explanation","text":"

The JIT compiler can use hardware features of the system on which it is running to generate compiled code. That code might therefore fail if it is included in a checkpoint image that you later restore on a different system. For example, the compiled code might try to use a hardware feature that doesn't exist on the new machine, then fail. To avoid this problem, the JIT compiler by default generates code that uses only basic hardware features, therefore portable to different systems.

The -XX:+CRIURestoreNonPortableMode option is set by default so that on restore the JIT compiler can start generating nonportable compiled code. Likewise, the VM can also load nonportable AOT code post-restore. Generating nonportable compiled code also means that no further checkpoints are permitted. Only a single checkpoint can be taken in the VM's lifetime.

If you require multiple checkpoints, you can use the -XX:-CRIURestoreNonPortableMode option to generate portable JIT compiled code after restore.

"},{"location":"xxcriurestorenonportablemode/#see-also","title":"See also","text":""},{"location":"xxcriusecprovider/","title":"-XX:[+|-]CRIUSecProvider","text":""},{"location":"xxcriusecprovider/#-xx-criusecprovider","title":"-XX:[+|-]CRIUSecProvider","text":"

(Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), Linux on AArch64, and Linux on IBM Z\u00ae only)

This option enables or disables the use of the CRIUSECProvider during the checkpoint phase.

"},{"location":"xxcriusecprovider/#syntax","title":"Syntax","text":"
    -XX:[+|-]CRIUSecProvider\n
Setting Effect Default -XX:+CRIUSecProvider Enable yes -XX:-CRIUSecProvider Disable"},{"location":"xxcriusecprovider/#explanation","title":"Explanation","text":"

When you enable CRIU support (with the -XX:+EnableCRIUSupport option), all the existing security providers are removed from the security provider list during the checkpoint phase and CRIUSECProvider is added. CRIUSECProvider supports only a limited number of cryptography services and therefore, you can use only those security algorithms that are available in CRIUSECProvider.

You can now choose to disable the use of CRIUSECProvider with the -XX:-CRIUSecProvider option and continue to use all the existing security providers during the checkpoint and restore phase. When you use the security algorithms of other security providers, you must have alternative approaches to protect your files, such as initialization before you take checkpoints with nonsensitive data.

"},{"location":"xxcriusecprovider/#see-also","title":"See also","text":""},{"location":"xxdiagnosesynconvaluebasedclasses/","title":"-XX:DiagnoseSyncOnValueBasedClasses","text":""},{"location":"xxdiagnosesynconvaluebasedclasses/#-xxdiagnosesynconvaluebasedclasses","title":"-XX:DiagnoseSyncOnValueBasedClasses","text":"

This HotSpot option provides warnings about improper attempts to synchronize on instances of a value-based class. The option is recognized by Eclipse OpenJ9\u2122 for compatibility.

"},{"location":"xxdiagnosesynconvaluebasedclasses/#syntax","title":"Syntax","text":"
    -XX:DiagnoseSyncOnValueBasedClasses=<number>\n
<number> value Effect 1 Generate VirtualMachineError error 2 Print a warning message"},{"location":"xxdisableexplicitgc/","title":"-XX:[+|-]DisableExplicitGC","text":""},{"location":"xxdisableexplicitgc/#-xx-disableexplicitgc","title":"-XX:[+|-]DisableExplicitGC","text":"

This HotSpot option is recognized by Eclipse OpenJ9\u2122 for compatibility. See \u2011Xenableexplicitgc.md / \u2011Xdisableexplicitgc for details.

"},{"location":"xxdisableexplicitgc/#syntax","title":"Syntax","text":"Setting Effect Default -XX:+DisableExplicitGC Enable GC yes -XX:-DisableExplicitGC Disable GC"},{"location":"xxdisclaimjitscratch/","title":"-XX:[+|-]DisclaimJitScratch","text":""},{"location":"xxdisclaimjitscratch/#-xx-disclaimjitscratch","title":"-XX:[+|-]DisclaimJitScratch","text":"

Restriction: This option is deprecated; the option is accepted but ignored.

(Linux\u00ae only)

The -XX:+DisclaimJitScratch option signals to the operating system to discard temporary physical memory that is consumed by the JIT compilation threads.

"},{"location":"xxdisclaimjitscratch/#syntax","title":"Syntax","text":"
    -XX:[+|-]DisclaimJitScratch\n
Setting Effect Default -XX:+DisclaimJitScratch Enable -XX:-DisclaimJitScratch Disable yes"},{"location":"xxdisclaimjitscratch/#explanation","title":"Explanation","text":"

Discarding temporary physical memory can reduce the physical memory reported in use by the Java\u2122 application. The physical memory that is released is available to other processes without the operating system needing to search for the least recently used frames.

The -XX:-DisclaimJitScratch option turns off a previously enabled -XX:+DisclaimJitScratch option.

"},{"location":"xxenable3164interoperability/","title":"-XX:[+|-]Enable3164Interoperability","text":""},{"location":"xxenable3164interoperability/#-xx-enable3164interoperability","title":"-XX:[+|-]Enable3164Interoperability","text":"

(z/OS\u00ae only)

Enables support for using 31-bit native applications with the 64-bit Java\u2122 virtual machine, where that support is available. For more information, see Using 31-bit native code with the 64-bit Java VM.

"},{"location":"xxenablecpumonitor/","title":"-XX:[+|-]EnableCPUMonitor","text":""},{"location":"xxenablecpumonitor/#-xx-enablecpumonitor","title":"-XX:[+|-]EnableCPUMonitor","text":"

This option relates to the information about the CPU usage of thread categories that is available with the com.ibm.lang.management.JvmCpuMonitorMXBean application programming interface.

Restriction: This option might not be supported in subsequent releases.

"},{"location":"xxenablecpumonitor/#syntax","title":"Syntax","text":"
    -XX:[+|-]EnableCPUMonitor\n
Setting Effect Default -XX:+EnableCPUMonitor Enable yes -XX:-EnableCPUMonitor Disable"},{"location":"xxenablecpumonitor/#explanation","title":"Explanation","text":"

The -XX:+EnableCPUMonitor option enables CPU monitoring, which allows a JMX bean to track CPU usage on a per thread basis and attributes the usage against different categories. For more information, see the JvmCpuMonitorMXBean interface in the com.ibm.lang.management API documentation.

To turn off CPU monitoring, set the -XX:-EnableCPUMonitor option on the command line.

"},{"location":"xxenablecpumonitor/#see-also","title":"See also","text":""},{"location":"xxenablecriusupport/","title":"-XX:[+|-]EnableCRIUSupport","text":""},{"location":"xxenablecriusupport/#-xx-enablecriusupport","title":"-XX:[+|-]EnableCRIUSupport","text":"

(Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), Linux on AArch64, and Linux on IBM Z\u00ae only)

This option enables or disables support for Checkpoint/Restore In Userspace (CRIU).

Restrictions: If CRIU support is enabled,

Nonportable mode (default) Pre-checkpoint Nonportable mode (default) Post restore Portable mode Pre-checkpoint Portable mode Post restore Pre-checkpoint: No options Post restore: No options no no no no Pre-checkpoint: No options Post restore: -XX:+UseJITServer no yes no yes Pre-checkpoint: -XX:+UseJITServerPost restore: No options no yes yes yes Pre-checkpoint: -XX:+UseJITServerPost restore: -XX:-UseJITServer no no yes no Pre-checkpoint: -XX:-UseJITServerPost restore: -XX:+UseJITServer no no no no "},{"location":"xxenablecriusupport/#syntax","title":"Syntax","text":"
    -XX:[+|-]EnableCRIUSupport\n
Setting Effect Default -XX:+EnableCRIUSupport Enable -XX:-EnableCRIUSupport Disable yes"},{"location":"xxenablecriusupport/#explanation","title":"Explanation","text":"

When you enable the option, the VM starts with the support for checkpoint and restore processes. The VM starts the JIT, GC, Security, and other internal components that make the checkpoint and restore points feasible. The option enables the use of org.eclipse.openj9.criu.CRIUSupport APIs. With CRIU support, you can take a checkpoint of the VM and restore the checkpoint image. When you specify the -XX:+EnableCRIUSupport option, the VM generates only those compiled codes that are portable (see -XX:[+|-]PortableSharedCache) to facilitate restoring of the checkpoint image in multiple environments. VM does not load any code from the shared classes cache that is nonportable pre-checkpoint.

Taking a checkpoint and restoring the checkpoint image generally happens on different environments with different behaviors. OpenJ9 makes compensations for such differences to ensure successful restore. For example, the VM compensates for the downtime between checkpoint and restore for elapsed time sensitive APIs such as System.nanotime() and java.util.Timer.

For more information about the OpenJ9 compensations and Time APIs, see the Compensation section in the OpenJ9 CRIU Support: A look under the hood\u202f(part II) blog post.

"},{"location":"xxenablecriusupport/#see-also","title":"See also","text":""},{"location":"xxenabledynamicagentloading/","title":"-XX:[+|-]EnableDynamicAgentLoading","text":""},{"location":"xxenabledynamicagentloading/#-xx-enabledynamicagentloading","title":"-XX:[+|-]EnableDynamicAgentLoading","text":"

This option enables or disables the dynamic loading of agents into a running VM.

"},{"location":"xxenabledynamicagentloading/#syntax","title":"Syntax","text":"
    -XX:[+|-]EnableDynamicAgentLoading\n
Setting Effect Default -XX:+EnableDynamicAgentLoading Enable yes -XX:-EnableDynamicAgentLoading Disable"},{"location":"xxenabledynamicagentloading/#explanation","title":"Explanation","text":"

With the Attach API, your application can connect to a running VM and load an agent dynamically into that VM to run tasks. Some libraries misuse the Attach API to dynamically load an agent to run tasks without the approval of the application owner.

You can disable the dynamic loading of the agents into a VM after startup with the -XX:-EnableDynamicAgentLoading option.

For Java\u2122 21 and later, the following warnings are issued when the agents are loaded dynamically into a running VM after startup without specifying the -XX:+EnableDynamicAgentLoading option. These warnings are not issued if the same agents were loaded before either by using the command-line options or an earlier dynamic loading.

WARNING: A {Java,JVM TI} agent has been loaded dynamically (file:/u/bob/agent.jar)\nWARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning\nWARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information\nWARNING: Dynamic loading of agents will be disallowed by default in a future release\n

These warnings are issued only once for the same agent when the -XX:+EnableDynamicAgentLoading option is not specified.

If the -XX:+EnableDynamicAgentLoading option is set, all agents that are dynamically loaded are considered as approved by the application owner, and therefore, no warnings are issued.

Eclipse OpenJ9\u2122 supported operating systems have APIs to determine whether the same agent was loaded before or not, even if an agent is loaded with a platform-independent name or an absolute path to the platform-dependent library.

From 0.44.0 release onwards, AIX systems also can detect whether an agent was previously loaded or not if the agent was loaded through a platform-independent name or an absolute path to the platform-dependent library. Therefore, like other platforms, on AIX systems also, the warnings are issued only once for the same agent when the -XX:+EnableDynamicAgentLoading option is not specified.

"},{"location":"xxenabledynamicagentloading/#see-also","title":"See also","text":""},{"location":"xxenableextendedhcr/","title":"-XX:[+|-]EnableExtendedHCR","text":""},{"location":"xxenableextendedhcr/#-xx-enableextendedhcr","title":"-XX:[+|-]EnableExtendedHCR","text":"

This option enables or disables the extended Hot Code Replace (HCR) capability in the VM.

"},{"location":"xxenableextendedhcr/#syntax","title":"Syntax","text":"
    -XX:[+|-]EnableExtendedHCR\n
Setting Effect Default -XX:+EnableExtendedHCR Enable -XX:-EnableExtendedHCR Disable yes"},{"location":"xxenableextendedhcr/#explanation","title":"Explanation","text":"

Supporting extended HCR has a maintenance cost and because only few users use this capability, the extended HCR feature is deprecated and will be removed in a future release. From OpenJDK 25 onwards, extended HCR will not be supported. Following that, the extended HCR support will be removed from other earlier OpenJDK versions also.

If the extended HCR support is disabled (-XX:-EnableExtendedHCR), it might result in a JVMTI failure. In case of such a failure, the following warning message is displayed:

Warning: Extended HCR is disabled, enable with -XX:+EnableExtendedHCR. This feature is deprecated. In the future, the extended HCR capability, and the option to enable it, will be completely removed from all versions.\n
"},{"location":"xxenableextendedhcr/#see-also","title":"See also","text":""},{"location":"xxensurehashed/","title":"-XX:[+|-]EnsureHashed","text":""},{"location":"xxensurehashed/#-xx-ensurehashed","title":"-XX:[+|-]EnsureHashed","text":"

This option specifies classes to be pre-hashed. Objects that are created from these classes are hashed and extended with a slot to store the assigned hash value when the object is created or first moved during the garbage collection process. This option might improve performance for applications that frequently hash objects of a certain type.

"},{"location":"xxensurehashed/#syntax","title":"Syntax","text":"
    -XX:+EnsureHashed:<classes>\n    -XX:-EnsureHashed:<classes>\n
Setting Effect -XX:+EnsureHashed:<classes> Specify classes -XX:-EnsureHashed:<classes> Ignore classes

Where <classes> is a comma-separated list of fully qualified class names, for example, java/lang/String.

"},{"location":"xxensurehashed/#explanation","title":"Explanation","text":"

The -XX:+EnsureHashed:<classes> option specifies the classes and the -XX:-EnsureHashed:<classes> option ignores classes that were previously specified. These options are parsed left to right.

For example, -XX:+EnsureHashed:Class1,Class2,Class3 -XX:-EnsureHashed:Class2 -XX:+EnsureHashed:Class2,Class4 -XX:-EnsureHashed:Class1,Class3 results in the set of EnsureHashed classes {Class2, Class4}.

Objects that are created from classes Thread and Class are allocated in the tenure region directly and therefore, do not get moved by the garbage collector often. It takes time for such pre-tenured objects to get hashed and extended with a slot. To pre-hash those objects from the start and hence, improve the performance,-XX:+EnsureHashed:java/lang/Class,java/lang/Thread is added to the list of default options in the options.default file.

"},{"location":"xxensurehashed/#see-also","title":"See also","text":""},{"location":"xxexitonoutofmemoryerror/","title":"-XX:[+|-]ExitOnOutOfMemoryError","text":""},{"location":"xxexitonoutofmemoryerror/#-xx-exitonoutofmemoryerror","title":"-XX:[+|-]ExitOnOutOfMemoryError","text":"

This HotSpot option is recognized by Eclipse OpenJ9\u2122. You can use the option to trigger a shut down on VM out-of-memory conditions.

Note: Java\u2122, heap, snap, and system dumps are enabled by default but can be disabled by including -XX:-HeapDumpOnOutOfMemoryError.

"},{"location":"xxexitonoutofmemoryerror/#syntax","title":"Syntax","text":"
    -XX:[+|-]ExitOnOutOfMemoryError\n
Setting Effect Default -XX:+ExitOnOutOfMemoryError Enable -XX:-ExitOnOutOfMemoryError Disable yes"},{"location":"xxgloballockreservation/","title":"-XX:[+|-]GlobalLockReservation","text":""},{"location":"xxgloballockreservation/#-xx-globallockreservation","title":"-XX:[+|-]GlobalLockReservation","text":"

(AIX\u00ae and Linux on Power Systems\u2122 only)

The -XX:+GlobalLockReservation option enables an optimization targeted towards more efficient handling of locking and unlocking Java\u2122 objects. The -XX:-GlobalLockReservation option is used to disable this optimization. The optimization is enabled by default.

"},{"location":"xxgloballockreservation/#syntax","title":"Syntax","text":"
    -XX:[+|-]GlobalLockReservation\n    -XX:+GlobalLockReservation:<parameter>\n
Setting Effect Default -XX:+GlobalLockReservation Enable yes -XX:-GlobalLockReservation Disable

This optimization is targeted towards applications with lots of uncontended locked objects that are being locked just to be safe. When enabled, heuristics are used to try and determine when an object will be exclusively locked by a single thread so that faster, more specialized code can be used for locking the object. If the heuristics incorrectly identify an object as a target for the optimization, performance might be adversely affected.

The -XX:-GlobalLockReservation option turns off global lock reservation.

The -XX:+GlobalLockReservation option can be used to enable global lock reservation if it was disabled by an option that occurs earlier in command line processing or to modify some of the global lock reservation related suboptions that are described later in this document.

"},{"location":"xxgloballockreservation/#parameters","title":"Parameters","text":"

Advanced tuning parameters are shown in the following table:

Parameter Effect reservedTransitionThreshold Changes amount of time spent analyzing an object. reservedAbsoluteThreshold Changes amount of time spent analyzing a class for compatibility. minimumReservedRatio Changes aggression level for marking a class as highly compatible. cancelAbsoluteThreshold Changes amount of time spent analyzing a class for incompatibility. minimumLearningRatio Changes aggression level for marking a class as highly incompatible."},{"location":"xxgloballockreservation/#reservedtransitionthreshold","title":"reservedTransitionThreshold","text":"
    -XX:+GlobalLockReservation:reservedTransitionThreshold=<value>\n
Setting Value Default <value> number 1

Number of times an object is locked by the same thread before it is considered reserved minus a value of 2. So, with a default value of 1, an object can be reserved the third time it is locked. <value> can be 0-3 inclusive. Values of 4 or higher are treated as infinity.

"},{"location":"xxgloballockreservation/#reservedabsolutethreshold","title":"reservedAbsoluteThreshold","text":"
    -XX:+GlobalLockReservation:reservedAbsoluteThreshold=<value>\n
Setting Value Default <value> number 10

Minimum number of objects of a class that get reserved before the class can be considered highly compatible. Objects of that class are reserved the first time they are locked. Values of 65536 or higher are treated as infinity.

"},{"location":"xxgloballockreservation/#minimumreservedratio","title":"minimumReservedRatio","text":"
    -XX:+GlobalLockReservation:minimumReservedRatio=<value>\n
Setting Value Default <value> number 1024

Minimum ratio of reserved objects to flat objects before a class can be considered highly compatible. Values of 65536 or higher are treated as infinity.

"},{"location":"xxgloballockreservation/#cancelabsolutethreshold","title":"cancelAbsoluteThreshold","text":"
    -XX:+GlobalLockReservation:cancelAbsoluteThreshold=<value>\n
Setting Value Default <value> number 10

Minimum number of objects of a class that get converted to flat before the class can be considered highly incompatible. Objects of that class are never reserved. Values of 65536 or higher are treated as infinity.

"},{"location":"xxgloballockreservation/#minimumlearningratio","title":"minimumLearningRatio","text":"
    -XX:+GlobalLockReservation:minimumLearningRatio=<value>\n
Setting Value Default <value> number 256

Minimum ratio of reserved objects to flat objects to prevent class from being considered highly incompatible. Values of 65536 or higher are treated as infinity.

"},{"location":"xxhandlesigabrt/","title":"-XX:[+|-]HandleSIGABRT","text":""},{"location":"xxhandlesigabrt/#-xx-handlesigabrt","title":"-XX:[+|-]HandleSIGABRT","text":"

This option affects the handling of the operating system signal SIGABRT. This signal represents abnormal termination, and it can either be generated by the abort function or the kill command.

"},{"location":"xxhandlesigabrt/#syntax","title":"Syntax","text":"
    -XX:[+|-]HandleSIGABRT\n
Setting Effect Default -XX:+HandleSIGABRT Enable yes -XX:-HandleSIGABRT Disable"},{"location":"xxhandlesigabrt/#explanation","title":"Explanation","text":"

When enabled, the VM handles the signal SIGABRT and generates the various dump files.

When the option is disabled, the VM does not handle the signal SIGABRT. Generally, this signal is handled by the default operating system handler.

Note: Do not use the -XX:+HandleSIGABRT and -Xrs options together. An error is thrown if both options are enabled. To resolve this error, one of the options should be disabled.

"},{"location":"xxhandlesigusr2/","title":"-XX:[+|-]HandleSIGUSR2","text":""},{"location":"xxhandlesigusr2/#-xx-handlesigusr2","title":"-XX:[+|-]HandleSIGUSR2","text":"

(AIX\u00ae, Linux\u00ae, macOS\u00ae, and z/OS\u00ae only)

This option affects the handling of the SIGUSR2 signal. This signal is user-defined and triggers the user2 event, which is commonly used for taking system dump files with exclusive access. The operating system installs a default signal handler for handling SIGUSR2. If there is no VM or application signal handler, then the operating system's signal handler is used.

"},{"location":"xxhandlesigusr2/#syntax","title":"Syntax","text":"
    -XX:[+|-]HandleSIGAUSR2\n
Setting Effect Default -XX:+HandleSIGUSR2 Enable yes -XX:-HandleSIGUSR2 Disable"},{"location":"xxhandlesigusr2/#explanation","title":"Explanation","text":"

When enabled, the VM handles the SIGUSR2 signal and generates the user2 event, which can be configured with the -Xdump option to trigger a dump agent.

When the option is disabled, the VM does not handle the SIGUSR2 signal and therefore, the VM signal handler is not installed. Generally, the default operating system handler that is installed for the SIGUSR2 signal takes over the handling of the signal.

For more information about the signals and signal handling, see Signal handling.

Note: Do not use the -XX:+HandleSIGUSR2 and -Xrs options together. An error is thrown if both options are enabled. To resolve this error, one of the options should be disabled.

"},{"location":"xxhandlesigusr2/#see-also","title":"See also","text":""},{"location":"xxhandlesigxfsz/","title":"-XX:[+|-]HandleSIGXFSZ","text":""},{"location":"xxhandlesigxfsz/#-xx-handlesigxfsz","title":"-XX:[+|-]HandleSIGXFSZ","text":"

(AIX\u00ae, Linux\u00ae, macOS\u00ae, and z/OS\u00ae only)

This option affects the handling of the operating system signal SIGXFSZ. This signal is generated when a process attempts to write to a file that causes the maximum file size ulimit to be exceeded.

"},{"location":"xxhandlesigxfsz/#syntax","title":"Syntax","text":"
    -XX:[+|-]HandleSIGXFSZ\n
Setting Effect Default -XX:+HandleSIGXFSZ Enable yes -XX:-HandleSIGXFSZ Disable"},{"location":"xxhandlesigxfsz/#explanation","title":"Explanation","text":"

When enabled, the VM handles the signal SIGXFSZ and continues, without ending. When a file is written from a Java\u2122 API class that exceeds the maximum file size ulimit, an exception is raised. Log files that are created by the VM are silently truncated when they reach the maximum file size ulimit.

When the option is disabled, the VM does not handle the signal SIGXFSZ. In this situation, if the maximum file size ulimit for any file is reached, the operating system ends the process with a core dump.

"},{"location":"xxheapdumponoutofmemory/","title":"-XX:[+|-]HeapDumpOnOutOfMemory","text":""},{"location":"xxheapdumponoutofmemory/#-xx-heapdumponoutofmemory","title":"-XX:[+|-]HeapDumpOnOutOfMemory","text":"

This HotSpot option is recognized by Eclipse OpenJ9\u2122. You can use the option to to disable Java\u2122, heap, snap, and system dumps on out-of-memory conditions, which are enabled by default.

"},{"location":"xxheapdumponoutofmemory/#syntax","title":"Syntax","text":"
    -XX:[+|-]HeapDumpOnOutOfMemory\n
Setting Effect Default -XX:+HeapDumpOnOutOfMemory Enable yes -XX:-HeapDumpOnOutOfMemory Disable"},{"location":"xxheapdumppath/","title":"-XX:HeapDumpPath","text":""},{"location":"xxheapdumppath/#-xxheapdumppath","title":"-XX:HeapDumpPath","text":"

This HotSpot option is recognized by Eclipse OpenJ9\u2122 for compatibility, and you can use it as an alias for -Xdump:directory=<path>.

This option sets the directory for all VM dumps including heap dumps, Java\u2122 dumps, and system dumps.

"},{"location":"xxheapdumppath/#syntax","title":"Syntax","text":"
    -XX:HeapDumpPath=<path>\n

where <path> is the directory to which all dump types are written. This directory path is prefixed to the path of all non-absolute dump file names, including the file names for the default dump agents.

"},{"location":"xxheapmanagementmxbeancompatibility/","title":"-XX:[+|-]HeapManagementMXBeanCompatibility","text":""},{"location":"xxheapmanagementmxbeancompatibility/#-xx-heapmanagementmxbeancompatibility","title":"-XX:[+|-]HeapManagementMXBeanCompatibility","text":"

The MXBean interface now reports more detailed information about memory pools and garbage collectors for a garbage collection policy. In addition, the names of memory pools and garbage collectors are changed to match the naming convention that is used for verbose garbage collection logging. This option provides compatibility with earlier versions of the VM.

"},{"location":"xxheapmanagementmxbeancompatibility/#syntax","title":"Syntax","text":"
    -XX:[+|-]HeapManagementMXBeanCompatibility\n
Setting Effect Default -XX:+HeapManagementMXBeanCompatibility Enable -XX:-HeapManagementMXBeanCompatibility Disable yes

Setting -XX:+HeapManagementMXBeanCompatibility on the command line turns on compatibility with earlier versions of the VM. Information about memory pools and garbage collectors are reported in the older format.

When compatibility is turned off, the VM reports more detailed information and matches the naming of memory pools and garbage collectors to the naming convention that is used for verbose garbage collection logging.

"},{"location":"xxheapmanagementmxbeancompatibility/#explanation","title":"Explanation","text":"

The additional information that is available from the MXBean interface for later versions is shown in the following table:

Garbage collection policy MemoryPool names GarbageCollector names gencon nursery-allocate, nursery-survivor, tenured-LOA, tenured-SOA, tenured scavenge, global optthruput or optavgpause tenured-LOA, tenured-SOA, tenured global balanced balanced-reserved, balanced-eden, balanced-survivor, balanced-old partial gc, global garbage collect metronome JavaHeap global

The MemoryPoolMXBean API reports values for 4 detailed memory pools instead of a single value for the overall Java\u2122 heap. In some cases the total sum of the 4 pools is more than the maximum heap size. This irregularity can be caused if data for each pool is collected between garbage collection cycles, where objects have been moved or reclaimed. If you want to collect memory usage data that is synchronized across the memory pools, use the GarbageCollectionNotificationInfo or GarbageCollectorMXBean.getLastGcInfo extensions.

Earlier releases included only the following names:

"},{"location":"xxheapmanagementmxbeancompatibility/#see-also","title":"See also","text":"

For more information about IBM\u00ae MXBeans, see the com.ibm.lang.management API documentation.

"},{"location":"xxidletuningcompactonidle/","title":"-XX:[+|-]IdleTuningCompactOnIdle","text":""},{"location":"xxidletuningcompactonidle/#-xx-idletuningcompactonidle","title":"-XX:[+|-]IdleTuningCompactOnIdle","text":"

(Linux\u00ae only)

Warning: From Eclipse OpenJ9\u2122 version 0.23.0 this option has no effect.

In versions of OpenJ9 before 0.23.0, this option controls garbage collection processing with compaction when the state of the OpenJ9 VM is set to idle.

Restrictions:

  1. This option was deprecated in release 0.15.0 due to operational changes. A compaction is now triggered by internal heuristics that look into the number of fragmented pages. Typically there is no need to force a compaction. This option will be removed in the future.
  2. This option applies only to Linux architectures when the Generational Concurrent (gencon) garbage collection policy is in use.
  3. This option is not effective if the object heap is configured to use large pages.
  4. This option is not effective if -XX:+IdleTuningGcOnIdle is not specified.
"},{"location":"xxidletuningcompactonidle/#syntax","title":"Syntax","text":"
    -XX:[+|-]IdleTuningCompactOnIdle\n
Setting Effect Default Default when running in a docker container -XX:+IdleTuningCompactOnIdle Enable yes -XX:-IdleTuningCompactOnIdle Disable yes

The default depends on whether or not the OpenJ9 VM is running in a container. As indicated in the table, when the VM is running in a container and the state is set to idle, the VM attempts to compact the object heap following a garbage collection cycle. The garbage collection cycle is controlled by the -XX:+IdleTuningGcOnIdle option, which is also enabled by default when the OpenJ9 VM is running inside a container.

If your application is not running in a container and you want compaction to be attempted every time idle GC happens as part of the idle-tuning process, set the -XX:+IdleTuningCompactOnIdle option on the command line when you start your application.

The -XX:+IdleTuningCompactOnIdle option can be used with the -XX:+IdleTuningMinIdleWaitTime, which controls the amount of time that the VM must be idle before an idle state is set. If a value for the -XX:+IdleTuningMinIdleWaitTime option is not explicitly specified, the VM sets a default value of 180 seconds.

"},{"location":"xxidletuningcompactonidle/#see-also","title":"See also","text":""},{"location":"xxidletuninggconidle/","title":"-XX:[+|-]IdleTuningGcOnIdle","text":""},{"location":"xxidletuninggconidle/#-xx-idletuninggconidle","title":"-XX:[+|-]IdleTuningGcOnIdle","text":"

(Linux\u00ae only)

This option controls whether a garbage collection cycle takes place when the state of the Eclipse OpenJ9\u2122 VM is set to idle. Compaction of the heap is also attempted during the idle GC when certain triggers are met.

Restrictions: This option applies only to Linux architectures when the Generational Concurrent (gencon) garbage collection policy is in use. This option is not effective if the object heap is configured to use large pages.

"},{"location":"xxidletuninggconidle/#syntax","title":"Syntax","text":"
    -XX:[+|-]IdleTuningGcOnIdle\n
Setting Effect Default Default when running in a docker container -XX:+IdleTuningGcOnIdle Enable yes -XX:-IdleTuningGcOnIdle Disable yes

The default depends on whether or not the OpenJ9 VM is running in a docker container. As indicated in the table, when the VM is running in a container and the state is set to idle, this option causes the VM to release free memory pages in the object heap without resizing the Java\u2122 heap and attempts to compact the heap after the garbage collection cycle if certain heuristics are triggered. The pages are reclaimed by the operating system, which reduces the physical memory footprint of the VM.

If your application is not running in a container and you want to enable idle-tuning, set the -XX:+IdleTuningGcOnIdle option on the command line when you start your application.

When enabled, the -XX:+IdleTuningGcOnIdle option is used with the -XX:IdleTuningMinIdleWaitTime and -XX:IdleTuningMinFreeHeapOnIdle options. If values for these options are not explicitly specified, the VM sets the following defaults:

"},{"location":"xxidletuninggconidle/#see-also","title":"See also","text":""},{"location":"xxidletuningminfreeheaponidle/","title":"-XX:IdleTuningMinFreeHeapOnIdle","text":""},{"location":"xxidletuningminfreeheaponidle/#-xxidletuningminfreeheaponidle","title":"-XX:IdleTuningMinFreeHeapOnIdle","text":"

(Linux\u00ae only)

This option controls the percentage of free memory pages in the object heap that can be released when the Eclipse OpenJ9\u2122 VM is in an idle state.

Restrictions: This option applies only to Linux architectures when the Generational Concurrent (gencon) garbage collection policy is in use. This option is not effective if the object heap is configured to use large pages.

"},{"location":"xxidletuningminfreeheaponidle/#syntax","title":"Syntax","text":"
    -XX:IdleTuningMinFreeHeapOnIdle=<percentage>\n
Setting Value Default <percentage> [0 - 100] 0

When used with -XX:+IdleTuningGcOnIdle, this option can be used to place an upper bound on the percentage of free memory pages in the object heap that can be released when the VM is in an idle state. If -XX:IdleTuningMinFreeHeapOnIdle is not specified, the VM uses a default value of 0.

"},{"location":"xxidletuningminfreeheaponidle/#example","title":"Example","text":"

If you set -XX:IdleTuningMinFreeHeapOnIdle=10, no more than 90% of the free memory pages in the object heap can be released by the VM when it is in an idle state.

"},{"location":"xxidletuningminfreeheaponidle/#see-also","title":"See also","text":""},{"location":"xxidletuningminidlewaittime/","title":"-XX:IdleTuningMinIdleWaitTime","text":""},{"location":"xxidletuningminidlewaittime/#-xxidletuningminidlewaittime","title":"-XX:IdleTuningMinIdleWaitTime","text":"

** (Linux\u00ae only) **

When the Eclipse OpenJ9\u2122 VM is idle, this option controls the minimum length of time that the VM must be idle before the state of the VM is set to idle. When the state changes to idle, a garbage collection cycle runs, the object heap is compacted, and free memory pages are released back to the operating system, which reduces the footprint of the VM. Garbage collection and compaction are controlled by the -XX:+IdleTuningGcOnIdle and -XX:+IdleTuningCompactOnIdle options, which are enabled by default when the OpenJ9 VM is running inside a docker container. (Note that from OpenJ9 version 0.23.0 the -XX:+IdleTuningCompactOnIdle option has no effect.)

Restrictions: This option applies only to Linux architectures when the Generational Concurrent (gencon) garbage collection policy is in use. This option is not effective if the object heap is configured to use large pages.

"},{"location":"xxidletuningminidlewaittime/#syntax","title":"Syntax","text":"
    -XX:IdleTuningMinIdleWaitTime=<secs>\n
Setting Value Default Default when running in a docker container <secs> [0 or greater] 0 180

The value used for <secs> specifies the minimum length of time in seconds that the VM is idle before the state is set to idle. Idle tuning is enabled by default when the OpenJ9 VM is running in a docker container and the VM is detected as idle for 180 seconds.

Setting the value to 0 disables this feature, which causes the following idle tuning options to have no effect:

"},{"location":"xxidletuningminidlewaittime/#see-also","title":"See also","text":""},{"location":"xxignoreunrecognizedrestoreoptions/","title":"-XX:[+|-]IgnoreUnrecognizedRestoreOptions","text":""},{"location":"xxignoreunrecognizedrestoreoptions/#-xx-ignoreunrecognizedrestoreoptions","title":"-XX:[+|-]IgnoreUnrecognizedRestoreOptions","text":"

(Linux\u00ae x86, Linux on POWER\u00ae (Little Endian), Linux on AArch64, and Linux on IBM Z\u00ae only)

This option specifies whether the VM ignores any unrecognized options at the time of restore.

Restrictions: This option takes effect only when -XX:+EnableCRIUSupport is enabled. This option can be used only on restore.

"},{"location":"xxignoreunrecognizedrestoreoptions/#syntax","title":"Syntax","text":"
    -XX:[+|-]IgnoreUnrecognizedRestoreOptions\n
Setting Effect Default -XX:+IgnoreUnrecognizedRestoreOptions Enable -XX:-IgnoreUnrecognizedRestoreOptions Disable yes"},{"location":"xxignoreunrecognizedrestoreoptions/#explanation","title":"Explanation","text":"

When you restore a checkpoint image, you can specify additional command-line options by using the CRIUSupport.registerRestoreOptionsFile API. You can also use the OPENJ9_RESTORE_JAVA_OPTIONS environment variable (CRIUSupport.registerRestoreEnvVariables API) to add the VM options on restore. If you specify options that do not exist, or are unsupported, the VM, by default, fails to start and throws a JVMRestoreException error. The -XX:+IgnoreUnrecognizedRestoreOptions option disables the failure and allows the VM to continue even if some options are not used.

"},{"location":"xxignoreunrecognizedrestoreoptions/#see-also","title":"See also","text":""},{"location":"xxignoreunrecognizedvmoptions/","title":"-XX:[+|-]IgnoreUnrecognizedVMOptions","text":""},{"location":"xxignoreunrecognizedvmoptions/#-xx-ignoreunrecognizedvmoptions","title":"-XX:[+|-]IgnoreUnrecognizedVMOptions","text":"

This Oracle option affects the behavior of the HotSpot JVM when it finds an unrecognized top-level option at startup. This option is implemented in the Eclipse OpenJ9\u2122 VM for compatibility.

"},{"location":"xxignoreunrecognizedvmoptions/#syntax","title":"Syntax","text":"
    -XX:[+|-]IgnoreUnrecognizedVMOptions\n
Setting Effect Default -XX:+IgnoreUnrecognizedVMOptions Enable -XX:-IgnoreUnrecognizedVMOptions Disable yes"},{"location":"xxignoreunrecognizedxxcolonoptions/","title":"-XX:[+|-]IgnoreUnrecognizedXXColonOptions","text":""},{"location":"xxignoreunrecognizedxxcolonoptions/#-xx-ignoreunrecognizedxxcolonoptions","title":"-XX:[+|-]IgnoreUnrecognizedXXColonOptions","text":"

By default, any -XX: options that you specify on the command line are ignored if they are not recognized, which prevents an application failing to start. However, if you want to determine whether any of your -XX: options are unrecognized, you can turn off the behavior with this option. You might want to do this, for example, if you are switching to Eclipse OpenJ9\u2122 from an alternative VM implementation where you are using -XX: options to tune the runtime environment.

"},{"location":"xxignoreunrecognizedxxcolonoptions/#syntax","title":"Syntax","text":"
    -XX:[+|-]IgnoreUnrecognizedXXColonOptions\n
Setting Effect Default -XX:+IgnoreUnrecognizedXXColonOptions Enable yes -XX:-IgnoreUnrecognizedXXColonOptions Disable

When you specify -XX:-IgnoreUnrecognizedXXColonOptions, if you also specify a -XX: option that is not recognized, that option is reported and the VM does not start. For example:

JVMJ9VM007E Command-line option unrecognised: -XX:InvalidOption\nError: Could not create the Java Virtual Machine.\nError: A fatal exception has occurred. Program will exit.\n
"},{"location":"xxinitialheapsize/","title":"-XX:InitialHeapSize","text":""},{"location":"xxinitialheapsize/#-xxinitialheapsize-xxmaxheapsize","title":"-XX:InitialHeapSize / -XX:MaxHeapSize","text":"

These HotSpot options for specifying heap size are recognized by Eclipse OpenJ9\u2122 for compatibility. See -Xms / -Xmx for details.

"},{"location":"xxinitialheapsize/#syntax","title":"Syntax","text":"Setting Effect -XX:InitialHeapSize<size> Set initial heap size -XX:MaxHeapSize<size> Set maximum heap size"},{"location":"xxinitialrampercentage/","title":"-XX:InitialRAMPercentage","text":""},{"location":"xxinitialrampercentage/#-xxinitialrampercentage-xxmaxrampercentage","title":"-XX:InitialRAMPercentage / -XX:MaxRAMPercentage","text":"

These Oracle HotSpot options can be used to specify the initial and maximum size of the Java heap as a percentage of the total memory available to the VM. The options are recognized by Eclipse OpenJ9\u2122 and provided for compatibility.

"},{"location":"xxinitialrampercentage/#syntax","title":"Syntax","text":"Setting Effect -XX:InitialRAMPercentage=N Set initial heap size as a percentage of total memory -XX:MaxRAMPercentage=N Set maximum heap size as a percentage of total memory Where N is a value between 0 and 100, which can be of type \"double\". For example, 12.3456.

Note: If you set a value for -Xms, the -XX:InitialRAMPercentage option is ignored. If you set a value for -Xmx, the -XX:MaxRAMPercentage option is ignored.

If your application is running in a container and you have specified -XX:+UseContainerSupport, both the default heap size for containers, the -XX:InitialRAMPercentage option, and the -XX:MaxRAMPercentage option are based on the available container memory.

"},{"location":"xxinterleavememory/","title":"-XX:[+|-]InterleaveMemory","text":""},{"location":"xxinterleavememory/#-xx-interleavememory","title":"-XX:[+|-]InterleaveMemory","text":"

(AIX\u00ae, Linux\u00ae, and Windows\u2122 only, but not Linux on IBM Z\u00ae)

Use the -XX:+InterleaveMemory option to enable the interleaving of allocated memory across NUMA nodes.

"},{"location":"xxinterleavememory/#syntax","title":"Syntax","text":"
    -XX:[+|-]InterleaveMemory\n
Setting Effect Default -XX:+InterleaveMemory Enable -XX:-InterleaveMemory Disable yes"},{"location":"xxiprofileduringstartupphase/","title":"-XX:[+|-]IProfileDuringStartupPhase","text":""},{"location":"xxiprofileduringstartupphase/#-xx-iprofileduringstartupphase","title":"-XX:[+|-]IProfileDuringStartupPhase","text":"

This option enables or disables the data collection by the interpreter profiler during a VM startup.

"},{"location":"xxiprofileduringstartupphase/#syntax","title":"Syntax","text":"
    -XX:[+|-]IProfileDuringStartupPhase\n
Setting Effect -XX:+IProfileDuringStartupPhase Enable -XX:-IProfileDuringStartupPhase Disable"},{"location":"xxiprofileduringstartupphase/#explanation","title":"Explanation","text":"

The VM collects interpreter profiling data that is used to optimize methods at the time of JIT compilation. To reduce the CPU usage of the interpreter profiler during the startup phase, the VM stores such profiling data in the shared classes cache. During startup, the VM uses heuristics to determine when to turn on data collection and when to rely on the data that was collected by a previous VM and stored in the cache. You can overrule the heuristics and control the collection of the profiling information during the startup phase by using the -XX:[+|-]IProfileDuringStartupPhase option.

"},{"location":"xxiprofileduringstartupphase/#see-also","title":"See also","text":""},{"location":"xxjitinlinewatches/","title":"-XX:[+|-]JITInlineWatches","text":""},{"location":"xxjitinlinewatches/#-xx-jitinlinewatches","title":"-XX:[+|-]JITInlineWatches","text":"

This option controls JIT operations that relate to JVMTI watched fields.

"},{"location":"xxjitinlinewatches/#syntax","title":"Syntax","text":"
    -XX:[+|-]JITInlineWatches\n
Setting Effect Default -XX:+JITInlineWatches Enable yes -XX:-JITInlineWatches Disable

This option enables performance improvements relating to JVMTI watched fields.

"},{"location":"xxjitserveraddress/","title":"-XX:JITServerAddress","text":""},{"location":"xxjitserveraddress/#-xxjitserveraddress","title":"-XX:JITServerAddress","text":"

This option specifies the JITServer server name or IP address for a JITServer client to connect to.

"},{"location":"xxjitserveraddress/#syntax","title":"Syntax","text":"
    -XX:JITServerAddress=<address>\n
Setting Effect Default -XX:JITServerAddress Set server's name or IP address localhost"},{"location":"xxjitserveraddress/#explanation","title":"Explanation","text":"

When you enable this option, the JITServer client sends compilation requests to a server with the provided name or address. If there is no server available at that address, the JIT compiler compiles locally.

"},{"location":"xxjitserveraddress/#see-also","title":"See also","text":""},{"location":"xxjitserveraotcachedir/","title":"-XX:JITServerAOTCacheDir","text":""},{"location":"xxjitserveraotcachedir/#-xxjitserveraotcachedir","title":"-XX:JITServerAOTCacheDir","text":"

(Linux\u00ae only)

This option specifies the directory to be used for saving and loading JITServer AOT cache files.

"},{"location":"xxjitserveraotcachedir/#syntax","title":"Syntax","text":"
    -XX:JITServerAOTCacheDir=<directory>\n

If the option is not specified, the cache files are saved in the current working directory of the JITServer server.

"},{"location":"xxjitserveraotcachedir/#explanation","title":"Explanation","text":"

A JITServer instance can have several AOT caches, each with its own name. To enable reusing of the AOT caches by other JITServer instances (such as the instances started later), you can use the -XX:+JITServerAOTCachePersistence option. With this option enabled, JITServer server periodically saves its AOT caches to files. Other JITServer instances can then load these caches the first time a client requests a particular cache.

You can specify the directory for saving the AOT cache files with the -XX:JITServerAOTCacheDir=<directory> option. When the server receives the location of the requested AOT cache file through the -XX:JITServerAOTCacheDir option and a request for a specific cache name, if that cache does not exist in-memory, the server searches the specified cache directory for the file with the matching name and loads it, if available.

This option is not applicable if the JITServer AOT cache persistence feature is not enabled with the -XX:+JITServerAOTCachePersistence option.

"},{"location":"xxjitserveraotcachedir/#see-also","title":"See also","text":""},{"location":"xxjitserveraotcachename/","title":"-XX:JITServerAOTCacheName","text":""},{"location":"xxjitserveraotcachename/#-xxjitserveraotcachename","title":"-XX:JITServerAOTCacheName","text":"

This option, used at the JITServer client JVMs, specifies the name of the AOT cache to be used at the JITServer server.

"},{"location":"xxjitserveraotcachename/#syntax","title":"Syntax","text":"
     -XX:JITServerAOTCacheName=<cache_name>\n
where <cache_name> specifies the name of the server-side AOT cache to be used."},{"location":"xxjitserveraotcachename/#explanation","title":"Explanation","text":"

A single JITServer instance can use multiple AOT caches, which are distinguished by their name. Clients that are running applications with significantly different execution profiles can, therefore, connect to the same JITServer instance. Specify this option at the client JVM. If you do not specify this option, the client uses a cache named default.

Note: You must specify -XX:+JITServerUseAOTCache, otherwise the -XX:JITServerAOTCacheName option is ignored.

"},{"location":"xxjitserveraotcachename/#see-also","title":"See also","text":""},{"location":"xxjitserveraotcachepersistence/","title":"-XX:[+|-]JITServerAOTCachePersistence","text":""},{"location":"xxjitserveraotcachepersistence/#-xx-jitserveraotcachepersistence","title":"-XX:[+|-]JITServerAOTCachePersistence","text":"

(Linux\u00ae only)

This option enables or disables the JITServer server's ability to allow other JITServer instances to reuse AOT caches.

"},{"location":"xxjitserveraotcachepersistence/#syntax","title":"Syntax","text":"
    -XX:[+|-]JITServerAOTCachePersistence\n
Setting Effect Default -XX:+JITServerAOTCachePersistence Enable -XX:-JITServerAOTCachePersistence Disable yes"},{"location":"xxjitserveraotcachepersistence/#explanation","title":"Explanation","text":"

With the -XX:+JITServerAOTCachePersistence option, the JITServer server periodically saves its AOT caches to files. Other JITServer instances can then load these caches from files the first time a client requests a particular named cache. This feature is useful to improve performance, especially in scenarios where JITServer instances are started up and shut down regularly.

This feature depends on the -XX:+JITServerUseAOTCache command-line option, which is used to enable caching of AOT-compiled methods. You must specify this option both at the client JVM and at the server.

Use the -XX:JITServerAOTCacheName=<cache_name> option at the client to request a particular AOT cache. If the requested cache does not exist at the server in-memory, but the AOT cache persistence feature is enabled (-XX:+JITServerAOTCachePersistence), the server checks whether a file for that cache exists. If the AOT cache file exists, it is loaded in the background. If the AOT cache file does not exist or the AOT cache persistence feature is disabled (-XX:-JITServerAOTCachePersistence), the server creates an empty AOT cache and gradually populates it with AOT method bodies it compiles.

You can use the -XX:JITServerAOTCacheDir=<directory> option to specify the directory where the AOT cache must be saved to or loaded from.

The name of an AOT cache file has the following structure:

    JITServerAOTCache.<CACHE_NAME>.J<JAVA_VERSION>\n

Where,

"},{"location":"xxjitserveraotcachepersistence/#see-also","title":"See also","text":""},{"location":"xxjitserveraotmx/","title":"-XX:JITServerAOTmx","text":""},{"location":"xxjitserveraotmx/#-xxjitserveraotmx","title":"-XX:JITServerAOTmx","text":"

(Linux\u00ae only)

This option specifies the maximum amount of memory allocated to the JITServer AOT cache for storing the compiled code and for the associated data structures that are used in the cache's implementation.

"},{"location":"xxjitserveraotmx/#syntax","title":"Syntax","text":"
    -XX:JITServerAOTmx=<size>\n
Setting Effect Default -XX:JITServerAOTmx=<size> Limits the amount of memory used by the JITServer AOT cache 300 MB"},{"location":"xxjitserveraotmx/#explanation","title":"Explanation","text":"

When the JITServer receives an AOT compilation request, it checks its AOT cache for a compatible compiled method body. If one is not found, the server performs the AOT compilation, sends the response to the client JVM, then stores the compiled method in its local AOT cache, for future use. Multiple requests and storing of the compiled methods can use a lot of memory and degrade the system's overall performance.

You can specify the maximum memory limit for the AOT cache by using the -XX:JITServerAOTmx=<size> option, so that when the JITServer reaches that limit, it will not be able to add new AOT methods to its AOT cache. This will limit the amount of memory used for caching the compiled code and prevent memory shortages at JITServer that could lead to poor performance or even native out-of-memory events.

"},{"location":"xxjitserveraotmx/#see-also","title":"See also","text":""},{"location":"xxjitserverlocalsynccompiles/","title":"-XX:[+|-]JITServerLocalSyncCompiles","text":""},{"location":"xxjitserverlocalsynccompiles/#-xx-jitserverlocalsynccompiles","title":"-XX:[+|-]JITServerLocalSyncCompiles","text":"

When you specify this JITServer option, synchronous JIT compilations are downgraded to cold optimization level and compiled locally, with a remote asynchronous recompilation scheduled at a later point.

"},{"location":"xxjitserverlocalsynccompiles/#syntax","title":"Syntax","text":"
    -XX:[+|-]JITServerLocalSyncCompiles\n
Setting Effect Default -XX:+JITServerLocalSyncCompiles Enable yes -XX:-JITServerLocalSyncCompiles Disable

The option -XX:[+|-]JITServerLocalSyncCompiles is enabled by default in most cases. The option remains disabled when you specify -Xjit:count=0 and in a few advanced use cases such as running the JVM in debug mode (as described in the Improved JVM debug mode based on OSR post in the Eclipse OpenJ9\u2122 blog).

"},{"location":"xxjitserverlocalsynccompiles/#explanation","title":"Explanation","text":"

During a synchronous compilation, Java\u2122 application threads have to wait for the compilation to complete. Because remote compilations usually take longer, due to network latency, remote synchronous compilations can result in large pauses in the client application.

If you enable this option, the client performs synchronous compilations locally at cold optimization level and later recompiles asynchronously at a higher level remotely. This behavior can be beneficial for real-time applications.

"},{"location":"xxjitserverlocalsynccompiles/#see-also","title":"See also","text":""},{"location":"xxjitserverlogconnections/","title":"-XX:[+|-]JITServerLogConnections","text":""},{"location":"xxjitserverlogconnections/#-xx-jitserverlogconnections","title":"-XX:[+|-]JITServerLogConnections","text":"

This option enables the logging of connection/disconnection events between the JITServer server and the JITServer client. You can use the option on both the server and the client sides.

"},{"location":"xxjitserverlogconnections/#syntax","title":"Syntax","text":"
    -XX:[+|-]JITServerLogConnections\n
Setting Effect Default -XX:+JITServerLogConnections Enable -XX:-JITServerLogConnections Disable yes"},{"location":"xxjitserverlogconnections/#explanation","title":"Explanation","text":"

This option is useful when you need to know when the server and the client successfully establish or terminate connections but verbose logs provide too much information.

You can also enable the same logging by specifying the -Xjit:verbose={JITServerConns} option.

If you do not specify a vlog log file (-Xjit:vlog=<vlog_filename>), output is written to stderr, otherwise it is written to the vlog file.

"},{"location":"xxjitserverlogconnections/#example","title":"Example","text":"

This is what the typical output looks like:

On the server side:

#JITServer: t=  2318 A new client (clientUID=11937826481210274991) connected. Server allocated a new client session.\n...\n...\n#JITServer: t= 48518 Client (clientUID=4213447851416537492) disconnected. Client session deleted\n

On the client side:

#JITServer: t=     0 Connected to a server (serverUID=10444660844386807777)\n...\n...\n#JITServer: t=   698 Lost connection to the server (serverUID=10444660844386807777)\n
"},{"location":"xxjitserverlogconnections/#see-also","title":"See also","text":""},{"location":"xxjitservermetrics/","title":"-XX:JITServerMetrics","text":""},{"location":"xxjitservermetrics/#-xx-jitservermetrics","title":"-XX:[+|-]JITServerMetrics","text":"

This option enables the provision of JITServer performance metrics to a monitoring agent that follows the OpenMetrics standard.

When you enable this option, the following JITServer metrics are provided:

Note: You can use the -XX:JITServerMetricsSSLKey and -XX:JITServerMetricsSSLCert options for encrypting the data with SSL or TLS.

"},{"location":"xxjitservermetrics/#syntax","title":"Syntax","text":"
    -XX:[+|-]JITServerMetrics\n
Setting Effect Default -XX:+JITServerMetrics Enable -XX:-JITServerMetrics Disable yes"},{"location":"xxjitservermetrics/#explanation","title":"Explanation","text":"

When you enable this option, the JITServer process opens a TCP port, which can be used by monitoring agents (like Prometheus) to collect the custom metrics exported by the JITServer. Monitoring agents must issue HTTP GET requests to a URL of the form: http://<jitserveraddress>:<port>/metrics. The path for the HTTP request must be /metrics.

The default value of <port> is 38500. You can change this value by using the -XX:JITServerMetricsPort command line option.

The format for the metrics returned by the JITServer follows the OpenMetrics protocol.

"},{"location":"xxjitservermetrics/#example","title":"Example","text":"

The following example shows an HTTP request from a Prometheus monitoring agent and the response from the JITServer:

HTTP request:

GET /metrics HTTP/1.1 Host: 127.0.0.1:9403 User-Agent: Prometheus/2.31.1 Accept: application/openmetrics-text; version=0.0.1,text/plain;version=0.0.4;q=0.5,*/*;q=0.1 Accept-Encoding: gzip X-Prometheus-Scrape-Timeout-Seconds: 3

JITServer response:

# HELP jitserver_cpu_utilization Cpu utilization of the JITServer # TYPE jitserver_cpu_utilization gauge jitserver_cpu_utilization 12.000000 # HELP jitserver_available_memory Available memory for JITServer # TYPE jitserver_available_memory gauge jitserver_available_memory 32036204544.000000 # HELP jitserver_connected_clients Number of connected clients # TYPE jitserver_connected_clients gauge jitserver_connected_clients 1.000000 # HELP jitserver_active_threads Number of active compilation threads # TYPE jitserver_active_threads gauge jitserver_active_threads 1.000000

"},{"location":"xxjitservermetrics/#see-also","title":"See also","text":""},{"location":"xxjitservermetricsport/","title":"-XX:JITServerMetricsPort","text":""},{"location":"xxjitservermetricsport/#-xxjitservermetricsport","title":"-XX:JITServerMetricsPort","text":"

This option specifies the port number on which the JITServer metrics are provided to a monitoring agent.

Use this option with the -XX:+JITServerMetrics option, which enables the provision of the JITServer metrics.

"},{"location":"xxjitservermetricsport/#syntax","title":"Syntax","text":"
    -XX:JITServerMetricsPort=<port>\n
Setting Effect Default -XX:JITServerMetricsPort Set JITServer port for metrics 38500"},{"location":"xxjitservermetricsport/#see-also","title":"See also","text":""},{"location":"xxjitservermetricssslkey/","title":"-XX:JITServerMetricsSSLCert","text":""},{"location":"xxjitservermetricssslkey/#-xxjitservermetricssslkey-xxjitservermetricssslcert","title":"-XX:JITServerMetricsSSLKey / -XX:JITServerMetricsSSLCert","text":"

These options specify the names of the files that contain the private TLS or SSL key and certificate that are used for authentication and encryption of the custom metrics.

"},{"location":"xxjitservermetricssslkey/#syntax","title":"Syntax","text":"
    -XX:JITServerMetricsSSLKey=<key_file>\n    -XX:JITServerMetricsSSLCert=<cert_file>\n

Where <key_file> specifies the name of the file that contains the private TLS or SSL key and <cert_file> specifies the name of the file that contains the private TLS or SSL certificate. The files must all be in .pem file format.

Setting Effect Default -XX:JITServerMetricsSSLKey Set metrics SSL key None -XX:JITServerMetricsSSLCert Set metrics SSL certificate None"},{"location":"xxjitservermetricssslkey/#explanation","title":"Explanation","text":"

Custom metrics are exported by the JITServer server and collected by a monitoring agent, such as Prometheus. The exported data is sent in clear text by default. To secure this data with TLS or SSL authentication and encryption, specify the private key (<key>.pem) and the certificate (<cert>.pem) at the server:

    -XX:JITServerMetricsSSLKey=<key>.pem -XX:JITServerMetricsSSLCert=<cert>.pem\n

You must specify both the options for TLS or SSL authentication and encryption.

Note: To enable the export of custom metrics, you must specify the -XX:[+|-]JITServerMetrics option.

"},{"location":"xxjitservermetricssslkey/#see-also","title":"See also","text":""},{"location":"xxjitserverport/","title":"-XX:JITServerPort","text":""},{"location":"xxjitserverport/#-xxjitserverport","title":"-XX:JITServerPort","text":"

This option specifies the port on which the JITServer server listens for compilation requests.

On the JITServer server, this option sets the port that is open for connections.

On the JITServer client, this option specifies to which server port the client should send compilation requests.

"},{"location":"xxjitserverport/#syntax","title":"Syntax","text":"
    -XX:JITServerPort=<port>\n
Setting Effect Default -XX:JITServerPort Set JITServer port 38400"},{"location":"xxjitserverport/#see-also","title":"See also","text":""},{"location":"xxjitservershareromclasses/","title":"-XX:JITServerShareROMClasses","text":""},{"location":"xxjitservershareromclasses/#-xx-jitservershareromclasses","title":"-XX:[+|-]JITServerShareROMClasses","text":"

This option enables or disables the JITServer server to share cached ROM classes between JITServer clients.

"},{"location":"xxjitservershareromclasses/#syntax","title":"Syntax","text":"
    -XX:[+|-]JITServerShareROMClasses\n
Setting Effect Default -XX:+JITServerShareROMClasses Enable yes -XX:-JITServerShareROMClasses Disable

Note: The JITServer AOT caching feature is now enabled at the server by default with the -XX:+JITServerUseAOTCache option. Because the -XX:+JITServerShareROMClasses option is a prerequisite for the -XX:+JITServerUseAOTCache option, therefore the -XX:+JITServerShareROMClasses option is also the default setting. If you disabled the JITServer AOT cache at the server (-XX:-JITServerUseAOTCache), specify the -XX:+JITServerShareROMClasses option explicitly to enable the sharing of the cached ROM classes feature.

"},{"location":"xxjitservershareromclasses/#explanation","title":"Explanation","text":"

Enable this option when multiple clients that are running identical or similar applications connect to a single server.

This option enables a caching optimization that allows the server to use ROM classes that are cached for one client while compiling for a different client. This behavior reduces the memory usage at the server because only a single copy of a particular Java\u2122 class is cached.

"},{"location":"xxjitservershareromclasses/#see-also","title":"See also","text":""},{"location":"xxjitserversslcert/","title":"-XX:JITServerSSLCert","text":""},{"location":"xxjitserversslcert/#-xxjitserversslcert-xxjitserversslkey-xxjitserversslrootcerts","title":"-XX:JITServerSSLCert / -XX:JITServerSSLKey / -XX:JITServerSSLRootCerts","text":"

Options for encrypting network communication between JITServer servers and JITServer client VMs.

"},{"location":"xxjitserversslcert/#syntax","title":"Syntax","text":"
    -XX:JITServerCert=<cert_file>\n    -XX:JITServerKey=<key_file>\n    -XX:JITServerSSLRootCerts=<root_certs_file>\n

The files must all be in .pem file format.

Setting Effect Default -XX:JITServerSSLCert Set server's SSL certificate None -XX:JITServerSSLKey Set server's SSL key None -XX:JITServerSSLRootCerts Set client's SSL root certificate None"},{"location":"xxjitserversslcert/#explanation","title":"Explanation","text":"

You can encrypt network communication by using OpenSSL 1.0.x, 1.1.x, or 3.x. To enable encryption, specify the private key (<key>.pem) and the certificate (<cert>.pem) at the server:

-XX:JITServerSSLKey=<key>.pem -XX:JITServerSSLCert=<cert>.pem\n

and use the certificate at the client:

-XX:JITServerSSLRootCerts=<cert>.pem\n

You must specify all three options for the client to be able to connect to the server. If the client cannot connect, it is forced to perform all compilations locally instead.

For more details and further discussion about security considerations, see the blog post Free your JVM from the JIT with JITServer Technology.

"},{"location":"xxjitserversslcert/#see-also","title":"See also","text":""},{"location":"xxjitservertimeout/","title":"-XX:JITServerTimeout","text":""},{"location":"xxjitservertimeout/#-xxjitservertimeout","title":"-XX:JITServerTimeout","text":"

This option specifies the socket timeout for JITServer communication.

You can specify this option on both the server and the client sides.

"},{"location":"xxjitservertimeout/#syntax","title":"Syntax","text":"
    -XX:JITServerTimeout=<timeout_ms>\n
Setting Effect Default -XX:JITServerTimeout Set the timeout value in milliseconds for socket operations 30000 ms for the JITServer process and 10000 ms when Eclipse OpenJ9\u2122 is launched as a client VM"},{"location":"xxjitservertimeout/#see-also","title":"See also","text":""},{"location":"xxjitserveruseaotcache/","title":"-XX:[+|-]JITServerUseAOTCache","text":""},{"location":"xxjitserveruseaotcache/#-xx-jitserveruseaotcache","title":"-XX:[+|-]JITServerUseAOTCache","text":"

This option enables or disables the caching of AOT-compiled methods in the JITServer server.

"},{"location":"xxjitserveruseaotcache/#syntax","title":"Syntax","text":"
    -XX:[+|-]JITServerUseAOTCache\n
Setting Effect Default -XX:+JITServerUseAOTCache Enable yes -XX:-JITServerUseAOTCache Disable"},{"location":"xxjitserveruseaotcache/#explanation","title":"Explanation","text":"

When you enable this option, the JITServer server caches the AOT-compiled methods. When a JITServer client requests an AOT compilation and the requested method exists in the cache, the server does not have to recompile the method. This feature, therefore, improves the CPU utilization of the JITServer technology and of the cluster.

Note: This option must be enabled both at the client JVM and at the server. Although this option is by default enabled at the server, it is still disabled for the JITServer clients. That means that you don't have to specify the -XX:+JITServerUseAOTCache option at the server to enable the JITServer AOT caching feature, but you must specify this option for each client who wants to use this feature.

The -XX:+JITServerShareROMClasses option is also enabled by default at the server because this option is a prerequisite for the -XX:+JITServerUseAOTCache option.

"},{"location":"xxjitserveruseaotcache/#see-also","title":"See also","text":""},{"location":"xxlazysymbolresolution/","title":"-XX:[+|-]LazySymbolResolution","text":""},{"location":"xxlazysymbolresolution/#-xx-lazysymbolresolution","title":"-XX:[+|-]LazySymbolResolution","text":"

(Linux\u00ae and macOS\u00ae only)

This option affects the timing of symbol resolution for functions in user native libraries.

"},{"location":"xxlazysymbolresolution/#syntax","title":"Syntax","text":"
    -XX:[+|-]LazySymbolResolution\n
Setting Effect Default -XX:+LazySymbolResolution Enable yes -XX:-LazySymbolResolution Disable"},{"location":"xxlazysymbolresolution/#explanation","title":"Explanation","text":"

Enabling this option forces the VM to delay symbol resolution for each function in a user native library, until the function is called. The -XX:-LazySymbolResolution option forces the VM to immediately resolve symbols for all functions in a user native library when the library is loaded.

These options apply only to functions; variable symbols are always resolved immediately when loaded. If you attempt to use these options on an operating system other than Linux or macOS, the options are accepted, but ignored.

"},{"location":"xxlegacyxlogoption/","title":"-XX:[+|-]LegacyXLogOption","text":""},{"location":"xxlegacyxlogoption/#-xx-legacyxlogoption","title":"-XX:[+|-]LegacyXlogOption","text":"

Controls processing of the -Xlog option.

"},{"location":"xxlegacyxlogoption/#syntax","title":"Syntax","text":"Setting Effect Default -XX:+LegacyXlogOption Enable legacy -Xlog behavior -XX:-LegacyXlogOption Process -Xlog requests for GC logging yes"},{"location":"xxlegacyxlogoption/#explanation","title":"Explanation","text":"

From Eclipse OpenJ9\u2122 0.24.0, the -Xlog option is replaced by the -Xsyslog option. The -XX:[+|-]LegacyXlogOption controls how the -Xlog option is processed.

"},{"location":"xxmaxdirectmemorysize/","title":"-XX:MaxDirectMemorySize","text":""},{"location":"xxmaxdirectmemorysize/#-xxmaxdirectmemorysize","title":"-XX:MaxDirectMemorySize","text":"

This Oracle HotSpot option sets a limit on the amount of memory that can be reserved for all Direct Byte Buffers.

"},{"location":"xxmaxdirectmemorysize/#syntax","title":"Syntax","text":"
-XX:MaxDirectMemorySize=<size>\n
Setting Value Default <size> [1[k|K|m|M|g|G] or greater] Depends on maximum heap size

The value you choose is the limit on memory that can be reserved for all Direct Byte Buffers. If a value is set for this option, the sum of all Direct Byte Buffer sizes cannot exceed the limit. After the limit is reached, a new Direct Byte Buffer can be allocated only when enough old buffers are freed to provide enough space to allocate the new buffer.

By default, the amount of native memory used for Direct Byte Buffers is limited to 87.5% of the maximum heap size.

By default, the amount of native memory used for Direct Byte Buffers is limited to the maximum heap size.

"},{"location":"xxmergecompileroptions/","title":"-XX:[+|-]MergeCompilerOptions","text":""},{"location":"xxmergecompileroptions/#-xx-mergecompileroptions","title":"-XX:[+|-]MergeCompilerOptions","text":"

This option enables or disables the merging of multiple -Xjit or -Xaot options into a single -Xjit or -Xaot option.

"},{"location":"xxmergecompileroptions/#syntax","title":"Syntax","text":"
    -XX:[+|-]MergeCompilerOptions\n
Setting Effect Default -XX:+MergeCompilerOptions Enable -XX:-MergeCompilerOptions Disable yes"},{"location":"xxmergecompileroptions/#explanation","title":"Explanation","text":"

By default, if you specify -Xjit option (or -Xaot option) multiple times, only the last option takes effect. Therefore, on adding an -Xjit option, the resultant behavior might not be as expected, if any instance of this option already exists. It is time-consuming to find the existing instances and try combining them manually so that the system behaves as required.

You can use the -XX:+MergeCompilerOptions option to merge all the existing instances of the -Xjit options logically. To retain the default behavior, whereby only the last option takes effect, you can use the -XX:-MergeCompilerOptions option.

If both -Xjit and -Xaot options exist and you use the -XX:+MergeCompilerOptions option, then multiple -Xjit options are merged into a single -Xjit option and multiple -Xaot options are merged into a single -Xaot option.

"},{"location":"xxmergecompileroptions/#examples","title":"Examples","text":""},{"location":"xxmergecompileroptions/#one-xjit-option","title":"One -Xjit option","text":"
java -Xshareclasses:none  -Xjit:version -version\n

-Xjit option that is applied - version

java -XX:+MergeCompilerOptions -Xshareclasses:none  -Xjit:version -version\n

-Xjit option that is applied - version

java -XX:-MergeCompilerOptions -Xshareclasses:none  -Xjit:version -version\n

-Xjit option that is applied - version

"},{"location":"xxmergecompileroptions/#multiple-xjit-options","title":"Multiple -Xjit options","text":"
java -Xshareclasses:none '-Xjit:verbose={compilePerformance},vlog=vlog' -Xjit:version -version\n

-Xjit option that is applied - version

java -XX:+MergeCompilerOptions -Xshareclasses:none '-Xjit:verbose={compilePerformance},vlog=vlog' -Xjit:version -version\n

-Xjit options that are applied - verbose={compilePerformance},vlog=vlog,version

java -XX:-MergeCompilerOptions -Xshareclasses:none '-Xjit:verbose={compilePerformance},vlog=vlog' -Xjit:version -version\n

-Xjit option that is applied - version

"},{"location":"xxmergecompileroptions/#both-xxmergecompileroptions-and-xx-mergecompileroptions","title":"Both -XX:+MergeCompilerOptions and -XX:-MergeCompilerOptions","text":"

If there are multiple -XX:[+|-]MergeCompilerOptions options with multiple -Xjit options, the last -XX:[+|-]MergeCompilerOptions setting takes effect before the -Xjit options are processed.

java -XX:+MergeCompilerOptions -XX:-MergeCompilerOptions -Xshareclasses:none '-Xjit:verbose={compilePerformance},vlog=vlog' -Xjit:version -version\n

-Xjit option that is applied - version

java -XX:-MergeCompilerOptions -XX:+MergeCompilerOptions -Xshareclasses:none '-Xjit:verbose={compilePerformance},vlog=vlog' -Xjit:version -version\n

-Xjit options that are applied - {compilePerformance},vlog=vlog,version

"},{"location":"xxmergecompileroptions/#see-also","title":"See also","text":""},{"location":"xxnosuballoc32bitmem/","title":"-XXnosuballoc32bitmem","text":""},{"location":"xxnosuballoc32bitmem/#-xxnosuballoc32bitmem","title":"-XXnosuballoc32bitmem","text":"

(z/OS\u00ae only)

When compressed references are used with a 64-bit Eclipse OpenJ9\u2122 VM on z/OS\u00ae, this option forces the VM to use 31-bit memory allocation functions provided by z/OS.

"},{"location":"xxnosuballoc32bitmem/#syntax","title":"Syntax","text":"
    -XXnosuballoc32bitmem\n
Setting Effect Default -XXnosuballoc32bitmem Enable No setting Disable yes"},{"location":"xxnosuballoc32bitmem/#explanation","title":"Explanation","text":"

This option is provided as a workaround for customers who need to use fewer pages of 31-bit virtual storage per VM invocation. Using this option might result in a small increase in the number of frames of central storage used by the VM. However, the option frees 31-bit pages for use by native code or other applications in the same address space.

If this option is not specified, the VM uses an allocation strategy for 31-bit memory that reserves a region of 31-bit virtual memory.

"},{"location":"xxonoutofmemoryerror/","title":"-XX:OnOutOfMemoryError","text":""},{"location":"xxonoutofmemoryerror/#-xxonoutofmemoryerror","title":"-XX:OnOutOfMemoryError","text":"

You can use this Oracle HotSpot option to run commands when a java.lang.OutOfMemoryError is thrown. This option is recognized by Eclipse OpenJ9\u2122 and provided for compatibility.

"},{"location":"xxonoutofmemoryerror/#syntax","title":"Syntax","text":"
    -XX:OnOutOfMemoryError=\"<command_string>\"\n

where <command_string> is a command or list of commands to run when a java.lang.OutOfMemoryError occurs.

For example, the following command specifies that the java -version command is run if the Test application throws a java.lang.OutOfMemoryError exception:

java -XX:OnOutOfMemoryError=\"java -version\" Test

If you want to run multiple commands, use semicolons to separate them within <command_string>. For example:

-XX:OnOutOfMemoryError=\"<java_path> <java_program>; cat file.txt\"

The -XX:OnOutOfMemoryError option is equivalent to the following -Xdump option:

-Xdump:tool:events=systhrow,filter=java/lang/OutOfMemoryError,exec=<command_string>

For more information, see -Xdump.

"},{"location":"xxopenj9commandlineenv/","title":"-XX:[+|-]OpenJ9CommandLineEnv","text":""},{"location":"xxopenj9commandlineenv/#-xx-openj9commandlineenv","title":"-XX:[+|-]OpenJ9CommandLineEnv","text":"

This option controls whether the VM captures the command line in the environment variable OPENJ9_JAVA_COMMAND_LINE. If enabled, the variable is set by the VM after it starts. Using this variable, you can find the command-line parameters set when the VM started. It applies not just to launchers (e.g. java) that are included in a JDK, but to any application that uses JNI_CreateJavaVM().

"},{"location":"xxopenj9commandlineenv/#syntax","title":"Syntax","text":"
    -XX:[+|-]OpenJ9CommandLineEnv\n
Setting Effect Default on z/OS Default on other platforms -XX:+OpenJ9CommandLineEnv Enable yes -XX:-OpenJ9CommandLineEnv Disable yes

This option is currently disabled by default on z/OS\u00ae because it might cause the VM to crash.

"},{"location":"xxopenj9commandlineenv/#see-also","title":"See also","text":""},{"location":"xxoriginaljdk8heapsizecompatibilitymode/","title":"-XX:[+|-]OriginalJDK8HeapSizeCompatibilityMode","text":""},{"location":"xxoriginaljdk8heapsizecompatibilitymode/#-xx-originaljdk8heapsizecompatibilitymode","title":"-XX:[+|-]OriginalJDK8HeapSizeCompatibilityMode","text":"

The default value for the maximum heap size (-Xmx) is 25% of the available memory with a maximum of 25 GB. However, where there is 2 GB or less of physical memory, the value set is 50% of available memory with a minimum value of 16 MB and a maximum value of 512 MB. In Eclipse OpenJ9\u2122 0.18.0 and earlier releases the default is half the available memory with a minimum of 16 MB and a maximum of 512 MB. Enable this option to revert to the earlier default value.

Restriction: This option is supported only on Java\u2122 8. It is ignored on Java 11 and later versions.

"},{"location":"xxoriginaljdk8heapsizecompatibilitymode/#syntax","title":"Syntax","text":"
-XX:[+|-]OriginalJDK8HeapSizeCompatibilityMode\n
Setting Effect Default -XX:+OriginalJDK8HeapSizeCompatibilityMode Enable -XX:-OriginalJDK8HeapSizeCompatibilityMode Disable yes"},{"location":"xxpagealigndirectmemory/","title":"-XX:[+|-]PageAlignDirectMemory","text":""},{"location":"xxpagealigndirectmemory/#-xx-pagealigndirectmemory","title":"-XX:[+|-]PageAlignDirectMemory","text":"

This Oracle HotSpot option affects the alignment of direct byte buffer allocation and is implemented by the Eclipse OpenJ9\u2122 VM for compatibility.

"},{"location":"xxpagealigndirectmemory/#syntax","title":"Syntax","text":"
    -XX:[+|-]PageAlignDirectMemory\n
Setting Effect Default -XX:+PageAlignDirectMemory Enable -XX:-PageAlignDirectMemory Disable yes

As discussed in the Oracle documentation, before Java\u2122 SE 7, direct buffers that were allocated using java.nio.ByteBuffer.allocateDirect(int) were aligned on a page boundary. This behavior changed in Java SE 7 and the -XX:+PageAlignDirectMemory option is provided to revert to the previous behavior.

For more information about the changes, see RFE 4837564, which was introduced in the Java SE 7 release notes.

"},{"location":"xxparallelcmsthreads/","title":"-XX:ParallelCMSThreads","text":""},{"location":"xxparallelcmsthreads/#-xxparallelcmsthreads","title":"-XX:ParallelCMSThreads","text":"

This Oracle HotSpot option affects the number of threads used by the concurrent garbage collector. This option is recognized by Eclipse OpenJ9\u2122 and provided for compatibility.

"},{"location":"xxparallelcmsthreads/#syntax","title":"Syntax","text":"
    -XX:ParallelCMSThreads=<number>\n

Where <number> is the number of low-priority background threads that are attached to assist the mutator threads in concurrent mark.

Within OpenJ9 this option is directly mapped to -Xconcurrentbackground.

"},{"location":"xxparallelgcmaxthreads/","title":"-XX:ParallelGCMaxThreads","text":""},{"location":"xxparallelgcmaxthreads/#-xxparallelgcmaxthreads","title":"-XX:ParallelGCMaxThreads","text":"

This option specifies the maximum number of threads that can be used during parallel operations of the garbage collector. Unlike -XX:ParallelGCThreads, this option does not enforce a thread count, but can be used to allow the garbage collector to adjust the number of parallel GC threads, if used with the Adaptive GC Threading option.

"},{"location":"xxparallelgcmaxthreads/#syntax","title":"Syntax","text":"
    -XX:ParallelGCMaxThreads=<number>\n

Where <number> is the maximum number of threads that can be used for parallel operations.

This option is directly mapped to -Xgcmaxthreads.

"},{"location":"xxparallelgcthreads/","title":"-XX:ParallelGCThreads","text":""},{"location":"xxparallelgcthreads/#-xxparallelgcthreads","title":"-XX:ParallelGCThreads","text":"

This Oracle HotSpot option specifies the number of threads that are used during parallel operations of the default garbage collector. This option is recognized by Eclipse OpenJ9\u2122 and provided for compatibility.

Notes:

This option enforces the thread count and cannot be used with the -XX:+AdaptiveGCThreading option, which enables the garbage collector to adjust the number of parallel threads based on heuristics. If you want to use -XX:+AdaptiveGCThreading, use -XX:ParallelGCMaxThreads instead of -XX:ParallelGCThreads.

"},{"location":"xxparallelgcthreads/#syntax","title":"Syntax","text":"
    -XX:ParallelGCThreads=<number>\n

Where <number> is the number of threads that are used for parallel operations.

Within OpenJ9 this option is directly mapped to -Xgcthreads.

"},{"location":"xxperftool/","title":"-XX:[+|-]PerfTool","text":""},{"location":"xxperftool/#-xx-perftool","title":"-XX:[+|-]PerfTool","text":"

This option enables or disables JIT support for the perf tool without affecting the existing Xjit options.

Restriction: Since this option creates a file that is used by the Linux\u00ae system profiler, perf, it applies only to Linux.

"},{"location":"xxperftool/#syntax","title":"Syntax","text":"
    -XX:[+|-]PerfTool\n
Setting Effect Default -XX:+PerfTool Enable -XX:-PerfTool Disable yes"},{"location":"xxperftool/#explanation","title":"Explanation","text":"

The -XX:+PerfTool option is a stand-alone alternative for the existing -Xjit:perfTool option. If multiple -Xjit options exist, only the last option takes effect. Therefore, if the -Xjit:perfTool option is added later, it overrides the existing -Xjit options. To overcome this issue, the XX:+PerfTool option enables JIT support for the perf tool without having any impact on the existing Xjit options. This enabling option creates a /tmp/perf-<pid>.map file that is used by the perf tool to map the samples in the JIT-compiled code to the corresponding Java method names.

To disable the JIT support for the perf tool, set the -XX:-PerfTool option on the command line.

"},{"location":"xxperftool/#see-also","title":"See also","text":""},{"location":"xxportablesharedcache/","title":"-XX:[+|-]PortableSharedCache","text":""},{"location":"xxportablesharedcache/#-xx-portablesharedcache","title":"-XX:[+|-]PortableSharedCache","text":"

Use this command line option to choose whether AOT-compiled code should be portable.

This option, when enabled, increases the portability of AOT-compiled code, in the following ways:

This feature is particularly relevant for packaging a shared classes cache into a container image (for example, applications deployed on the cloud in the form of Docker containers) due to the following reasons: - The processor on which the container image is built is likely to be different from the processor on which the container is deployed. - In a multi-layered container image where the shared classes cache is multi-layered as well, the AOT-compiled code in shared classes cache will likely come from multiple OpenJ9 VMs with different heap size requirements.

"},{"location":"xxportablesharedcache/#syntax","title":"Syntax","text":"
    -XX:[+|-]PortableSharedCache\n
Setting Effect Default -XX:+PortableSharedCache Enable See notes that follow -XX:-PortableSharedCache Disable"},{"location":"xxportablesharedcache/#default-settings","title":"Default settings","text":"

This option is enabled by default in containers. To disable the option in a container, specify -XX:-PortableSharedCache.

The option is disabled by default outside containers. To enable the option outside a container, specify -XX:+PortableSharedCache for the initial JVM instance (when the creation of the shared classes cache happens) as well as for every subsequent instance that makes use of the same shared classes cache.

"},{"location":"xxpositiveidentityhash/","title":"-XX:[+|-]PositiveIdentityHash","text":""},{"location":"xxpositiveidentityhash/#-xx-positiveidentityhash","title":"-XX:[+|-]PositiveIdentityHash","text":"

Eclipse OpenJ9\u2122 allows both positive and negative identity hashcodes (System.identityHashCode / Object.hashCode). This is problematic for programs that incorrectly assume hashcodes can only be positive.

When enabled, this option limits identity hash codes to non-negative values.

Because limiting identity hash codes to non-negative values can have an impact on the performance of hash-intensive operations, this option is not enabled by default.

"},{"location":"xxpositiveidentityhash/#syntax","title":"Syntax","text":"
    -XX:[+|-]PositiveIdentityHash\n
Setting Effect Default -XX:+PositiveIdentityHash Enable -XX:-PositiveIdentityHash Disable yes"},{"location":"xxprintcodecache/","title":"-XX:[+|-]PrintCodeCache","text":""},{"location":"xxprintcodecache/#-xx-printcodecache","title":"-XX:[+|-]PrintCodeCache","text":"

This Oracle HotSpot option prints the code cache memory usage when the application exits. This option is recognized by Eclipse OpenJ9\u2122 and provided for compatibility.

"},{"location":"xxprintcodecache/#syntax","title":"Syntax","text":"
    -XX:[+|-]PrintCodeCache\n
Setting Effect Default -XX:+PrintCodeCache Enable -XX:-PrintCodeCache Disable yes

As discussed in the Oracle documentation, the code cache usage can be shown when the application exits, by specifying \u2013XX:+PrintCodeCache on the Java launcher command line. The output looks similar to the following:

CodeCache: size=262144Kb used=454Kb max_used=457Kb free=261690Kb\n
"},{"location":"xxprintflagsfinal/","title":"-XX:[+|-]PrintFlagsFinal","text":""},{"location":"xxprintflagsfinal/#-xx-printflagsfinal","title":"-XX:[+|-]PrintFlagsFinal","text":"

When enabled, this option outputs the values of a subset of configuration parameters in a format compatible with that produced by HotSpot. The parameters currently output are those expected by various software projects and packages.

"},{"location":"xxprintflagsfinal/#syntax","title":"Syntax","text":"
    -XX:[+|-]PrintFlagsFinal\n
Setting Effect Default -XX:+PrintFlagsFinal Enable -XX:-PrintFlagsFinal Disable yes"},{"location":"xxprintflagsfinal/#example","title":"Example","text":"

Here is an example of typical output from -XX:+PrintFlagsFinal:

[Global flags]\n   size_t MaxHeapSize              = 4294967296          {product} {ergonomic}\n uint64_t MaxDirectMemorySize      = 3758096384          {product} {ergonomic}\n
"},{"location":"xxreadipinfoforras/","title":"-XX:[+|-]ReadIPInfoForRAS","text":""},{"location":"xxreadipinfoforras/#-xx-readipinfoforras","title":"-XX:[+|-]ReadIPInfoForRAS","text":"

Use this command-line option to enable and disable network queries from being used to determine the host name and IP address for RAS (reliability, availability, and serviceability) troubleshooting purposes.

"},{"location":"xxreadipinfoforras/#syntax","title":"Syntax","text":"
    -XX:[+|-]ReadIPInfoForRAS\n
Setting Effect Default -XX:+ReadIPInfoForRAS Enable yes -XX:-ReadIPInfoForRAS Disable

Eclipse OpenJ9\u2122 captures the host name and IP address by default, for use in diagnosing problems. But if a nameserver cannot be contacted when a network query is made, the program will wait until the resolver times out.

You can avoid this situation by using the -XX:-ReadIPInfoForRAS command-line option to prevent the query from being performed.

"},{"location":"xxreducecpumonitoroverhead/","title":"-XX:[+|-]ReduceCPUMonitorOverhead","text":""},{"location":"xxreducecpumonitoroverhead/#-xx-reducecpumonitoroverhead","title":"-XX:[+|-]ReduceCPUMonitorOverhead","text":"

(AIX\u00ae, Linux\u00ae, macOS\u00ae, and Windows\u2122 only)

This option relates to the CPU usage of thread categories that can be obtained with the com.ibm.lang.management.JvmCpuMonitorMXBean application programming interface. This option affects the way that the VM records the amount of CPU usage of non-Garbage Collection (GC) threads that do work on behalf of GC.

Most GC policies require non-GC threads to do some GC housekeeping work in proportion to the amount of memory allocation that they do. Ideally the exact amount of CPU time that the thread spends doing this housekeeping work should be accounted for in the GC thread category. However there is an overhead that is associated with maintaining the CPU usage data in the correct thread category.

Restriction: This option is not supported on z/OS\u00ae. If you attempt to use this option, the following message is generated:

JVMJ9VM145E -XX:-ReduceCPUMonitorOverhead is unsupported on z/OS. Error: Could not create the Java Virtual Machine.\n
"},{"location":"xxreducecpumonitoroverhead/#syntax","title":"Syntax","text":"

-XX:[+|-]ReduceCPUMonitorOverhead

Setting Effect Default -XX:+ReduceCPUMonitorOverhead Enable yes -XX:-ReduceCPUMonitorOverhead Disable

When you enable this option, the VM does not maintain information on the amount of CPU usage that non-GC threads spend in doing work on behalf of GC. If you set -XX:-ReduceCPUMonitorOverhead, the Eclipse OpenJ9\u2122 VM monitors the amount of GC work that a non-GC thread does and accounts for it in the GC category. This information is made available in the com.ibm.lang.management.JvmCpuMonitorMXBean. Setting this option results in a small increase in application startup time, which varies according to platform.

"},{"location":"xxreducecpumonitoroverhead/#see-also","title":"See also","text":""},{"location":"xxrequirejitserver/","title":"-XX:[+|-]RequireJITServer","text":""},{"location":"xxrequirejitserver/#-xx-requirejitserver","title":"-XX:[+|-]RequireJITServer","text":"

When you enable this option, the JITServer client crashes with an assert if it detects that a JITServer server is unavailable.

"},{"location":"xxrequirejitserver/#syntax","title":"Syntax","text":"
    -XX:[+|-]RequireJITServer\n
Setting Effect Default -XX:+RequireJITServer Enable -XX:-RequireJITServer Disable yes"},{"location":"xxrequirejitserver/#explanation","title":"Explanation","text":"

This option is for debugging purposes only.

When this option is disabled, a server crash forces the client to perform compilations locally. You might want to enable this option if you are running a test suite with JITServer enabled, so that a test fails if the server crashes, instead of switching to local compilations and hiding the failure.

"},{"location":"xxrequirejitserver/#see-also","title":"See also","text":""},{"location":"xxruntimeinstrumentation/","title":"-XX:[+|-]RuntimeInstrumentation","text":""},{"location":"xxruntimeinstrumentation/#-xx-runtimeinstrumentation","title":"-XX:[+|-]RuntimeInstrumentation","text":"

(AIX\u00ae, Linux\u00ae, and z/OS\u00ae only)

This option controls the use of the Runtime Instrumentation (RI) facility in the virtual machines that support it.

The RI facility is a feature that is available in POWER8\u00ae, zEC12, and later processors that offers hardware support for collecting profiling information at run time. The process uses minimal resources. The use of the RI facility is not enabled by default.

"},{"location":"xxruntimeinstrumentation/#syntax","title":"Syntax","text":"
    -XX:[+|-]RuntimeInstrumentation\n
Setting Effect Default -XX:+RuntimeInstrumentation Enable -XX:-RuntimeInstrumentation Disable yes

Note: On Linux, the RI facility on Power 8 and later processors uses the Performance Monitoring Unit (PMU) inside the processor. However, the PMU is also used by system profilers like oprofile or perf. Due to the current Linux kernel implementation, a user cannot reliably profile a Java\u2122 application when RI is enabled. Although this limitation might be addressed in future Linux kernels, for reliable profiling on Power systems that use Linux, the -XX:-RuntimeInstrumentation option must be used.

"},{"location":"xxsethwprefetch/","title":"-XXsetHWPrefetch","text":""},{"location":"xxsethwprefetch/#-xxsethwprefetch","title":"-XXsetHWPrefetch","text":"

(AIX\u00ae only)

This option enables or disables hardware prefetch. Hardware prefetch can improve the performance of applications by prefetching memory. However, because of the workload characteristics of many Java\u2122 applications, prefetching often has an adverse effect on performance.

"},{"location":"xxsethwprefetch/#syntax","title":"Syntax","text":"
    -XXsetHWPrefetch=[none|os-default]\n
Setting Effect Default none Disable yes os-default Enable

The -XXsetHWPrefetch:none option disables hardware prefetch. Although you can disable hardware prefetch on AIX by issuing the command dscrctl -n -s 1, this command disables hardware prefetch for all processes, and for all future processes, which might not be desirable in a mixed workload environment. The -XXsetHWPrefetch:none option allows hardware prefetch to be disabled for individual VMs.

To enable hardware prefetch with the default value for the operating system, specify -XXsetHWPrefetch:os-default. Use this option only for applications that can obtain a performance gain from hardware prefetch.

"},{"location":"xxshareanonymousclasses/","title":"-XX:[+|-]ShareAnonymousClasses","text":""},{"location":"xxshareanonymousclasses/#-xx-shareanonymousclasses","title":"-XX:[+|-]ShareAnonymousClasses","text":"

This option enables or disables the storage of VM anonymous classes, those created by Unsafe.defineAnonymousClass, in the shared classes cache.

In OpenJDK 15 and later versions, this option also enables or disables the storage of hidden classes in the shared classes cache.

The option is enabled by default, which means that anonymous classes (and hidden classes, in OpenJDK 15 and later) are stored in the shared classes cache and are therefore available for ahead-of-time (AOT) compilation, potentially improving startup performance.

"},{"location":"xxshareanonymousclasses/#syntax","title":"Syntax","text":"
    -XX:[+|-]ShareAnonymousClasses\n
Setting Effect Default -XX:+ShareAnonymousClasses Enable yes -XX:-ShareAnonymousClasses Disable"},{"location":"xxshareanonymousclasses/#see-also","title":"See also","text":""},{"location":"xxshareclassesenablebci/","title":"-XX:ShareClassesDisableBCI","text":""},{"location":"xxshareclassesenablebci/#-xxshareclassesdisablebci-xxshareclassesenablebci","title":"-XX:ShareClassesDisableBCI / -XX:ShareClassesEnableBCI","text":"

The option -Xshareclasses:enableBCI improves startup performance without using a modification context, when using JVMTI class modification. This suboption allows classes loaded from the shared cache to be modified using a JVMTI ClassFileLoadHook, or a java.lang.instrument agent, and prevents modified classes being stored in the shared classes cache. You can turn off this option by specifying -XX:ShareClassesDisableBCI when you start your Java\u2122 application.

"},{"location":"xxshareclassesenablebci/#syntax","title":"Syntax","text":"
    -XX:ShareClassesDisableBCI|ShareClassesEnableBCI\n
Setting Effect Default -XX:ShareClassesDisableBCI Disable -XX:ShareClassesEnableBCI Enable yes

These options are equivalent to -Xshareclasses:disableBCI and -Xshareclasses:enableBCI. For more information, see -Xshareclasses.

"},{"location":"xxshareclassesenablebci/#see-also","title":"See also","text":""},{"location":"xxsharedcachehardlimit/","title":"-XX:SharedCacheHardLimit","text":""},{"location":"xxsharedcachehardlimit/#-xxsharedcachehardlimit","title":"-XX:SharedCacheHardLimit","text":"

Specifies the size for a new shared classes cache. Use this option together with the -Xscmx option to set actual and soft maximum size limits respectively.

"},{"location":"xxsharedcachehardlimit/#syntax","title":"Syntax","text":"
    -XX:SharedCacheHardLimit=<size>\n
Setting Value Default <size> [1[k|K|m|M|g|G] or greater]

See Using -X command-line options for more information about the <size> parameter.

When you use this option with the -Xscmx option, the -Xscmx option sets the soft maximum size, and the -XX:SharedCacheHardLimit option sets the actual size, of a new shared classes cache. For more information, see -Xscmx.

If you use this option without the -Xscmx option, the behavior is the same as using the -Xscmx option by itself; both options set the actual size of the shared classes cache.

For more information about cache sizes, see Cache size limits.

"},{"location":"xxsharedcachehardlimit/#example","title":"Example","text":"

The following settings, when used together, set the soft maximum size of the shared classes cache to 16 MB and the actual maximum cache size to 64 MB.

-XX:SharedCacheHardLimit=64m -Xscmx16m\n
"},{"location":"xxsharedcachehardlimit/#see-also","title":"See also","text":""},{"location":"xxshareunsafeclasses/","title":"-XX:[+|-]ShareUnsafeClasses","text":""},{"location":"xxshareunsafeclasses/#-xx-shareunsafeclasses","title":"-XX:[+|-]ShareUnsafeClasses","text":"

This option enables or disables the storage of VM classes created through Unsafe.defineClass in the shared classes cache.

The option is enabled by default, which means that unsafe classes are stored in the shared classes cache and are therefore available for ahead-of-time (AOT) compilation, potentially improving startup performance.

"},{"location":"xxshareunsafeclasses/#syntax","title":"Syntax","text":"
    -XX:[+|-]ShareUnsafeClasses\n
Setting Effect Default -XX:+ShareUnsafeClasses Enable yes -XX:-ShareUnsafeClasses Disable"},{"location":"xxshareunsafeclasses/#see-also","title":"See also","text":""},{"location":"xxshowcarrierframes/","title":"-XX:[+|-]ShowCarrierFrames","text":""},{"location":"xxshowcarrierframes/#-xx-showcarrierframes","title":"-XX:[+|-]ShowCarrierFrames","text":"

This option controls the addition of the carrier threads' stack trace to the Throwable.getStackTrace() method. You can add the stack trace of the carrier threads to facilitate the debugging process.

Notes:

"},{"location":"xxshowcarrierframes/#syntax","title":"Syntax","text":"
    -XX:[+|-]ShowCarrierFrames\n
Setting Effect Default -XX:+ShowCarrierFrames Enable -XX:-ShowCarrierFrames Disable yes"},{"location":"xxshowcarrierframes/#explanation","title":"Explanation","text":"

Virtual threads require platform threads to run because the operating system identifies only platform threads. Therefore, a VM maintains multiple platform threads that are used as carrier threads to run the virtual threads. The VM assigns a virtual thread to a platform thread in a process called mounting.

Although the virtual thread runs on a carrier thread, the stack trace of the virtual thread and its carrier thread are separate. If an exception occurs on running the virtual threads, the thread dumps do not include stack frames from the carrier thread's stack.

You can use the -XX:+ShowCarrierFrames option to add the stack trace of the carrier thread in addition to the virtual thread stack trace to the Throwable.getStackTrace() method, if an exception occurs.

"},{"location":"xxshowcodedetailsinexceptionmessages/","title":"-XX:[+|-]ShowCodeDetailsInExceptionMessages","text":""},{"location":"xxshowcodedetailsinexceptionmessages/#-xx-showcodedetailsinexceptionmessages","title":"-XX:[+|-]ShowCodeDetailsInExceptionMessages","text":"

This OpenJDK HotSpot option enables or disables the feature that displays the details of a NullPointerException generated by a VM. This option is recognized by Eclipse OpenJ9\u2122 and provided for compatibility.

"},{"location":"xxshowcodedetailsinexceptionmessages/#syntax","title":"Syntax","text":"
    -XX:[+|-]ShowCodeDetailsInExceptionMessages\n
Setting Effect Default -XX:+ShowCodeDetailsInExceptionMessages Enable yes -XX:-ShowCodeDetailsInExceptionMessages Disable yes"},{"location":"xxshowcodedetailsinexceptionmessages/#explanation","title":"Explanation","text":"

A NullPointerException might include a message if a message was specified in the NullPointerException constructor or a null message if no message was specified in the constructor. A NullPointerException that is generated by a VM also has a null message. These messages do not have details of the reason for the exceptions thrown. A NullPointerException also includes a stack trace that contains the method, file name, and line number where the exception occurred. However, a single line of code might contain several access paths. Each of these paths might be the source of that exception, and it is difficult to identify the path that is the root cause of the exception.

JEP 358: Helpful NullPointerExceptions provides extended messages when a NullPointerException is generated by a VM. You can enable this feature with the -XX:+ShowCodeDetailsInExceptionMessages option, which is a part of this JEP 358. When this feature is enabled and the VM throws a NullPointerException, a detailed message with the action that was not completed because of this exception and the reason for this exception is displayed. For example, in the following message, Cannot read field \"c\" is the action that was not completed and because \"a.b\" is null is the root cause of the exception.

Exception in thread \"main\" java.lang.NullPointerException: Cannot read field \"c\" because \"a.b\" is null\n    at Prog.main(Prog.java:5)\n
"},{"location":"xxshowhiddenframes/","title":"-XX:[+|-]ShowHiddenFrames","text":""},{"location":"xxshowhiddenframes/#-xx-showhiddenframes","title":"-XX:[+|-]ShowHiddenFrames","text":"

This reimplementation of the Oracle HotSpot diagonostic option enables or disables the display of generated hidden MethodHandle frames in a stack trace.

This option doesn't affect the contents of dump files.

Unlike the HotSpot implementation, this option doesn't require the +UnlockDiagnosticVMOptions option.

"},{"location":"xxshowhiddenframes/#syntax","title":"Syntax","text":"
    -XX:[+|-]ShowHiddenFrames\n
Setting Effect Default -XX:+ShowHiddenFrames Enable -XX:-ShowHiddenFrames Disable yes When disabled, this option causes the VM to hide generated hidden MethodHandle frames in a stacktrace."},{"location":"xxshownativestacksymbols/","title":"-XX:[+|-]ShowNativeStackSymbols","text":""},{"location":"xxshownativestacksymbols/#-xx-shownativestacksymbols","title":"-XX:[+|-]ShowNativeStackSymbols","text":"

This option controls whether Java\u00ae dumps show the names of functions in native call stacks.

"},{"location":"xxshownativestacksymbols/#syntax","title":"Syntax","text":"
    -XX:-ShowNativeStackSymbols\n    -XX:+ShowNativeStackSymbols=<value>\n
Setting Value Effect Default -XX:-ShowNativeStackSymbols Don't show native stack symbols, not even in response to a signal, such as a fault signal -XX:+ShowNativeStackSymbols basic Show all the available native stack symbols for a signaled or faulting thread, but only easily acquired native stack symbols for other threads yes -XX:+ShowNativeStackSymbols all Show all the available native stack symbols for all threads"},{"location":"xxshownativestacksymbols/#explanation","title":"Explanation","text":"

Java dumps take longer to produce when the native stack symbols are included. If your Java application has a lot of threads, you might get an incomplete Java dump. You can avoid this situation by reducing the number of native stack symbols in the Java dump or by omitting them altogether.

"},{"location":"xxshowunmountedthreadstacks/","title":"-XX:[+|-]ShowUnmountedThreadStacks","text":""},{"location":"xxshowunmountedthreadstacks/#-xx-showunmountedthreadstacks","title":"-XX:[+|-]ShowUnmountedThreadStacks","text":"

This option enables or disables the inclusion of the unmounted virtual thread stacks in a Java\u2122 core file.

"},{"location":"xxshowunmountedthreadstacks/#syntax","title":"Syntax","text":"
    -XX:[+|-]ShowUnmountedThreadStacks\n
Setting Effect Default -XX:+ShowUnmountedThreadStacks Enable -XX:-ShowUnmountedThreadStacks Disable yes"},{"location":"xxshowunmountedthreadstacks/#explanation","title":"Explanation","text":"

In a VM, Java\u2122 threads are mapped one-to-one to platform threads and each thread is allocated a new native Java stack.

Virtual threads require platform threads to run because the operating system identifies only platform threads, but these virtual threads are not tied one-to-one to a platform thread. The VM mounts the virtual threads on available platform threads, called carrier threads. When the VM faces a blocking operation on a virtual thread, the thread is unmounted from its carrier thread and hence, the virtual thread is no longer mapped to a platform thread.

Java core file lists stacks of only those threads that are mapped to platform threads. Therefore, the stack of any unmounted virtual thread is not included in the Java core file and thus, the virtual thread information remains incomplete. The unmounted threads also include the carrier thread if a virtual thread was mounted on it. Unmounting the virtual thread, unmounts the carrier thread itself. The stack of any unmounted carrier thread is also not included in the Java core file.

You can use the -XX:+ShowUnmountedThreadStacks option to include all the thread data that a VM is aware of, both regular Java threads and the unmounted threads, in the Java core file.

The -XX:-ShowUnmountedThreadStacks option is the default option because the chance of having issues with unmounted virtual threads is low. Usually the running or mounted threads are what causes failures. Including the unmounted virtual thread information increases the Java core file size and that might affect performance.

"},{"location":"xxshowunmountedthreadstacks/#see-also","title":"See also","text":""},{"location":"xxstacktraceinthrowable/","title":"-XX:-StackTraceInThrowable","text":""},{"location":"xxstacktraceinthrowable/#-xx-stacktraceinthrowable","title":"-XX:-StackTraceInThrowable","text":"

This option removes stack traces from exceptions.

"},{"location":"xxstacktraceinthrowable/#syntax","title":"Syntax","text":"
    -XX:-StackTraceInThrowable\n
Setting Effect Default -XX:-StackTraceInThrowable Disable No

While stack traces are included in exceptions by default, recording them can have a negative impact on performance. Use this option if you want to remove stack traces, although this might cause difficulties with problem determination.

When this option is enabled, Throwable.getStackTrace() returns an empty array and the stack trace is displayed when an uncaught exception occurs. Thread.getStackTrace() and Thread.getAllStackTraces() are not affected by this option.

"},{"location":"xxstacktraceinthrowable/#see-also","title":"See also","text":""},{"location":"xxtransparenthugepage/","title":"-XX:[+|-]TransparentHugePage","text":""},{"location":"xxtransparenthugepage/#-xx-transparenthugepage","title":"-XX:[+|-]TransparentHugePage","text":"

(Linux\u00ae systems only: x86, POWER\u00ae, and IBM Z\u00ae)

If Transparent Huge Pages (THP) is set to madvise on your system, this option, when enabled, promotes all memory allocated to huge pages. On systems without THP, or if THP is set to always or never on your system, this option is ignored. When transparent huge pages are used, your application footprint might increase.

"},{"location":"xxtransparenthugepage/#syntax","title":"Syntax","text":"Setting Effect Default -XX:+TransparentHugePage Enable yes -XX:-TransparentHugePage Disable"},{"location":"xxusecompressedoops/","title":"-XX:[+|-]UseCompressedOops","text":""},{"location":"xxusecompressedoops/#-xx-usecompressedoops","title":"-XX:[+|-]UseCompressedOops","text":"

(64-bit only)

This Oracle HotSpot option enables or disables compressed references in 64-bit JVMs. The option is recognized by the Eclipse OpenJ9\u2122 VM and is provided to help when porting applications from the HotSpot JVM to the OpenJ9 VM. This option might not be supported in subsequent releases.

"},{"location":"xxusecompressedoops/#syntax","title":"Syntax","text":"
    -XX:[+|-]UseCompressedOops\n
Setting Effect Default -XX:+UseCompressedOops Enable -XX:-UseCompressedOops Disable

The -XX:+UseCompressedOops option is similar to specifying -Xcompressedrefs. Compressed references are used by default when the maximum memory size for an application is set above a platform-specific value. For more information, see -Xcompressedrefs.

"},{"location":"xxusecontainersupport/","title":"-XX:[+|-]UseContainerSupport","text":""},{"location":"xxusecontainersupport/#-xx-usecontainersupport","title":"-XX:[+|-]UseContainerSupport","text":"

(Linux\u00ae only)

If your application is running in a container that imposes a memory limit, the VM allocates a larger fraction of memory to the Java heap. To turn off this behavior, set the -XX:-UseContainerSupport option on the command line.

"},{"location":"xxusecontainersupport/#syntax","title":"Syntax","text":"
    -XX:[+|-]UseContainerSupport\n
Setting Effect Default -XX:-UseContainerSupport Disable -XX:+UseContainerSupport Enable yes

When using container technology, applications are typically run on their own and do not need to compete for memory. The Eclipse OpenJ9\u2122 VM detects when it is running inside a container that imposes a memory limit, and adjusts the maximum Java heap size appropriately.

The following table shows the values that are used when -XX:+UseContainerSupport is set:

Container memory limit <size> Maximum Java heap size Less than 1 GB 50% <size> 1 GB - 2 GB <size> - 512 MB Greater than 2 GB 75% <size>

The default heap size is capped at 25 GB, which is the limit of heap size for 3-bit shift of compressed references (see -Xcompressedrefs), to prevent silent switching to 4-bit shift of compressed references, which has possible performance penalties. You can use the -Xmx option or the -XX:MaxRAMPercentage option to overwrite the 25 GB limit.

The default heap size for containers takes affect only when the following conditions are met:

  1. The application is running in a container environment.
  2. The memory limit for the container is set.
  3. The -XX:+UseContainerSupport option is set, which is the default behavior.

To prevent the VM adjusting the maximum heap size when running in a container, set -XX:-UseContainerSupport.

When -XX:MaxRAMPercentage / -XX:InitialRAMPercentage are used with -XX:+UseContainerSupport, the corresponding heap setting is determined based on the memory limit of the container. For example, to set the maximum heap size to 80% of the container memory, specify the following options:

-XX:+UseContainerSupport -XX:MaxRAMPercentage=80\n

Note: If you set a value for -Xms, the -XX:InitialRAMPercentage option is ignored. If you set a value for -Xmx, the -XX:MaxRAMPercentage option is ignored.

"},{"location":"xxusegcstartuphints/","title":"-XX:[+|-]UseGCStartupHints","text":""},{"location":"xxusegcstartuphints/#-xx-usegcstartuphints","title":"-XX:[+|-]UseGCStartupHints","text":"

When this option is enabled, the VM calculates, over several application restarts, an appropriate startup heap size for your application. You can therefore use this option instead of calculating and setting an -Xms value yourself. Setting an initial size for the heap that is larger than the default helps to avoid frequent garbage collections during the startup phase of an application.

"},{"location":"xxusegcstartuphints/#syntax","title":"Syntax","text":"
    -XX:[+|-]UseGCStartupHints\n
Setting Effect Default -XX:+UseGCStartupHints Enable yes -XX:-UseGCStartupHints Disable

When enabled, the VM records the heap size when a startup complete event occurs, storing the value into the shared classes cache. On subsequent restarts, the garbage collector (GC) reads this value early in startup processing and expands the heap to an appropriate value. For accuracy and stability, averages are taken over a few restarts to stabilize the value used. The heap size recorded is specific to the application command line, therefore a different hint is stored for every unique command line.

You can check the value used by the garbage collector for heap expansion by inspecting verbose GC output. The following example shows heap expansion based on hints from the previous run when using the gencon policy:

<heap-resize id=\"2\" type=\"expand\" space=\"nursery\" amount=\"205258752\" count=\"1\" timems=\"0.328\" reason=\"hint from previous runs\" timestamp=\"2019-06-05T13:26:32.021\" />\n<heap-resize id=\"3\" type=\"expand\" space=\"tenure\" amount=\"692649984\" count=\"1\" timems=\"0.326\" reason=\"hint from previous runs\" timestamp=\"2019-06-05T13:26:32.022\" />\n

The final value stored to the shared cache is not recorded in the verbose GC output.

Notes:

Restriction: This feature is not currently available with the Balanced GC policy.

"},{"location":"xxusejitserver/","title":"-XX:[+|-]UseJITServer","text":""},{"location":"xxusejitserver/#-xx-usejitserver","title":"-XX:[+|-]UseJITServer","text":"

This option starts the Eclipse OpenJ9\u2122 VM in JITServer client mode.

"},{"location":"xxusejitserver/#syntax","title":"Syntax","text":"
    -XX:[+|-]UseJITServer\n
Setting Effect Default -XX:+UseJITServer Enable -XX:-UseJITServer Disable yes"},{"location":"xxusejitserver/#explanation","title":"Explanation","text":"

When you enable this option, the VM tries to connect to a server and send all JIT compilation requests to it. For more information, see JITServer Technology.

You must specify this option for any other -XX:*JITServer* options to take effect.

"},{"location":"xxusejitserver/#see-also","title":"See also","text":""},{"location":"xxusenogc/","title":"-XX:[+|-]UseNoGC","text":""},{"location":"xxusenogc/#-xx-usenogc","title":"-XX:[+|-]UseNoGC","text":"

The -XX:+UseNoGC option enables a garbage collection policy that expands the Java object heap in the normal way until the limit is reached, but memory is not reclaimed through garbage collection.

"},{"location":"xxusenogc/#syntax","title":"Syntax","text":"
    -XX:[+|-]UseNoGC\n
Setting Effect Default -XX:+UseNoGC Enable -XX:-UseNoGC Disable yes"},{"location":"xxusenogc/#explanation","title":"Explanation","text":"

This policy can be useful for test purposes and for short-lived applications. When the limit is reached an OutOfMemory error is generated and the VM shuts down.

The -XX:-UseNoGC option turns off a previously enabled -XX:+UseNoGC option.

This policy can also be enabled with the -Xgcpolicy:nogc option. See -Xgcpolicy:nogc for more details about this policy and when it is appropriate to use it.

"},{"location":"xxusezlibnx/","title":"-XX:[+|-]UseZlibNX","text":""},{"location":"xxusezlibnx/#-xx-usezlibnx","title":"-XX:[+|-]UseZlibNX","text":"

AIX\u00ae with IBM POWER9\u00ae and later only

This option enables or disables the adding of the zlibNX library directory location to the LIBPATH environment variable.

"},{"location":"xxusezlibnx/#syntax","title":"Syntax","text":"
    -XX:[+|-]UseZlibNX\n
Setting Effect Default -XX:+UseZlibNX Enable yes -XX:-UseZlibNX Disable"},{"location":"xxusezlibnx/#explanation","title":"Explanation","text":"

AIX system adds the zlibNX library location, if available, to the LIBPATH variable by default. But having the zlibNX library directory location in the LIBPATH variable might cause some issues. For example, Git clone fails when executed from Java\u00ae when zlibNX is on the LIBPATH in the environment.

You can disable adding of the zlibNX library location to the LIBPATH variable with the -XX:-UseZlibNX option.

"},{"location":"xxusezlibnx/#see-also","title":"See also","text":""},{"location":"xxutfcache/","title":"-XX:[+|-]UTFCache","text":""},{"location":"xxutfcache/#-xx-utfcache","title":"-XX:[+|-]UTFCache","text":"

This option enables or disables the UTF to String cache used to enhance reflection performance.

"},{"location":"xxutfcache/#syntax","title":"Syntax","text":"
    -XX:[+|-]UTFCache\n
Setting Effect Default -XX:+UTFCache Enable yes -XX:-UTFCache Disable

The option, -XX:+UTFCache, causes the VM to cache the conversion of UTF8 data to java String objects during reflection. This is the default option.

When specifying the -XX:-UTFCache option, the VM does not performing this caching.

"},{"location":"xxverboseverification/","title":"-XX:[+|-]VerboseVerification","text":""},{"location":"xxverboseverification/#-xx-verboseverification","title":"-XX:[+|-]VerboseVerification","text":"

You can use this option to control the output of verbose diagnostic data that relates to verification.

The Oracle documentation to support this option is no longer available, because it is no longer used by the HotSpot VM. An explanation is provided here.

"},{"location":"xxverboseverification/#syntax","title":"Syntax","text":"
    -XX:[+|-]VerboseVerification\n
Setting Effect Default -XX:-VerboseVerification Disable yes -XX:+VerboseVerification Enable

Use -XX:-VerboseVerification to enable the output of verbose diagnostic data to stderr that is generated during verification from the class file StackMapTable attribute. The data provides extra contextual information about bytecode verification, which helps diagnose bytecode or stackmap deficiencies in the field.

Class files that have StackMapTable attributes (that is, class files that conform to version 50.0 or later of the class file format specification), are introduced in Java\u2122 V6. Class files with StackMapTable attributes are marked as new format in the verbose output, as shown in the example. Class files without the StackMapTable attributes are marked as old format. The StackMapTable diagnostic information is available only to classes verified with the new format.

Here is an example of StackMapTable diagnostic output:

Verifying class java.example.ibm.com with new format\nVerifying method java.example.ibm.com.foo(Ljava/lang/String;Ljava/lang/Class;[Ljava/lang/String;Ljava/io/PrintStream;)I\nStackMapTable: frame_count = 3\ntable = {\n  bci: @37\n  flags: { }\n  locals: { 'java/lang/String', 'java/lang/Class', '[Ljava/lang/String;', 'java/io/PrintStream', 'java/lang/Class' }\n  stack: { 'java/lang/ThreadDeath' }\n  bci: @42\n  flags: { }\n  locals: { 'java/lang/String', 'java/lang/Class', '[Ljava/lang/String;', 'java/io/PrintStream', 'java/lang/Class' }\n  stack: { 'java/lang/Throwable' }\n  bci: @79\n  flags: { }\n  locals: { 'java/lang/String', 'java/lang/Class', '[Ljava/lang/String;', 'java/io/PrintStream', 'java/lang/Class',\n        'java/lang/Throwable' }\n  stack: { }\n }\nEnd class verification for: java.example.ibm.com\n
"},{"location":"xxvmlockclassloader/","title":"-XX:[+|-]VMLockClassLoader","text":""},{"location":"xxvmlockclassloader/#-xx-vmlockclassloader","title":"-XX:[+|-]VMLockClassLoader","text":"

This option affects synchronization on class loaders that are not parallel-capable class loaders, during class loading.

"},{"location":"xxvmlockclassloader/#syntax","title":"Syntax","text":"
    -XX:[+|-]VMLockClassLoader\n
Setting Effect Default -XX:+VMLockClassLoader Enable yes -XX:-VMLockClassLoader Disable

The option, -XX:+VMLockClassLoader, causes the VM to force synchronization on a class loader that is not a parallel capable class loader during class loading. This action occurs even if the loadClass() method for that class loader is not synchronized. For information about parallel capable class loaders, see java.lang.ClassLoader.registerAsParallelCapable(). Note that this option might cause a deadlock if class loaders use non-hierarchical delegation. For example, setting the system property osgi.classloader.lock=classname with Equinox is known to cause a deadlock. This is the default option.

When specifying the -XX:-VMLockClassLoader option, the VM does not force synchronization on a class loader during class loading. The class loader still conforms to class library synchronization, such as a synchronized loadClass() method.

"},{"location":"xzero/","title":"-Xzero","text":""},{"location":"xzero/#-xzero","title":"-Xzero","text":"

Enables reduction of the memory footprint of the Java\u2122 runtime environment when concurrently running multiple Java invocations.

This option is deprecated and will be removed in a future release.

This option can be used only with Java SE version 8 runtime environments.

-Xzero might not be appropriate for all types of applications because it changes the implementation of java.util.ZipFile, which might cause extra memory usage.

"},{"location":"xzero/#syntax","title":"Syntax","text":"Setting Effect -Xzero:none Disable all sub options -Xzero:describe Prints the sub options in effect -Xzero:sharebootzip Enables the sharebootzip sub option -Xzero:nosharebootzip Disables the sharebootzip sub option

The following parameters are no longer supported. The options are parsed but do nothing:

Setting Effect -Xzero:j9zip Enables the j9zip sub option -Xzero:noj9zip Disables the j9zip sub option -Xzero:sharezip Enables the sharezip sub option -Xzero:nosharezip Disables the sharezip sub option"}]} \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index e365f6f31..5dde13a61 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -2,1627 +2,1627 @@ https://www.eclipse.org/openj9/docs/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/allocation/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/aot/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/api-conditionhandling/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/api-cuda/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/api-daa/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/api-dtfj/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/api-gpu/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/api-jdk11/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/api-jdk17/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/api-jdk21/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/api-jdk22/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/api-jvm/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/api-langmgmt/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/api-overview/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/api-shrc/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/attachapi/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/builds/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/cmdline_general/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/cmdline_migration/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/cmdline_specifying/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/configuring/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/criusupport/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/d_jvm_commands/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmenableclasscaching/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmenablelegacydumpsecurity/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmenablelegacylogsecurity/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmenablelegacytracesecurity/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmgpudisable/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmgpuenable/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmgpuverbose/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmlangmanagementosmxbeaniscputime100ns/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmlangmanagementverbose/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmotisharedsharedclassglobalfilterclass/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmtoolsattachcommand_timeout/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmtoolsattachdirectory/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmtoolsattachdisplayname/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmtoolsattachenable/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmtoolsattachfileaccessupdatetime/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmtoolsattachid/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmtoolsattachlogging/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmtoolsattachlogname/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmtoolsattachretry/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmtoolsattachshutdown_timeout/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dcomibmtoolsattachtimeout/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dfileencoding/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/diag_overview/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/djavacompiler/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/djavalangstringbuffergrowaggressively/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/djavalangstringsubstringnocopy/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/djdknativecbc/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/djdknativechacha20/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/djdknativecrypto/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/djdknativedigest/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/djdknativeec/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/djdknativeeckeygen/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/djdknativegcm/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/djdknativersa/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/djdknativexdhkeyagreement/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/djdknativexdhkeygen/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dorgeclipseopenj9criuimmutableenvvars/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dump_heapdump/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dump_javadump/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/dump_systemdump/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/enhancementstoopenjdksecurity/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/env_var/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/gc/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/gc_overview/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/interface_dtfj/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/interface_jvmti/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/interface_lang_management/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/introduction/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/jit/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/jitserver/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/jitserver_tuning/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/legal/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/messages_intro/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/migrating11to17/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/migrating17to21/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/migrating8to11/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/openj9_defaults/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/openj9_directories/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/openj9_newuser/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/openj9_releases/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/openj9_signals/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/openj9_support/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/openssl/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/shrc/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/shrc_diag_util/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/tool_builder/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/tool_jcmd/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/tool_jdmpview/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/tool_jextract/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/tool_jmap/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/tool_jps/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/tool_jstack/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/tool_jstat/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/tool_migration/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/tool_traceformat/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.10/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.11/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.12/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.13/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.14/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.15/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.16/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.17/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.18/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.19/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.20/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.21/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.22/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.23/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.24/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.25/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.26/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.27/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.29.1/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.29/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.30.1/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.30/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.32/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.33/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.35/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.36/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.37/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.38/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.39/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.40/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.41/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.42/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.43/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.44/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.45/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.46/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.8/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/version0.9/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/vgclog/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/vgclog_examples/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/x/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/x_jvm_commands/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xaggressive/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xalwaysclassgc/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xaot/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xargencoding/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xbootclasspath/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xceehdlr/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xcheck/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xclassgc/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xcodecache/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xcodecachetotal/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xcomp/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xcompactexplicitgc/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xcompactgc/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xcompilationthreads/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xcompressedrefs/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xconcurrentbackground/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xconcurrentlevel/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xconcurrentslack/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xconmeter/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xdisablejavadump/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xdump/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xenableexcessivegc/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xenableexplicitgc/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xenablestringconstantgc/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xfastresolve/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xfuture/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xgc/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xgcmaxthreads/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xgcpolicy/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xgcsplitheap/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xgcthreads/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xgcworkpackets/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xint/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xjit/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xjni/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xlinenumbers/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xloa/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xloaminimum/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xlockreservation/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xlockword/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xlog/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xlp/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xlpcodecache/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xlpobjectheap/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xmca/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xmcrs/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xmine/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xminf/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xmint/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xmn/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xmo/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xmoi/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xmr/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xms/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xmso/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xnumanone/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xoptionsfile/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xquickstart/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xrs/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xrsonrestoresynconrestore/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xsamplingexpirationtime/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xscdmx/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xscminaot/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xscminjitdata/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xscmx/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xshareclasses/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xshareclassesdisableonrestore/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xsigcatch/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xsigchain/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xsignal/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xsoftmx/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xsoftrefthreshold/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xss/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xsyslog/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xtgc/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xthr/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xtlhprefetch/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xtrace/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xtunevirtualized/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xverbosegclog/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xverify/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xx_jvm_commands/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxactiveprocessorcount/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxadaptivegcthreading/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxallowvmshutdown/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxalwayspretouch/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxcheckpointgcthread/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxclassrelationshipverifier/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxcodecachetotal/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxcodecachetotalmaxrampercentage/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxcompactstrings/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxcompatibility/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxconcgcthreads/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxcontinuationcache/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxcpuloadcompatibility/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxcriurestorenonportablemode/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxcriusecprovider/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxdiagnosesynconvaluebasedclasses/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxdisableexplicitgc/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxdisclaimjitscratch/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxenable3164interoperability/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxenablecpumonitor/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxenablecriusupport/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxenabledynamicagentloading/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxenableextendedhcr/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxensurehashed/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxexitonoutofmemoryerror/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxgloballockreservation/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxhandlesigabrt/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxhandlesigusr2/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxhandlesigxfsz/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxheapdumponoutofmemory/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxheapdumppath/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxheapmanagementmxbeancompatibility/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxidletuningcompactonidle/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxidletuninggconidle/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxidletuningminfreeheaponidle/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxidletuningminidlewaittime/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxignoreunrecognizedrestoreoptions/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxignoreunrecognizedvmoptions/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxignoreunrecognizedxxcolonoptions/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxinitialheapsize/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxinitialrampercentage/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxinterleavememory/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxiprofileduringstartupphase/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxjitinlinewatches/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxjitserveraddress/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxjitserveraotcachedir/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxjitserveraotcachename/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxjitserveraotcachepersistence/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxjitserveraotmx/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxjitserverlocalsynccompiles/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxjitserverlogconnections/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxjitservermetrics/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxjitservermetricsport/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxjitservermetricssslkey/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxjitserverport/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxjitservershareromclasses/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxjitserversslcert/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxjitservertimeout/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxjitserveruseaotcache/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxlazysymbolresolution/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxlegacyxlogoption/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxmaxdirectmemorysize/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxmergecompileroptions/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxnosuballoc32bitmem/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxonoutofmemoryerror/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxopenj9commandlineenv/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxoriginaljdk8heapsizecompatibilitymode/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxpagealigndirectmemory/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxparallelcmsthreads/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxparallelgcmaxthreads/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxparallelgcthreads/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxperftool/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxportablesharedcache/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxpositiveidentityhash/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxprintcodecache/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxprintflagsfinal/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxreadipinfoforras/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxreducecpumonitoroverhead/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxrequirejitserver/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxruntimeinstrumentation/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxsethwprefetch/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxshareanonymousclasses/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxshareclassesenablebci/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxsharedcachehardlimit/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxshareunsafeclasses/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxshowcarrierframes/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxshowcodedetailsinexceptionmessages/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxshowhiddenframes/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxshownativestacksymbols/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxshowunmountedthreadstacks/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxstacktraceinthrowable/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxtransparenthugepage/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxusecompressedoops/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxusecontainersupport/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxusegcstartuphints/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxusejitserver/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxusenogc/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxusezlibnx/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxutfcache/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxverboseverification/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xxvmlockclassloader/ - 2024-07-23 + 2024-07-29 daily https://www.eclipse.org/openj9/docs/xzero/ - 2024-07-23 + 2024-07-29 daily \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz index c685bb4cc..0550dc058 100644 Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ diff --git a/version0.46/index.html b/version0.46/index.html index 154b71b34..77d724404 100644 --- a/version0.46/index.html +++ b/version0.46/index.html @@ -476,6 +476,15 @@ + + +
  • + + + -Xtgc:allocation report includes core allocation cache statistics per thread + + +
  • @@ -8831,6 +8840,15 @@ + + +
  • + + + -Xtgc:allocation report includes core allocation cache statistics per thread + + +
  • @@ -8894,6 +8912,7 @@

    What's new in version 0.46.0

  • The JITServer AOT caching feature enabled by default at the JITServer server
  • The extended Hot Code Replace (HCR) capability disabled and -XX:[+|-]EnableExtendedHCR option added
  • New system property added to improve jcmd attaching in case of the SocketException error on Windows™ platform
  • +
  • -Xtgc:allocation report includes core allocation cache statistics per thread
  • Features and changes

    Binaries and supported environments

    @@ -8915,6 +8934,8 @@

    New system property added to improve jcmd attaching in case of the SocketException error on Windows platform

    When the jcmd tool sends a command to a running VM, the command might throw the Socket Exception error on Windows platform. Instead of failing the attaching request, you can specify the number of times the tool retries attaching to the target VM with the new system property, -Dcom.ibm.tools.attach.retry.

    +

    -Xtgc:allocation report includes core allocation cache statistics per thread

    +

    The -Xtgc:allocation option prints thread-specific allocation cache (TLH) statistics in addition to the cumulative allocation statistics.

    Known problems and full release information

    To see known problems and a complete list of changes between Eclipse OpenJ9 v0.45.0 and v0.46.0 releases, see the Release notes.

    diff --git a/xtgc/index.html b/xtgc/index.html index f4e21f00a..f09a626c7 100644 --- a/xtgc/index.html +++ b/xtgc/index.html @@ -5784,6 +5784,15 @@