uCosminexus Application Server, Expansion Guide

[Contents][Index][Back][Next]

8.6.5 Moving the objects from the Java heap to the Explicit memory block based on a reference relation

When objects move from the Java heap to the Explicit memory block, the objects in the Java heap that are being referenced from objects in the Explicit memory block automatically move to the Explicit memory block. Therefore, you need not set the movement from the Java heap to the Explicit memory block for the objects that have relationship with the moving objects. However, if you specify the -XX:+ExplicitMemoryUseExcludeClass option, objects of the classes that are coded in the configuration file for Explicit Memory Management functionality application exclusion do not move to the Explicit memory blocks.

Note that the Explicit memory blocks, which are created by the automatic placement functionality, are targeted for movement of objects based on a reference relationship from the Java heap to the Explicit memory block. The Explicit memory blocks created by the Explicit Management Heap API are not targeted.

Reference note
When a full garbage collection occurs, if the following phenomena occur after a large number of objects are moved to the Explicit heap, examine the operation, which does not let move the objects that are targeted for movement on the basis of a reference relation to the Explicit memory block.
  • The processing of automatic release of the Explicit memory blocks takes time
  • Small amount of Tenured area is used
Use the following functionalities for not moving the objects to the Explicit memory block:
  1. Functionality for controlling object movement to the Explicit memory block
  2. Functionality for specifying classes to be excluded from an application of the Explicit Memory Management functionality
The first functionality does not move the objects to the Explicit heap when a full garbage collection occurs. By using this functionality, you can reduce the time required for the processing of automatic release of Explicit memory blocks. The second functionality does not move the objects of the classes specified in the configuration file, to the Explicit heap when a copy garbage collection occurs. You can reduce the number of objects to be moved to the Explicit heap depending on the specified classes. If you use the second functionality, the first functionality is also enabled. Use the second functionality when a large number of objects are to be moved to the Explicit heap and the processing of automatic release of Explicit memory blocks takes time even if you use the first functionality.
Organization of this subsection
(1) Execution timing
(2) Executed details

(1) Execution timing

The objects are moved when the copy garbage collection and full garbage collection occurs.

(2) Executed details

After the copy garbage collection or full garbage collection processing is over, investigation is performed to check the existence of the Explicit memory blocks that JavaVM has not reserved for release. Find a reference relationship from the objects that are the basis of investigation and continue the investigation until you are done with all the reference locations. The areas other than the Java heap are not targeted for the investigation of a reference relationship. The objects referenced from the Explicit memory block are targeted for movement.

Figures 8-11 and 8-12 describe the flow of the movement of objects in accordance with these rules with examples. Specifying 0 in the -XX:ExplicitMemoryFullGCPolicy option is a prerequisite for the flow of the movement of objects described here.

Figure 8-11 Objects that move on the basis of a reference relationship (Example 1)

[Figure]

The objects in the figure move in the following sequence:

  1. Object 1 is being referenced from an object in the Explicit memory block 1. Therefore, the object 1 moves to the Explicit block 1.
  2. Object 9 also moves to the Explicit memory block 1 because it is being referenced from the object 1.
  3. In the same way as in points 1 and 2, the object 4, object 10, and object 11 move to the Explicit memory block 2.
  4. Object 6 is being referenced from an object in the Explicit memory block 2. However, it is not an object in the Java heap and hence it does not move.
  5. In the same way as in point 4, the object 12 also does not move.

    Figure 8-12 Objects that move on the basis of a reference relationship (Example 2)

    [Figure]

The objects in the figure move in the following sequence:

  1. Object 13 is in the Java heap and can be accessed from an object in the Explicit memory block 2. However, it does not move because the investigation terminates at object 12.
  2. Like object 13, the object 15 is referenced from the Perm area. However, in addition to the reference, the object can be accessed from an object in the Explicit memory block 2 without involving the Perm area or any other Explicit memory block. Therefore, it moves to the Explicit block 2.
  3. Although the object 5 is being referenced from the Explicit memory block 1 as well as the Explicit memory block 2, it moves to the Explicit memory block 1.
    Note that the object 5 is being referenced from the Explicit memory block 1 as well as the Explicit memory block 2. In such cases, although it moves to either the Explicit memory block 1 or 2, it is not defined to which Explicit memory block it will move to.

In the case of following conditions, operation will be different than described in the example.