Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8302215

G1: Last-ditch Full GC should do serial compaction for tail regions in per thread compaction points.



    • Enhancement
    • Resolution: Fixed
    • P5
    • 21
    • 21
    • hotspot
    • gc
    • b11


      For the parallel compaction, target regions are distributed in a round-robin manner. At the end of the parallel compaction, we may have several partially filled target regions. Re-preparing these regions using a serial compaction phase should achieve better compaction. Currently, the serial compaction is only triggered if no free regions are made available by the parallel compaction. We should trigger the serial compaction when do maximal_compaction is set.

      Additionally, to achieve maximum compaction we need to re-factor the serial compaction to re-prepare all regions that are in the "tail" regions of the per thread compaction points. The Full-GC is structured such that we move objects to one end of the head i.e compaction targets are selected in order of increasing hrm_indexes. However, due to parallelisation of the compaction, and uneven distribution of objects, unused regions may exist between the lowest last used (current) target region and the highest last used (current) target region. Also, the per thread last used (current) target regions may be partially filled. This may lead to fragmentation even after the Full-GC.

      The serial compaction should eliminate this fragmentation by re-preparing all objects that have been targeted into this area between the lowest (sorted by hrm_index) partially filled target region and the end of the heap. Ensuring that at the end of the Full-GC, all objects that are not pinned are moved to one end of the heap.


        Issue Links



              iwalulya Ivan Walulya
              iwalulya Ivan Walulya
              0 Vote for this issue
              3 Start watching this issue