7.7.3 The process of releasing the Explicit memory block when the automatic release functionality is enabled
The process of releasing the Explicit memory block when the automatic release functionality is enabled, is executed for the Explicit memory blocks that are reserved in advance by automatic release reserving and explicit release reserving. The release processing deletes the unnecessary Explicit memory blocks from the memory.
Note that if the objects that are being referenced from outside (Explicit memory blocks which are not targeted for releasing) exist, the objects are moved to a new Explicit memory block.
- Organization of this subsection
(1) Execution timing
The Java VM releases Explicit memory blocks according to the reservation made for automatic release when the same type of GC that caused the reservation to be made occurs.
(2) Executed details
The executed details are same as in the case of the processing of releasing the Explicit memory block when the automatic release functionality is disabled, except for the behavior of objects that are being referenced from the Explicit memory blocks, which are not targeted for releasing. For the details that are executed in the process of releasing Explicit memory blocks, see 7.8.2 The process of releasing the Explicit memory block when the automatic release functionality is disabled.
In the case of the following conditions, the operation will be different.
-
In the case you cannot secure free space in the Explicit memory block
This corresponds to the case when there is no free space in the placement destination Explicit memory block for placing objects targeted for placement at the time of placing objects in the Explicit memory block. In such cases, you cannot place an object in the Explicit memory block. The objects, which cannot be placed, are placed in the Java heap area.
-
If the Java heap overflows when moving objects to the Java heap
This corresponds to the case when objects cannot be moved because the area of the Explicit memory block cannot be secured and there is no free space in the movement destination Java heap when the object moves to the Java heap. In this case, Full GC is performed and free space is secured in the Java heap. The objects move to the Java heap after Full GC ends.
If the free space required for moving Java objects cannot be secured even when Full GC is performed, a log file is output and the objects are placed in the Explicit memory blocks again. For details on the log files that are output, see 4.19 Event log of the Explicit Memory Management functionality in the uCosminexus Application Server Maintenance and Migration Guide.
-
If sufficient free space cannot be secured by Full GC
This corresponds to the case where the Java heap ran out of free space and the free space required for moving Java objects cannot be secured even by performing Full GC. In such cases, JavaVM aborts as it does in the case of an insufficient C heap. However, in the case of an insufficient C heap, the required memory size is output as nnn in the prompt request nnn bytes. When JavaVM aborts, 0 is always output as nnn.