uCosminexus Application Server, Expansion Guide

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

8.6.1 Life cycle and states of Explicit memory blocks

This subsection describes the life cycle and states of Explicit memory blocks.

The Explicit Memory Management functionality includes the following two methods of releasing the Explicit memory block:

The specification method and processing varies according to the releasing process of Explicit memory blocks. The sections 8.7 onwards describe the releasing processes in detail.

Organization of this subsection
(1) Life cycle of Explicit memory block
(2) States of Explicit memory block

(1) Life cycle of Explicit memory block

The following figure shows the life cycle of an Explicit memory block.

Figure 8-10 Life cycle of Explicit memory block

[Figure]

Each stage in the life cycle, which is shown in the figure, is described below.

Initializing and disabling the Explicit memory block
The Explicit memory block is initialized and generated.
  • Web container initializes the Explicit memory block, which stores the objects related to an HTTP session or objects for communication with the redirector.
  • In an application, if you want to place any object in the Explicit heap, explicitly initialize the Explicit memory block by using the Explicit Memory Management functionality API.
The Explicit memory block might be disabled depending on the status at the time of initialization.
The processes executed during the initialization of the Explicit memory block and the conditions by which an Explicit memory block is disabled are described in 8.6.2 Initializing the Explicit memory block.

Generating objects in the Explicit memory block
In an application, if you want to store any object in an Explicit memory block, generate and place the object in the Explicit memory block by using the Explicit Memory Management functionality API.
Details on generating objects in the Explicit memory block are described in 8.6.3 Directly generating objects in the Explicit memory block.

Extending the Explicit memory block
If the area to place objects becomes insufficient during use, JavaVM expands the Explicit memory block.
Details on expanding the Explicit memory block are described in 8.6.4 Extending the Explicit memory block.

Reserving release and releasing the Explicit memory block
The behavior of the processes of reserving release and releasing the Explicit memory block varies according to whether the automatic release functionality in the Explicit Memory Management functionality is enabled (-XX:+HitachiExplicitMemoryAutoReclaim) or disabled (-XX:-HitachiExplicitMemoryAutoReclaim).
If the automatic release functionality is enabled (-XX:+HitachiExplicitMemoryAutoReclaim)
If the automatic release functionality is disabled (-XX:-HitachiExplicitMemoryAutoReclaim)
  • Explicit release reserving of Explicit memory block
    The reserve release in Explicit memory blocks when the objects placed in the Explicit memory block become unnecessary.
  1. Web container reserves release of the Explicit memory block, which has stored objects related to the HTTP session or objects for communication with the redirector.
  2. In an application, if you have stored any object in the Explicit memory block, explicitly reserve the release of the Explicit memory block by using the Explicit Memory Management functionality API.
For details on the explicit release reserving of the Explicit memory block when the automatic release functionality is disabled, see 8.8.1 Explicit release reserving of the Explicit memory block when the automatic release functionality is disabled. Note that when the explicit release reserving is executed, the Explicit memory block is not yet destroyed.
  • Releasing of Explicit memory block
    JavaVM releases Explicit memory blocks reserved for release when the copy garbage collection or the full garbage collection occurs. It also destroys the objects placed in Explicit memory blocks at the same time. However, some objects are not destroyed and move to the Java heap.
    For details on the process of releasing the Explicit memory block when the automatic release functionality is disabled, see 8.8.2 Releasing the Explicit memory block when the automatic release functionality is disabled.

(2) States of Explicit memory block

An Explicit memory block transits through the states such as enabled, released and reserved for release at each stage in the life cycle.

Moreover, an active Explicit memory block maintains a sub-status as described in the following table.

Table 8-5 Sub-status of Explicit memory block

Sub-status Status of Explicit memory block
Enable This is the initial status. In this status, you can use all functionality of the Explicit memory block.
Disable In this status, you cannot move Java objects to the corresponding Explicit memory block. The status might change to this state when you extend the Explicit memory block.