Hitachi

uCosminexus Application Server System Design Guide


7.16 G1 GC tuning

This section explains how to tune the system for G1 GC. Perform the tuning described in this section when creating the system, and apply it to the live environment only after verifying that the system requirements are met.

The following table lists the options related to the size of the Java heap area. The numbers 1 to 8 in the table correspond to their counterparts in the figure.

Table 7‒9: Options that specify the size of the areas in the Java heap area and the size of the Metaspace area

No.

Option name

Description

1

-Xmssize

Sets the initial size of the Java heap#1.

2

-Xmxsize

Sets the maximum size of the Java heap#1.

3

-XX:NewSize=value

Sets the minimum size of the New area#2.

4

-XX:MaxNewSize=value

Sets the maximum size of the New area#2.

5

-XX:NewRatio=value

Sets the ratio of the New area to the Java heap area#2.

When value is 2, the ratio of the New area to the Tenured area is 1:2.

6

-XX:SurvivorRatio=value

Sets the maximum ratio of the Survivor area to the New area.

The maximum size of the Survivor area relative to the New area is determined by the following formula:

size-of-Survivor-area#3=size-of-New-area/survivor-ratio

7

-XX:MetaspaceSize=size

Sets the initial size of the Metaspace area#4.

8

-XX:MaxMetaspaceSize=size

Sets the maximum size of the Metaspace area#4.

#1

We recommend that you specify the same value for the -Xms and -Xmx options.

#2

Specifying options 3 to 5 limits the extent to which the New area can be resized, negating the advantage of G1 GC by which the GC process can be completed within the target pause time. For this reason, we recommend that you do not specify these options when using G1 GC. If you omit options 3 to 5, the initial size of the New area will be 0.2 times the initial size of the Java heap. The initial size of the Eden area is based on the default value of the SurvivorRatio option, which is 8.

#3

The "size of the Survivor area" in the description in the table refers to the size of either the To space or the From space. It is not the total size of the To space and the From space.

#4

We recommend that you specify the same value for the -XX:MetaspaceSize option and the -XX:MaxMetaspaceSize option.

Figure 7‒32: Scope of options that specify the size of the areas in the Java heap area and the size of the Metaspace area

[Figure]

The following table shows the options used for G1 GC tuning. For details about each option, see 14.5 Java HotSpot VM options that can be specified in Cosminexus in the uCosminexus Application Server Definition Reference Guide.

Table 7‒10: G1 GC tuning options

No.

Option name

Default value

Description

1

-XX:MaxGCPauseMillis=value

200

Target pause time [ms]

2

-XX:ParallelGCThreads=value

Number of CPUs#

(The number of CPUs recognized by the OS)

The number of threads used for Evacuation processing

3

-XX:ConcGCThreads=value

(ParallelGCThreads + 2) / 4

The number of threads used for CM processing

#

The formula depends on the number of CPUs in the execution environment.

Organization of this section