Hitachi

uCosminexus Application Server System Design Guide


7.2.7 Relationship between GC occurrence and memory space

GC occurs when use of memory space meets certain conditions. This subsection explains the timing with which GC occurs.

Important note

If you use the RMI to register or reference a remote object, GC might occur periodically. You can specify the timing with which GC occurs in milliseconds in either of the following properties. The default value is 3600000 milliseconds (1 hour).

  • sun.rmi.dgc.client.gcInterval property

  • sun.rmi.dgc.server.gcInterval property

To change the timing with which GC occurs, specify a value in milliseconds in either of the following properties. Note that you can specify a value in the range from 1 to Long.MAX_VALUE-1. For details, see the relevant page (http://download.oracle.com/javase/6/docs/technotes/guides/rmi/sunrmiproperties.html).

Organization of this subsection

(1) Timing of occurrence of copy GC

Copy GC occurs in the following circumstances:

  1. When there is insufficient space for allocation of the Eden area

  2. When the -copygc option is specified in the jheapprof command and executed

(2) Timing of occurrence of Full GC

Full GC occurs in the following circumstances:

  1. When the memory size being used in the New area (total of the Eden area and the Survivor area) exceeds the unused memory size for maximum value of the Tenured area, and the free space for allocation to the Eden area is insufficient

    Important note

    The preceding circumstances will not always trigger Full GC. In these circumstances, the JavaVM determines whether to execute Full GC based on the following value:

    • The average value is weighed and calculated according to the time when the copy GC occurred for the objects moved from the New area to the Tenured area during a past copy GC

  2. When an attempt to move objects from the New area (total of the Eden area and the Survivor area) to the Tenured area fails as a result of copy GC

  3. When there is an allocation request of memory size (size of Java object) that exceeds the individual unused memory size of the New area and the Tenured area

  4. When one of the following occurs as a result of the copy GC:

    • When the unused memory size of the allocated Tenured area falls below 10,000 bytes

    • When the allocated Tenured area is extended due to the transfer of objects to the Tenured area during the copy GC

  5. When the java.lang.System.gc() method is executed

  6. When the memory size to be allocated to the Metaspace area exceeds the unused memory size of the allocated Metaspace area.

  7. When the javagc command is executed.

  8. When the jheapprof command is executed.

Ensure that mainly above step 1 and step 3 do not occur while JavaVM is being tuned.

Reference note

You can use the extended verbosegc information for checking the occurrence factors of the Full GC. For details about how to check the factors for occurrence of Full GC, see 7.10 Analyzing the factors of Full GC using the extended verbosegc information.