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

G1YoungGenSizer _adaptive_size not correct when setting NewSize and MaxNewSize to the same value

    XMLWordPrintable

Details

    • gc
    • b122

    Backports

      Description

        When creating the G1YoungGenSizer some flags are considered. But the code below looks wrong:
        if (FLAG_IS_CMDLINE(NewSize)) {
            _min_desired_young_length = MAX2((uint) (NewSize / HeapRegion::GrainBytes),
                                             1U);
            if (FLAG_IS_CMDLINE(MaxNewSize)) {
              _max_desired_young_length =
                                     MAX2((uint) (MaxNewSize / HeapRegion::GrainBytes),
                                          1U);
              _sizer_kind = SizerMaxAndNewSize;
              _adaptive_size = _min_desired_young_length == _max_desired_young_length;
            }

        If both values are set to the same value, the _adaptive_size comparison will return true. But if they are the same the size should never change.

        I'm not sure if it is as easy as just changing the comparison, since the _adaptive_size is used for some different things and changing this might have unexpected side effects.

        Attachments

          Issue Links

            Activity

              People

                sjohanss Stefan Johansson
                sjohanss Stefan Johansson
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: