uCosminexus Application Server, Expansion Guide
With the Explicit Memory Management functionality, a full garbage collection is inhibited by placing the objects from among the long-lived objects, which become unnecessary over a certain period of time, in an Explicit heap and recovering the objects by release processing. In this mechanism, because survival time matches easily, the objects placed in an Explicit heap and the objects in reference relationship are moved from the Java heap to the Explicit memory block on the basis of a reference relationship and managed collectively in an Explicit heap.
However, depending on the operation, objects, which are moved to the Explicit memory block, might greatly increase size of the Explicit memory block and automatic release processing might take long time due to that. Because the system stops during automatic release processing of the Explicit memory block, long time of automatic release processing might create a problem in the system. Explicit memory blocks having large size are called huge blocks. Depending on the movement based on a reference relationship, the objects having different life span move to one block and repetition of this makes the block huge. When a reference relationship is complex and an application developer cannot understand it, huge blocks will generate easily.
Table 8-9 Types of Java object
| Sr.No. | Category | Type of object | Release timing | Appropriate memory area for placement |
|---|---|---|---|---|
| 1 | Short-lived objects | Objects temporarily used in request processing and response processing | When copy garbage collection occurs | Java heap (New area)#1 |
| 2 | Long-lived objects | Objects that become unnecessary over a certain period of time | When executing automatic release processing | Explicit heap |
| 3 | Objects required for operating the application and used until the application stops | When application stops | Java heap (Tenured area)#2 |
#1 If you place the objects in the Explicit heap, generation and automatic release processing of an Explicit memory block occurs frequently and it causes overhead. Hence, an Explicit heap is not appropriate.
#2 If you place the objects in the Explicit heap, huge blocks generate and automatic release processing takes a long time. Hence the Java heap is not appropriate.
The following subsections describe the mechanism of reducing the time required for automatic release processing, by comparing the cases of using and not using the functionality.
This subsection describes the mechanism if you are not using the functionality for controlling object movement to the Explicit memory block and functionality for specifying classes to be excluded from the application of the Explicit Memory Management functionality. The following figure shows an example of three Explicit memory blocks that move objects on the basis of a reference relationship.
Figure 8-15 If not using the functionality for controlling object movement to the Explicit memory block and functionality for specifying classes to be excluded from the application of the Explicit Memory Management functionality
If you are not using the functionality for controlling object movement to the Explicit memory block and functionality for specifying classes to be excluded from the application of the Explicit Memory Management functionality, the objects move from the Java heap to the Explicit memory block on the basis of a reference relationship when garbage collection occurs. In case of the Explicit memory block 1, moved object is the object, which is used until the application stops. Because this object is not recovered in automatic release processing, it continues to remain in the Explicit memory block. Because the total size of the object in the Explicit memory block 1 is not huge as shown in this figure, there is no problem at this stage. However, depending on a reference relation of the object, object in reference location moves to an Explicit memory block on the basis of a reference relationship whenever a garbage collection occurs. Because the movement based on this reference relationship continues until the application stops, The Explicit memory block 1 might become a huge block. In the case of the Explicit memory block 2, because the moved object is huge, it becomes a huge block. Thus, if the objects that are not appropriate are placed in large numbers in the Explicit heap, the Explicit memory block becomes huge block and automatic release processing takes a long time.
This subsection describes the mechanism if you are using the functionality for controlling object movement to the Explicit memory block. The following figure shows an example of three Explicit memory blocks that move objects on the basis of a reference relationship.
Figure 8-16 If using the functionality for controlling object movement to the Explicit memory block
If you are using the functionality for controlling object movement to the Explicit memory block, the objects do not move from the Java heap to the Explicit memory block on the basis of a reference relationship even if a full garbage collection occurs. If you use this functionality, you might have to reset the memory size of the Java heap area because the objects placed in the Java heap increase.
If huge blocks are generated even if you use this functionality, use the functionality for specifying classes to be excluded from the application of the Explicit Memory Management functionality.
This subsection describes the mechanism if you are using the functionality for specifying classes to be excluded from the application of the Explicit Memory Management functionality in addition to the functionality for controlling object movement to the Explicit memory block. The figure below shows an example of three Explicit memory blocks that move objects on the basis of a reference relationship. Here, assume that the classes of objects, which are moved to the Explicit memory block 1 and Explicit memory block 2, are set in the configuration file for Explicit Memory Management functionality application exclusion.
Figure 8-17 If using the functionality for specifying classes to be excluded from the application of the Explicit Memory Management functionality in addition to the functionality for controlling object movement to the Explicit memory block
If you are using the functionality for specifying classes to be excluded from the application of the Explicit Memory Management functionality, objects of the classes specified in the configuration file for Explicit Memory Management functionality application exclusion are excluded from the target of the Explicit Memory Management functionality and the objects do not move to the Explicit memory block from the Java heap even if a copy garbage collection occurs. These objects move to Tenured area at the time of rising. If you use this functionality, you might have to reset the memory size of the Java heap area because the objects placed in the Java heap increase.
Configuration files for Explicit Memory Management functionality application exclusion used in the functionality for specifying classes to be excluded from the application of the Explicit Memory Management functionality have the following two types:
If you perform settings (specifying -XX: ExplicitMemoryUseExcludeClass option) for using the functionality for specifying classes to be excluded from the application of the Explicit Memory Management functionality, the classes specified in sysexmemexcludeclass.cfg are excluded from the application of the Explicit Memory Management functionality and the objects of those classes do not move to Explicit heap. If you want to specify more objects to be excluded from the application of the functionality, specify classes of the objects to be excluded from application in exmemexcludeclass.cfg or in a configuration file for Explicit Memory Management functionality application exclusion having any file name. If you want to apply Explicit Memory Management functionality to objects of classes specified in sysexmemexcludeclass.cfg, specify those classes in the configuration file for disabling application exclusion of the Explicit Memory Management functionality (exmemnotexcludeclass.cfg). Thus, you can reduce the objects to be moved to the Explicit heap depending on the classes specified in configuration file. The classes excluded from the application of the Explicit Memory Management functionality specify object release rate of the Explicit heap information, which is output in thread dump, for reference. For details on object release rate, see 8.10.3 Using object release rate information of Explicit memory block.
From among the objects, for which reference path passes through the objects excluded from the application of the Explicit Memory Management functionality, the objects that are not referenced from the path of objects other than Explicit Memory Management functionality application exclusion are also excluded from the application of the Explicit Memory Management functionality. The following figure shows an example of multiple reference paths from objects, which are targeted for exclusion from the application of the Explicit Memory Management functionality.
Figure 8-18 Example of having multiple reference paths from objects targeted for exclusion from the application of the Explicit Memory Management functionality
In this figure, object B is an object excluded from the application of the Explicit Memory Management functionality. The following are the reference paths passing through object B:
Among these, because there is a reference path D->C1 for object C1 and E->C3 for object C3, these objects move to the Explicit memory block on the basis of a reference relationship. On the other hand, because object C2 does not have a reference path other than the path passing through object B, it is excluded from the application of the Explicit Memory Management functionality and does not move to the Explicit memory block.
All Rights Reserved. Copyright (C) 2013, 2015, Hitachi, Ltd.