7.5.1 Conditions for objects that you can place in the Explicit heap
This subsection describes the Prerequisites for objects that you can place in an Explicit heap and the objects that are effective when placed.
- Organization of this subsection
(1) Prerequisites for objects that you can place
The objects that you want to place in the Explicit heap (Explicit memory block) must satisfy the following prerequisites:
-
The object must be a long-life object, which is the cause of increase in the Tenured area memory size
A certain amount of overhead is required for placing and releasing objects for Explicit memory blocks. Therefore, reduce the placing and releasing of objects in Explicit memory blocks as much as possible.
If the Explicit Memory Management functionality is not used, placing short-life objects subject to reclaim by copy GC in Explicit memory blocks does not contribute to Full GC suppression and, what is more, increases overhead. Make sure that the objects placed in Explicit memory blocks are long-life and not subject to reclaim by copy GC.
For details on how to identify long-life objects that cause an increase in the Tenured area memory size, see 9.8 Unused objects statistical functionality in the Tenured area in the uCosminexus Application Server Maintenance and Migration Guide.
-
Survival period should be known (only when you use the Explicit Memory Management functionality API)
If the Explicit management heap is used via the Explicit Memory Management functionality API, the Explicit heap blocks are not subject to GC. Therefore, used objects are not automatically reclaimed.
The objects placed in Explicit memory blocks need to be explicitly released by an application. However, if the survival period of the objects is not known, the objects cannot be explicitly released. Therefore, make sure to place only those objects, the survival period of which is known.
(2) Objects that are effective when placed
The Explicit Memory Management functionality prevents long-life objects that will be destroyed and reclaimed by Full GC after a certain period of time from being promoted to the Tenured area. Therefore, this functionality does not need to be applied to objects that are not reclaimed even by Full GC, such as objects that are used until the application stops.
The objects that are effective when placed in the Explicit heap are as follows:
-
Objects that are generated and destroyed in a fixed life cycle.
-
Objects that are not properly reclaimed after they are used and destroyed because the life cycle is longer than the time period after which the objects are promoted by copy GC
Placing the preceding objects in the Explicit heap can prevent unnecessary objects from remaining in the Tenured area and suppress occurrence of Full GC.