7.7.2 How to save in the Tenured area in Java heap
You can use the -XX:MaxTenuringThreshold=value option for setting the maximum age of objects that are managed in the New area. For example, if you specify -XX:MaxTenuringThreshold=2, all the objects for which the third copy GC is executed, move to the Tenured area.
If you use this method, fewer objects are subject to copy GC and execution time is reduced. However, because a large number of objects are moved to the Tenured area, Full GC will routinely occur when the Tenured area becomes full. To ensure the stable operation of the system, forcibly trigger Full GC at appropriate times, such as when the load on the system is low. You can trigger Full GC using the following methods:
-
Call the System.gc() method within the program.
-
Execute the javagc command.
For details about the javagc command, see javagc (forcibly perform GC) in the uCosminexus Application Server Command Reference Guide.