7.7.1 How to save in the New area in Java heap
This subsection describes how to manage objects that exist for a fixed time period, in the New area. In the memory size of the New area, add the memory size for these objects that exist for a fixed time, and then estimate.
You can make Full GC less likely to occur by increasing the size of the New area to limit the movement of objects to the Tenured area. However, since the number of objects in use within the New area increases when executing copy GC, the Copy processing within the New area takes time, and the time taken for executing one copy GC increases. If the execution time of copy GC is longer than the execution time of Full GC, you need to re-estimate the memory size. Depending on the size setting of the memory space, there might not be enough space to accommodate the objects with short lifespans that would usually be collected by copy GC, potentially triggering the saving of objects to the Tenured area. This will ultimately cause Full GC to occur.
You can use the extended verbosegc information to check whether the objects that exist for a fixed time period can be managed in the New area. Run the application and with the help of extended verbosegc information that is output, ensure that the memory size of the Tenured area does not increase immensely after the occurrence of copy GC.
In case of failure in managing the objects in the New area, the system performance declines immensely. Also, there are limitations for the maximum age of objects managed in the New area (Limitations differ according to the platform and version. For details, see -XX:MaxTenuringThreshold=value of 14.4 Default values of the Java HotSpot VM options that can be specified in Cosminexus in the uCosminexus Application Server Definition Reference Guide.). If you realize that the objects are not being managed in New area, consider saving and managing the objects that exist for a fixed time period, in the Tenured area. For details about how to manage objects in the Tenured area, see 7.7.2 How to save in the Tenured area in Java heap.