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

Some G1 policy code tries to get a prediction on an empty sequence

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P5 P5
    • tbd
    • 9
    • hotspot
    • gc

      Some code in G1CollectorPolicy in some circumstances tries to get predictions from TruncatedSeqs that have no samples.

      This can be verified by adding an assert(seq->num() > 0) in G1Predictions::get_new_prediction()

      At least this is a strange behavior that should either be fixed or documented.

      The attached change is a reverse diff that implements the assert and initial changes. It seems that mostly calling G1CollectorPolicy::update_young_list_target_length() is affected.

      Failing test case with these changes applied would be a Java program that immediately calls System.gc().

        1. 8139594.diff
          1 kB
          Thomas Schatzl
        2. Hello.java
          0.1 kB
          Thomas Schatzl

            Unassigned Unassigned
            tschatzl Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: