7.13.2 When the cause of increase in the used size of the Tenured area is not known
Even after implementing the Survivor area tuning, there is an increase in the used size of the Tenured area. As a result, when the occurrence interval of Full GC does not fulfill the system requirements, the objects that cause increase in the used size of the Tenured area are generated in Explicit heap. Set the automatic allocation setup file of Explicit Memory Management to generate objects in Explicit heap.
The following point describes how to investigate the objects that cause increase in the used size of the Tenured area and how to setup the automatic allocation setup file:
- Organization of this subsection
(1) Investigating increase in the used size of the Tenured area
Specify the -garbage option in the jheapprof command for the applications that are running, and execute the unused objects statistical function in the Tenured area.
In earlier versions than 08-70, to use the -garbage option concurrently with the automatic allocation function (-XX:+HitachiAutoExplicitMemory) of Explicit memory block, you must start the Application Server in a status where the -XX:-HitachiExplicitMemoryPartialTenuredAreaCollection option is specified beforehand.
The following is an output example of unused object statistical function in the Tenured area. This function outputs the list of class names of objects (basic objects that cause increase in the Tenured area) that cause increase in the used size of the Tenured area to Thread dump log file:
Garbage Profile Root Object Information ----------------------------------- *, java.util.HashMap # 35234568 *, java.util.WeakHashMap # 4321000
In this output example, it is understood that the java.util.HashMap object is of 35,234,568 bytes and the java.util.WeakHashMap object is of 4,321,000 bytes that is the cause for increase in the used size of the Tenured area. For details about the unused object statistical function in the Tenured area, see 9.8 Unused objects statistical functionality in the Tenured area in the uCosminexus Application Server Maintenance and Migration Guide.
(2) Description of the automatic allocation setup file
Enter some part of output examples list (last 2 lines) of the unused object statistical function in the Tenured area to automatic allocation setup file. An example for setting automatic allocation setup file is as follows:
*, java.util.HashMap # 35234568 *, java.util.WeakHashMap # 4321000
In such cases, all the java.util.HashMap objects and java.util.WeakHashMap objects in the program are generated in Explicit heap.
All the objects saved in above objects are moved sequentially to Explicit heap. The runtime overhead when generating objects in Explicit heap is higher as compared to generating objects in Java heap. Therefore, when generating objects in Explicit heap, you can reduce the runtime overhead by setting up the objects generating.
In the automatic allocation setup file, * indicates all-the-classes-running-in-JavaVM. In this setup example, the position for generating java.util.HashMap and java.util.WeakHashMap objects in all the classes is Explicit heap. As a result, the position for generating objects that do not cause increase in the used size of the Tenured area is Explicit heap, and this might cause an increase in Explicit heap.
By specifying *, when the throughput of applications does not fulfill the requirements, determine the methods to sort positions for generating objects that cause increase in the used size of the Tenured area.
When the system administrator and application developer are two different people, the request for investigations must be sent to application developer. Even though it is difficult to perform detail investigation of the application, you can specify positions for generating objects in 4 stages such as "All classes", "Specific packages", "Specific classes", and "Specific methods" in the automatic allocation setup file. You can implement sorting on the range where investigations can be performed and can improve the throughput by specifying the automatic allocation setup file.
For example, when the position for generating object is under the com.abc.defg package, by changing the example for setting the automatic allocation setup file as follows you can sort from "All classes of all packages" to "All classes of com.abc.defg package and sub packages":
com.abc.defg.*, java.util.HashMap # 35234568 com.abc.defg.*, java.util.WeakHashMap # 4321000
For details about how to specify the automatic allocation configuration file, see 7.13.2 Using the Explicit Memory Management functionality by using the automatic placement configuration file in the uCosminexus Application Server Expansion Guide.
(3) Investigating applications by the unused object statistical function in the Tenured area
To investigate the application based on contents of the automatic allocation setup file, use the unused object statistical function in the Tenured area.
Specify the -garbage option in the jheapprof command and execute the unused object statistical function in the Tenured area to output the list of basic objects that cause increase in the Tenured area and the statistical information of unused objects in the Tenured area to the extended thread dump. The following is an output example of extended thread dump:
Garbage Profile
---------------
________________Size__Instances__Class________________
35234568 10648 java.util.HashMap
5678900 10668 [Ljava.util.HashMap$Entry;
4456788 7436 java.util.HashMap$Entry
4321000 200 java.util.WeakHashMap
1234568 190 [Ljava.util.WeakHashMap$Entry
1456788 9524 java.lang.String
1256788 6424 com.abc.defg.MyData;
:There are objects that are saved to java.util.HashMap or java.util.WeakHashMap and not output to list of basic objects that cause increase in the Tenured area. These objects are output by the unused object statistical function in the Tenured area. The number of instances of each object are also output.
You can acquire this log multiple times and provide the log as an input file for the class-wise statistical information analysis function (jheapprofanalyzer command) to investigate the changes in each object size and time of the number of instances.
Investigate the applications based on the above information and sort the positions for generating objects. For details about the unused object statistical function in the Tenured area, see 9.8 Unused objects statistical functionality in the Tenured area in the uCosminexus Application Server Maintenance and Migration Guide. For details about the class-wise statistical information analysis function, see 9.10 Class-wise statistical information analysis functionality in the uCosminexus Application Server Maintenance and Migration Guide.