The memory size of the Tenured area is estimated based on the minimum memory size required by an application. If the required memory size cannot be allocated, OutOfMemoryError occurs and JavaVM stops.
The memory size required by an application can be decided based on the used memory size after full garbage collection that can be checked from the extended verbosegc information displayed during the execution of full garbage collection. This is based on the consideration that the memory size, after full garbage collection has deleted all unnecessary objects from the entire Java heap, is close to the memory size required by the application.
The following example of output shows the extended verbosegc information when full garbage collection is executed:
... [VGC]Wed May 11 23:12:05 2005[Full GC 31780K->30780K(32704K), 0.2070500secs][DefNew::Eden: 3440K->1602K(3456K)][DefNew::Survivor:58K->0K(64K)][Tenured: 28282K->29178K(29184K)][Perm:1269K->1269K(4096K)][cause:ObjAllocFail][User: 0.0156250 secs][Sys: 0.0312500 secs] ... |
From the information that follows 'Full GC', check the information '->30780K' that is output after executing a garbage collection. Here, we understand that the memory size of 30,780 kilobytes is required after executing full garbage collection.
Collect the extended verbosegc information of numerous full garbage collections and consider the information with the largest area after executing the garbage collection, as the memory size required by the application.