Hitachi

uCosminexus Application Server Expansion Guide


7.10.3 Using object release rate information of the Explicit memory block

The huge blocks, which cause a long time for automatic release processing of the Explicit memory block, are generated because long-lived objects, which are used until the application stops, are generated and placed because a user program or framework is used. For effectively using the Explicit Memory Management functionality, you must identify the objects, which cause generation of these huge blocks, and make sure that those objects are not placed in the Explicit heap.

Organization of this subsection

(1) Outputting object release rate information of Explicit memory block

You can identify the objects that cause generation of huge blocks if you use object release rate information. The object release rate information is the rate of objects released by automatic release processing of the Explicit memory block. It can be understood that the objects having low release rate in huge blocks are the objects, which cause generation of huge blocks. If you specify freeratio option in eheapprof command and execute the command, you can output the object release rate information in the Explicit heap information of extended thread dump. Refer to this information and specify classes of the objects in the configuration file for Explicit Memory Management functionality application exclusion. For details on how to specify in the configuration file for Explicit Memory Management functionality application exclusion, see 7.13.3 Controlling application target of the Explicit Memory Management functionality by using a configuration file.

The following figure shows an example of output of object release rate information.

Figure 7‒18: Example of output of object release rate information

[Figure]

In this figure, the Java VM performs Full GC and automatic release processing for Explicit memory blocks to obtain object release rate information. Because these processing might stop the application for few seconds, we recommend that you output the object release rate information when developing the system or when the work is stopped.

The object release rate information, which is output here, is calculated on the basis of the result of first automatic release processing that is generated when outputting the information. Hence, we recommend that you acquire the object release rate information multiple times for increasing the accuracy.

(2) Executed details

If you specify -freeratio option in eheapprof command and execute the command, JavaVM executes the following processing:

  1. Performing Full GC

  2. Automatic release reservation of Explicit memory blocks generated by automatic placement functionality and Explicit memory blocks, for which explicit release reservation is performed before executing eheapprof command

    - is output to object release rate of Explicit memory blocks, which were not targeted for automatic release reservation.

  3. Automatic release processing of Explicit memory blocks, for which automatic release reservation described in step 2, is performed

    JavaVM obtains and retains the information of number of objects for each class in the Explicit memory block unit before and after automatic release processing.

  4. Output of the object release rate information, which is calculated from the information acquired in step 3, to extended thread dump

The following figure shows an example of calculating object release rate information.

Figure 7‒19: Example of calculating object release rate information

[Figure]

If there are objects that are referred from outside (the Explicit memory block not targeted for releasing), move the objects to a new Explicit memory block when executing automatic release processing. Similar to the Explicit memory block 6, if multiple Explicit memory blocks exist before automatic release, calculate object release rate from the total value of number of objects in multiple Explicit memory blocks and the number of objects in a new Explicit memory block.

For details on how to specify eheapprof command and output contents of Explicit heap information, see eheapprof (Output of extended thread dump containing the Explicit heap detailed information) in the uCosminexus Application Server Command Reference Guide.