Java virtual machine settings


 

+

Search Tips   |   Advanced Search

 

View Java virtual machine (JVM) config settings for an appserver process.

Application Server Servers | Server Types | WebSphere application servers | server_name | Server Infrastructure | Java and process management | Process definition | Java virtual machine
Deployment manager System Administration | Deployment manager | Server Infrastructure | Java and process management | Process definition | Java virtual machine
Node agent System Administration | Node agent | node_agent | Server Infrastructure | Java and process management | Process definition | Java virtual machine

Classpath

Standard class path in which the Java virtual machine code looks for classes.

To add a classpath to this field, enter each classpath entry into a separate table row. You do not have to add a colon or semicolon at the end of each entry.

The only classpaths that should be added to this field are the ones that specify the location of the following items:

  • An inspection or monitoring tool to the system.

  • JAR files for a product that runs on top of this product.

  • JVM diagnostic patches or fixes.

Processing errors might occur if we add classpaths to this field that specify the location of the following items:

  • JAR files for resource providers, such as DB2. The paths to these JAR files should be added to the relevant provider class paths.

  • A user JAR file used by one or more of the applications that you are running on WAS ND. The path to this type of JAR file should be specified within each application that requires that JAR file, or in server-associated shared libraries.

  • An extension JAR file.

    To add an extension JAR file to the system, you should use the ws.ext.dirs JVM custom property to specify the absolute path to this JAR file.

    We can also place the JAR file in...

    WAS_HOME/lib/ext/

    ...but using the ws.ext.dirs JVM custom property is the recommended approach for specifying the path to an extension JAR file.

Data type String

Boot classpath

Specifies bootstrap classes and resources for JVM code. This option is only available for JVM instructions that support bootstrap classes and resources.

To add a classpath to this field, enter each classpath entry into a table row. You do not need to add the colon or semicolon at the end of each entry.

To add multiple classpaths to this field, we can use either a colon (:) or semi-colon (;), depending on which operating system the node resides, to separate these classpaths.

The only classpaths that should be added to this field are the ones that specify the location of the following items:

  • An inspection or monitoring tool to the system.

  • JAR files for a product that runs on top of this product.

  • JVM diagnostic patches or fixes.

Processing errors might occur if we add classpaths to this field that specify the location of the following items:

  • JAR files for resource providers. such as DB2. The paths to these JAR files should be added to the relevant provider class paths.

  • A user JAR file used by one or more of the applications that you are running on WAS ND. The path to this type of JAR file should be specified within each application that requires that JAR file, or in server-associated shared libraries.

  • An extension JAR file. To add an extension JAR file to the system, you should use the ws.ext.dirs JVM custom property to specify the absolute path to this JAR file.

    We can also place the JAR file in...

    WAS_HOME/lib/ext/

    ...but using the ws.ext.dirs JVM custom property is the recommended approach for specifying the path to an extension JAR file.

Verbose class loading

Whether to use verbose debug output for class loading. The default is to not enable verbose class loading.

If verbose class loading is enabled, the debug output is sent to one of the native process logs.

Data type Boolean
Default false

Verbose garbage collection

Whether to use verbose debug output for garbage collection.

The default is not to enable verbose garbage collection.

If verbose garbage collection is enabled, the debug output is sent to one of the native process logs.

Data type Boolean
Default false

When this field is enabled, a report is written to the output stream each time the garbage collector runs. This report should give you an indication of how the Java garbage collection process is functioning.

We can check the verboseGC report to determine:

  • How much time the JVM is spending performing garbage collection. Ideally, you want the JVM to spend less than 5 percent of its processing time doing garbage collection. To determine the percentage of time the JVM spends in garbage collection, divide the time it took to complete the collection by the length of time since the last AF and multiply the result by 100. For example,

    83.29/3724.32 * 100 = 2.236 percent

    If spending more than 5 percent of the time in garbage collection and if garbage collection is occurring frequently, we might need to increase the Java heap size.

  • If the allocated heap is growing with each garbage collection occurrence.

    To determine if the allocated heap is growing, look at the percentage of the heap that is remains unallocated after each garbage collection cycle, and verify that the percentage is not continuing to decline. If the percentage of free space continues to decline we are experiencing a gradual growth in the heap size from garbage collection to garbage collection. This situation might indicate that the application has a memory leak.

Verbose JNI

Whether to use verbose debug output for native method invocation. The default is not to enable verbose Java Native Interface (JNI) activity.

Data type Boolean
Default false

Initial heap size

Specifies, in megabytes, the initial heap size available to the JVM code. If this field is left blank, the default value is used.

For IBM i and distributed platforms, the default initial heap size is 50 MB.

Best practice: These default values are sufficient for most applications

Increasing this setting can improve startup. The number of garbage collection occurrences are reduced and a 10 percent gain in performance is achieved.

Increasing the size of the Java heap continues to improves throughput until the heap becomes too large to reside in physical memory. If the heap size exceeds the available physical memory, and paging occurs, there is a noticeable decrease in performance.

Maximum heap size

Specifies, in megabytes, the maximum heap size that is available to the JVM code. If this field is left blank, the default value is used.

The default maximum heap size is 256 MB. This default value applies for both 31-bit and 64-bit configurations.

Increasing the maximum heap size setting can improve startup. When you increase the maximum heap size, you reduce the number of garbage collection occurrences with a 10 percent gain in performance.

Increasing this setting usually improves throughput until the heap becomes too large to reside in physical memory. If the heap size exceeds the available physical memory, and paging occurs, there is a noticeable decrease in performance. Therefore, it is important that the value you specify for this property allows the heap to be contained within physical memory.

Best practice: These default values are appropriate for most applications. Enable the Verbose garbage collection property if we think garbage collection is occurring too frequently. If garbage collection is occurring too frequently, increase the maximum size of the JVM heap

Run HProf

Whether to use HProf profiler support. To use another profiler, specify the custom profiler settings using the HProf Arguments setting.

The default is not to enable HProf profiler support.

If we set the Run HProf property to true, then specify command-line profiler arguments as values for the HProf Arguments property.

Data type Boolean
Default false

HProf arguments

Specifies command-line profiler arguments to pass to the JVM code that starts the appserver process. We can specify arguments when

HProf profiler support is enabled.

HProf arguments are only required if the Run HProf property is set to true.

Debug mode

Whether to run the JVM in debug mode. The default is to not enable debug mode support.

If we set the Debug mode property to true, then specify command-line debug arguments as values for the Debug arguments property.

Data type Boolean
Default false

Debug arguments

Specifies command-line debug arguments to pass to the JVM code that starts the appserver process. We can specify arguments when the Debug mode property is set to true.

If we enable debugging on multiple appservers on the same node, verify that the same value is not specified for the address argument. The address argument defines the port used for debugging. If two servers, for which debugging is enabled, are configured to use the same debug port, the servers might fail to start properly. For example, both servers might still be configured with the debug argument address=7777, which is the default value for the debug address argument.

Data type String
Units Java command-line arguments

Generic JVM arguments

Specifies command-line arguments to pass to the Java virtual machine code that starts the appserver process.

We can enter the following optional command-line arguments in the Generic JVM arguments field. If we enter more than one argument, enter a space between each argument.

Avoid trouble: If the argument states that it is only for the IBM Developer Kit only, we cannot use that argument with the JVM from another provider, such as the Microsoft or Hewlett-Packard

  • hotRestartSync:

    Enable the hot restart sync feature of the synchronization service.

    Indicates to the synchronization service that the installation is running in an environment where configuration updates are not made when the dmgr is not active. Therefore, the service does not have to perform a complete repository comparison when the dmgr or node agent servers restart. Enabling this feature improves the efficiency of the first synchronization operation after the dmgr or a node agent restarts, especially for installations that include mixed release cells, use several nodes, and run several applications.

  • -Xquickstart

    Set the initial compilation to occur at a lower optimization level than in default mode. Later, depending on sampling results, we can recompile to the level of the initial compile in default mode.

    Use-Xquickstart for applications where early moderate speed is more important than long run throughput. In some debug scenarios, test harnesses and short-running tools, we can improve startup time between 15-20 percent

  • -Xverify:none

    Skip the class verification stage during class loading. Provides a 10-15 percent improvement in startup time.

    Corrupted or invalid class data is not detected when this argument is specified. If corrupt class data is loaded, the JVM might behave in an unexpected manner, or the JVM might fail.

    If we experience a JVM failure or the JVM behaves in an unexpected manner while this argument is in affect, remove this argument as the first step in debugging the JVM problem.

    Do not use this argument if making bytecode modifications, because the JVM might fail if any instrumentation error occurs.

  • -Xnoclassgc

    Disable class garbage collection.

    Results in more class reuse and slightly improved performance. However, the resources owned by these classes remain in use even when the classes are not being called.

    Use verbose:gc to monitor garbage collection. Review output to determine the performance impact of reclaiming these resources. If the same set of classes are garbage collected repeatedly, we might want to disable class garbage collection. Class garbage collection is enabled by default.

  • -Xgcthreads

    Use several garbage collection threads at one time. Known as parallel garbage collection. Valid only for the IBM Developer Kit.

    When entering this value in the Generic JVM arguments field, also enter the number of processors that are running on the machine. For example, if we have 3 processors running on the machine, enter...

    -Xgcthreads 3

    On a node with n processors, the default number of threads is n.

    You should use parallel garbage collection if the machine has more than one processor

  • -Xnocompactgc

    Disable heap compaction.

    Heap compaction is the most expensive garbage collection operation. If using the IBM Developer Kit, you should avoid heap compaction.

    If we disable heap compaction, you eliminate all associated overhead.

  • -Xgpolicy

    Specify-Xgpolicy to set the garbage collection policy. This argument is valid only for the IBM Developer Kit.

    Set this argument to optavgpause, if we want concurrent marking used to track application threads starting from the stack before the heap becomes full. When this parameter is specified, the garbage collector pauses become uniform and long pauses are not apparent. However, using this policy reduces throughput because threads might have to do extra work.

    Set this argument to optthruput if we want to optimize throughput and it does not create a problem if long garbage collection pauses occur. This is the default parameter, recommended setting.

  • -XX

    The Java SE 6 has generation garbage collection, which allows separate memory pools to contain objects with different ages. The garbage collection cycle collects the objects independently from one another depending on age. With additional parameters, we can set the size of the memory pools individually. To achieve better performance, set the size of the pool containing objects that have short life cycles, such that the objects in the pool are not kept through more then one garbage collection cycle. Use the NewSize and MaxNewSize parameters to specify the size of the new generation pool.

    Objects that survive the first garbage collection cycle are transferred to another pool. Use theSurvivorRatio parameter to specify the size of the survivor pool.SurvivorRatio. Use the object statistics that the Tivoli Performance Viewer collects, or include the verbose:gc argument in the configuration setting to monitor garbage collection statistics. If garbage collection becomes a bottleneck, specify the following arguments to customize the generation pool settings to better fit the environment.

    -XX:NewSize=lower_bound 
    -XX:MaxNewSize=upper_bound
     -XX:SurvivorRatio=new_ratio_size 
    

    The default values are:

    • NewSize=2m

    • MaxNewSize=32m

    • SurvivorRatio=32

    Best practice: However, if we have a JVM with more than 1 GB heap size, you should use the following values:

    • -XX:NewSize=640m
    • -XX:MaxNewSize=640m
    • -XX:SurvivorRatio=16

    Alternatively, you could set 50% to 60% of the total heap size to a new generation pool.

  • -Xminf

    Change the minimum free heap size percentage.

    The heap grows if the free space is below the specified amount. In reset enabled mode, this argument specifies the minimum percentage of free space for the middleware and transient heaps. The valued specified for this argument is a floating point number, 0 through 1. The default is .3 (30 percent).

  • -server | -client

    With -client mode, server startup time is quicker, and a smaller memory footprint is created.

    With -server mode, performance improves We can monitor the process size, and the server startup time to check the performance difference between using the -client and -server modes.

    Java HotSpot Technology in Java SE 6 uses an adaptive JVM containing algorithms that, over time, optimize how the byte code performs. The JVM runs in two modes, -server and -client. In most cases, use -server mode, which produces more efficient run-time performance over extended lengths of time.

  • -Xshareclasses:none

    Disable the share classes option for a process.

    Available with Java SE 6. Lets you share classes in a cache to improve startup time and reduce memory footprint.

    Processes, such as...

    ...can use the share classes option.

    If we use this option, clear the cache when the process is not in use. To clear the cache, either...

    • Run...

      APP_ROOT/bin/clearClassCache.bat

    • Stop the process and then restart the process.

    The JVM for J2SE 5 is not supported on Solaris, HP, and IBM i.

    J2EE application classes running in an appserver process are not added to the shared class cache.

    Data type String
    Units Java command-line arguments

Executable JAR file name

Specifies a full path name for an executable JAR file that the JVM code uses.

Data type String
Units Path name

Disable JIT

Whether to disable the just-in-time (JIT) compiler option of the JVM code.

If we disable the JIT compiler, throughput decreases noticeably. Therefore, for performance reasons, keep JIT enabled.

Data type Boolean
Default false (JIT enabled)
Recommended JIT enabled

Operating system name

JVM settings for a given operating system.

When the process starts, the process uses the JVM settings specified for the node as the JVM settings for the operating system.





 

Related tasks

Set the JVM
Tuning the application serving environment

 

Related


Custom property collection
Process logs