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

G1: G1CollectorPolicy::initialize_flags() may set min_alignment > max_alignment

XMLWordPrintable

    • gc
    • b32
    • Verified

        We set min_alignment to the G1 heap region size, but we set max_alignment to the card table alignment.

        The max_alignment is used to align the heap up. If the heap region size is larger than the card table alignment we may end up with a heap size that is not aligned to the heap region.

        Here is a command line that fails on my machine:

        $ java -XX:MaxRAMFraction=10 -XX:+UseG1GC -XX:G1HeapRegionSize=8m -version
        Error occurred during initialization of VM
        Size of g1 heap (859832320 bytes) must be aligned to 8388608 bytes

        The test in Universe::check_alignment() fails even though the heap size was picked ergonomically. This is because the heap size is card table aligned rather than heap region aligned.

        ILW=HML -> P2

        The simplest workaround is to set the heap size on the command line to a value that is heap region size aligned.

              brutisso Bengt Rutisson (Inactive)
              brutisso Bengt Rutisson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: