Shenandoah: Large values of ShenandoahMaxRegionSize can cause overflow issues

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: 21, 25, 26
    • Component/s: hotspot
    • gc

      This was discussed the PR of JDK-8372513. From the PR:
      ```
      I realized that having an unconstrained flag like this can cause overflows and asserts because of that. If we want to fix that we could do something like the following:

      https://github.com/stefank/jdk/compare/8372513_shenandoah_max_region_size...stefank:jdk:8372513_shenandoah_max_region_size_constraints

      Then running

       java -XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:ShenandoahMaxRegionSize=9223372036854775808 -version

      Will give this error message instead of an assert:

      $ java -XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:ShenandoahMaxRegionSize=9223372036854775808 -version
      ShenandoahMaxRegionSize 8589934592G should be lower than (8589934592G).
      Improperly specified VM option 'ShenandoahMaxRegionSize=9223372036854775808'
      Error: Could not create the Java Virtual Machine.
      Error: A fatal exception has occurred. Program will exit.
      ```

      It was decided to create a separate issue for the overflow.

            Assignee:
            Ben Taylor
            Reporter:
            Stefan Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: