7.6.4 Extending the Explicit memory block
This section describes the process of extending Explicit memory blocks. When you execute the expansion process, the free space in an Explicit memory block increases.
- Organization of this subsection
(1) Execution timing
JavaVM executes the extension at the following timings:
-
When placing the first object in the Explicit memory block
-
When the Explicit memory block does not have the free space required to place an object
When you try to place an object in the Explicit memory block from an application that uses the Explicit Memory Management functionality API, if the object size exceeds the free space in the placement target Explicit memory block, the expansion process is executed.
After initializing the Explicit memory block, when an object is placed in the Explicit memory block for the first time, the expansion process is invariably executed.
The Web container performs initialization and places the first object in the Explicit memory block, in which the J2EE server places objects. For details on the execution timing, see 7.4 When using J2EE server objects placed in Explicit heap.
(2) Executed details
The JavaVM secures memory area from OS and the appropriate Explicit memory block is expanded. The memory securing API is used to secure the memory area.
However, the expansion process is not executed in the following cases:
-
If you try to extend beyond the maximum limit of the Explicit heap
This is the case when the value obtained by adding the size that you are trying to extend to the total size of all Explicit memory blocks is more than the value that you specified in the -XX:HitachiExplicitHeapMaxSize option.
The sub-status of the corresponding Explicit memory block changes to Disable and placement of the object to the Explicit memory block is canceled.
Objects cannot be placed thereafter in the Explicit memory block that is changed to Disable state.
For details on the -XX:HitachiExplicitHeapMaxSize option, see the uCosminexus Application Server Application and Resource Definition Reference Guide.
-
If you try to extend the Explicit memory block having Disable sub-status
If you try to extend the Explicit memory block, the sub-status of which is Disable, placement of the object in the Explicit memory block is canceled.
The following table describes the changes in sub-status when extension of the Explicit memory block fails, for each reason.
Cause of extension failure |
Change in sub-status |
---|---|
Failed to secure memory area from OS |
Enable -> Disable |
You tried to extend beyond the maximum limit of the Explicit heap |
Enable -> Disable |
You tried to extend the Explicit memory block having Disable sub-status |
No change |