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

G1CollectorPolicy uses uninitialized field '_sigma' in the constructor

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc
    • Resolved In Build:
      b48

      Backports

        Description

        The G1CollectorPolicy constructor uses a huge initializer list. In this list it calls "new SurvRateGroup(this, ..)" passing passing it a reference to the no yet fully initialized G1CollectorPolicy instance.

        Via the following call chain, the SurvRateGroup constructor calls back to G1CollectorPolicy::get_new_prediction() which uses the uninitialzed value of G1CollectorPolicy::_sigma:

        G1CollectorPolicy::G1CollectorPolicy
        SurvRateGroup::SurvRateGroup
        SurvRateGroup::reset
        SurvRateGroup::all_surviving_words_recorded
        G1CollectorPolicy::get_new_prediction

        Depending on the indefinite value of '_sigma' this can lead to situations, where a GC is triggered before the whole system is initialized and ready for a GC resulting in the following crash:

        Error occurred during initialization of VM
        GC triggered before VM initialization completed. Try increasing NewSize, current value 5324K.

        The fix is trivial - initialize the G1CollectorPolicy members in the right order

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  simonis Volker Simonis
                  Reporter:
                  simonis Volker Simonis
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: