Hitachi

uCosminexus Application Server Expansion Guide


7.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

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

Figure 7‒9: 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.

  • 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 7.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 7.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 7.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 you use the javagc command, you can execute the release process at any time, for Explicit memory blocks that are not released. For details on the release process of Explicit memory blocks by using the javagc command, see 7.9 Releasing Explicit memory blocks by using the javagc command.

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.

  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 7.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.

(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 7‒4: 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.