Hitachi

uCosminexus Application Server System Design Guide


9.4.2 Concept of setting up the threshold value

You can calculate the threshold value by keeping the value calculated with the following formula as the standard:

Threshold-value ≤ 100 - (100 × Free-memory-size-required-while-waiting-for-cancellation-of-resource-exclusion) / Maximum-memory-size

Consider the following points when setting up the threshold value:

The relationship between the occurrence frequency of Full GC and the threshold value, and the method for estimating the free memory size required while waiting for cancellation of resource exclusion are as follows:

Organization of this subsection

(1) Relationship between the occurrence frequency of Full GC and the threshold value

The processing of Full GC takes more time as compared to the execution speed of any program. Therefore, when tuning JavaVM, try to avoid the occurrence of Full GC as far as possible. For details about the concept of JavaVM tuning, see 7.3.1 Concept of tuning.

You must also tune in such a way so that setting up a threshold value reduces the frequency of a Full GC to be executed explicitly.

The following figure shows an example of memory usage for each setup threshold value:

Figure 9‒2: Example of memory usage for each setup threshold value

[Figure]

The memory usage in JavaVM keeps increasing along with the passage of time, and reduces when Full GC occurs.

When you set up 0 as the threshold value, Full GC will not be executed until JavaVM executes it automatically. As compared to the specification of a large value, when you set up a small value as the threshold value, the frequency of occurrence of Full GC increases. In the figure, when 80 is set up as the threshold value, the frequency of execution of Full GC can be suppressed down as compared to the case where 50 is set up as the threshold value.

However, when the execution frequency of Full GC is reduced, the time taken for the execution of one Full GC becomes longer as compared to when Full GC is executed more frequently.

(2) Estimating the free memory required while waiting for cancellation of the resource exclusion

When the memory usage exceeds the threshold value, Full GC will not be executed until the resource exclusion is cancelled. However, while waiting for cancellation of resource exclusion, if the memory required by JavaVM becomes insufficient, Full GC will be executed by JavaVM without waiting for cancellation of resource exclusion.

The following figure shows an example in which the memory becomes insufficient while waiting for cancellation of resource exclusion:

Figure 9‒3: Example of a case when the memory becomes insufficient while waiting for cancellation of resource exclusion

[Figure]

Tip

For details about the free memory size required to avoid the occurrence of Full GC in JavaVM, see 7.2.7 Relationship between GC occurrence and memory space.

When you set up the memory size for the occurrence of Full GC to 100, the memory size that can be used while waiting for cancellation of resource exclusion will be 100 - Threshold value (%).

For example, if you set up a large value, such as 95 as the threshold value, the free memory size that can be used while waiting for cancellation of resource exclusion will be minimal at 5%, and therefore, Full GC might be executed automatically by JavaVM before the cancellation of the resource exclusion.

Therefore, when estimating the threshold value, set up a value with a considerable margin such that the memory does not become insufficient while waiting for cancellation of the resource exclusion.

Important note

When JavaVM executes Full GC due to insufficient free memory size while waiting for cancellation of resource exclusion, Full GC will be executed once again when the exclusion of the resource is cancelled, due to Full GC control.