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

G1 card indices overflow with heaps > 1TB

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • 9
    • 9
    • hotspot
    • gc

      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.

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

              Created:
              Updated:
              Resolved: