7.5.1 Calculating the memory size required by an application
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 GC that can be checked from the extended verbosegc information displayed during the execution of Full GC. This is based on the consideration that the memory size, after Full GC 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 GC 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)][Metaspace:3634K(4492K, 4492K)->3634K(4492K, 4492K)][class space: 356K(388K, 388K)->356K(388K, 388K)][cause:ObjAllocFail][User: 0.0156250 secs][Sys: 0.0312500 secs] ...
The information ->30780K output after Full GC indicates that 30,780 KB of memory is required after GC is executed.
Collect the extended verbosegc information for several occurrences of Full GC. The largest value is the memory size required by the application.