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

G1 card indices overflow with heaps > 1TB

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Not an Issue
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Subcomponent:
      gc

      Description

      If one specifies a 2 TB heap with G1, the CardIdx_t type (which is int) can not represent all cards in the heap any more.

      I.e. 2^31 * 2^9 (card size in bytes) = 2^40 = 1 TB.

      There are several calculations in the code (like actually calculating the card # for a given heap word :)) that are in danger of overflow in this case.

      Note that there are applications using G1 with 1 TB heaps right now, and a customer intends to test on larger heaps in the near future.

      Since the card size is hardcoded as 512 bytes, there is no workaround.

      It would probably be best to use a size_t for it. Make sure that all operands calculating CardIdx_t values are also good.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jprovino Joseph Provino (Inactive)
                Reporter:
                tschatzl Thomas Schatzl
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: