Hitachi

uCosminexus Application Server System Design Guide


7.15.9 Concurrent Marking (CM)

Figure 7‒29: Flow of Concurrent Marking

[Figure]

Organization of this subsection

(1) Triggers

Concurrent Marking (CM) broadly consists of the following five types of processing, the trigger for each of which is explained. Note that the labels 1. to 5. correspond to 1. to 5. in the preceding figure.

  1. Concurrent Root Region Scan:

    Executed after young GC (initial-mark) is completed.

  2. Concurrent Mark:

    Executed immediately after 1. has completed.

  3. Remark:

    Executed when there is an opportunity to pause the application after 2. has completed.

  4. Cleanup:

    Executed when there is an opportunity to pause the application after 3. has completed.

  5. Concurrent Cleanup:

    Executed immediately after 4. has completed.

(2) Target

New area, Tenured area, and Humongous area

(3) Processing

CM broadly consists of the following five types of processing. The following describes each type of processing in detail.

  1. Concurrent Root Region Scan:

    Processing that involves marking objects in the Survivor area that are directly referenced by local variables and in-use objects. This processing uses multiple threads.

  2. Concurrent Mark:

    Processing that involves marking objects that are referenced by objects marked by young GC (initial-mark) and by the marking in 1. This processing uses multiple threads.

  3. Remark:

    Processing that re-marks objects whose referential relationships changed during the marking in 2. This processing uses multiple threads.

  4. Cleanup:

    Processing that determines the total size of in-use objects in each region. Cleanup processing also initializes markings in preparation for the next CM phase. This processing uses multiple threads.

  5. Concurrent Cleanup:

    Processing that reclaims regions that do not contain any in-use objects. This processing is single-threaded.

(4) Processing results

Eden area:

Areas corresponding to in-use objects are marked.

If Eden regions are reclaimed by the processing in 5., the size of the area is reduced.

Survivor area:

Areas corresponding to in-use objects are marked.

If Survivor regions are reclaimed by the processing in 5., the size of the area is reduced.

Tenured area:

Areas corresponding to in-use objects are marked.

If Tenured regions are reclaimed by the processing in 5., the size of the area is reduced.

Humongous area:

Areas corresponding to in-use objects are marked.

If the Humongous region is reclaimed by the processing in 5., the size of the area is reduced.

Metaspace area:

Unchanged.

Free area:

If regions that do not contain any in-use objects are reclaimed, the size of the Free area increases.

(5) Pausing of applications

  1. Concurrent Root Region Scan:

    Executed in a CM thread without pausing the application.

  2. Concurrent Mark:

    Executed in a CM thread without pausing the application.

  3. Remark:

    Executed in a VM thread with the application paused.

  4. Cleanup:

    Executed in a VM thread with the application paused.

  5. Concurrent Cleanup:

    Executed in a CM thread without pausing the application.

Although the application is not paused, the processing associated with young GC (normal), Full GC, or securing the new region will be paused if Full GC occurs or a new region is secured between the conclusion of the processing in 4. and the conclusion of the processing in 5. This pause continues until the conclusion of the processing in 5.

(6) Relationship with other GC methods

Note: Young GC (initial-mark) will not occur during CM processing.

  1. Concurrent Root Region Scan:

    • Young GC (normal): Not executed.

    • Mixed GC: Not executed.

    • Full GC: Not executed.

  2. Concurrent Mark:

    • Young GC (normal): If triggered during the processing in 2., the processing in 2. is paused. This processing resumes when young GC (normal) has completed.

    • Mixed GC: Not executed.

    • Full GC: If triggered during the processing in 2., the processing in 2. is paused. The results of Concurrent Mark to that point are discarded.

  3. Remark:

    • Young GC (normal): Not executed.

    • Mixed GC: Not executed.

    • Full GC: Not executed.

  4. Cleanup:

    • Young GC (normal): Not executed.

    • Mixed GC: Not executed.

    • Full GC: Not executed.

  5. Concurrent Cleanup:

    • Young GC (normal): If triggered during the processing in 5., young GC (normal) waits until the processing in 5. has completed.

    • Mixed GC: Not executed.

    • Full GC: If triggered during the processing in 5., Full GC waits until the processing in 5. has completed.

(7) Supplementary notes

Because VCM log entries span multiple lines, Start is output when CM starts and End when it ends. The End log entry outputs the CPU usage time from the start to the end of CM processing, with the Start log entry showing 0. For details about how to interpret this information, see -XX:[+|-]HitachiVerboseGC (Option for extended verbosegc information output) in the uCosminexus Application Server Definition Reference Guide.

Because the application is paused during Remark and Cleanup processing, this processing is logged by a VG1 log entry. You can identify Remark and Cleanup processing by the labels CM Remark and CM Cleanup representing the GC type in the GC log entry.