Hitachi

uCosminexus Application Server System Design Guide


7.14.5 Checks and measures when an object is transited to the Java heap during the explicit release processing of the Explicit memory block

When there is a reference available for the objects within the Explicit heap that is to be released during the explicit release processing of the Explicit memory block, the referenced object and the objects referenced either directly or indirectly from that object, are transited to the Java heap. The object is transited to the Tenured area on priority. Therefore, when the object is transited frequently, the used size of the Tenured area increases resulting in Full GC.

You can investigate whether the object is transited to the Java heap through the extended verbosegc information of the JavaVM log file or the explicit management heap event log.

Organization of this subsection

(1) Checking by using the extended verbosegc information

When the Explicit Memory Management functionality is not used, the used size of the Tenured area increases only when the copy GC occurs. Therefore, the used size of the Tenured area after the Nth copy GC completion matches the used size of the Tenured area before the N+1th copy GC starts.

As a result, when the objects are transited from Explicit heap to Java heap, the used size of the Tenured area increases during the Explicit heap release. From this difference, it is concluded that the objects start transiting during the explicit release processing of the Explicit memory block.

You can calculate the size of the object transited to the Java heap during the explicit release processing of the Explicit memory block after completion of the Nth copy GC by the following formula:

Size-of-object-transited-from-Explicit-heap-to-Java-heap
=tenured-area-used-size-before-N + 1th-Copy-GC
 -Tenured-area-used-size-after-Nth-Copy-GC

(2) Checking by using the event log of the explicit management heap

When none is not specified in the -XX:HitachiExplicitMemoryLogLevel option of JavaVM, a log related to the explicit release processing of the Explicit memory block is output. In this log, you can directly check the increase in the size of the used memory of the Tenured area during the explicit release processing of the Explicit memory block.

An output example is as follows:

[ENS]Tue Jul 24 01:23:51 2007[EH: 12800K->11776K(11776K/65536K), 0.1129602 secs][E/F/D: 523/0/0]\
[DefNew::Eden: 0K->0K(243600K)][DefNew::Survivor: 0K->0K(17400K)][Tenured: 103400K->103464K(556800K)][cause:Reclaim]

Of the parts that are highlighted and bolded, [cause:Reclaim] indicates that the information was output when the Explicit memory block was explicitly released. Furthermore, [DefNew::Eden: 0K->0K(243600K)][DefNew::Survivor: 0K->0K(17400K)][Tenured: 103400K->103464K(556800K)] indicates the change in the Java heap during the explicit release processing of the Explicit memory block. In this example, the memory size of the Tenured area is increased from 103,400 Kilobytes to 103,464 Kilobytes. That is, the memory size is increased by 64 Kilobytes. From this, it is concluded that an object of 64 Kilobytes is transited from the Java heap during the explicit release processing of the Explicit memory block.

Moreover, when verbose is specified in the -XX:HitachiExplicitMemoryLogLevel option of JavaVM, information related to released Explicit memory block is also output. As a result, you can check by which Explicit memory block release the used size of the Tenured area has increased.

An output example is as follows:

[ENS]Tue Jul 24 01:23:51 2007[EH: 12800K->11776K(11776K/65536K), 0.1129602 secs][E/F/D: 523/0/0]\
[DefNew::Eden: 0K->0K(243600K)][DefNew::Survivor: 0K->0K(17400K)][Tenured: 103400K->103464K(556800K)][cause:Reclaim]
[EVS]["REM2" eid=2/R: 320K]["BEM3" eid=5/B: 320K]["BEM1" eid=7/B: 384K]

Parts that are highlighted and bolded indicate the released Explicit memory block. From the output contents, it is understood that the object of 64 Kilobytes transited to Java heap, is transited from the Explicit memory block of either (REM2) (BEM3) (BEM1).

Also, when debug is specified in the -XX:HitachiExplicitMemoryLogLevel option of JavaVM, you can check the object referenced as the object within the Explicit heap to be released during the explicit release processing.

An output example is as follows:

[EDO][eid=3: Reference to ClassZ(0x1234680), total 64K]
[EDO] ClassU(0x1233468)(Tenured)

Following can be understood from [eid=3: Reference to ClassZ(0x1234680), total 64K]:

Moreover, from (ClassU(0x1233468)(Tenured)), it can be concluded that the object that refers to the instance of "Class Z" is the instance of "Class U".

Based on this information, modify the Java program in such a way so that there is no reference to the object in the Explicit memory block during the explicit release processing of that Explicit memory block.