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

G1 Pending cards estimation too conservative in cost prediction

    Details

    • Subcomponent:
      gc
    • Resolved In Build:
      b07

      Description

      In several places G1 tries to predict the time processing of the cards in the DCQS takes, particularly at the start of GC to determine the initial collection set, but also at the end of the GC to determine the eden length.

      This time is basically determined by the formula:

        pending_cards_at_gc_start * cost_per_pending_card_during_gc

      The problem is that the cost_per_pending_card_during_gc is determined on the actual processed cards during GC (starting with JDK-8213108); and pending_cards_at_gc_start is determined by

        sum(cards_in_thread_buffers) + num_completed_buffers * buffer_size

      This can be a fairly inflated number in some applications, as we filter DCQS queues for unneeded elements.

      Applications show a 3-4x higher "pending cards" than what is printed in "Scanned Cards" in many cases.

      This seems to cause the prediction for the time to process cards being way too high, causing G1 to use a smaller young gen than necessary and not being close to pause time at all.

      E.g. GCBasher with 256m heap with a 15ms target pause time that in situations of fairly constant load generally uses only around 10ms. (and not giving it any pause target gives around 15ms avg)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tschatzl Thomas Schatzl
                Reporter:
                tschatzl Thomas Schatzl
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: