Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7903075

JOL: Incorrect ClassLayout header/loss calculation for arrays

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • None
    • tools
    • None
    • jol

      JOL misatributes array length as gap:

      > [B object internals:
      > OFF SZ TYPE DESCRIPTION VALUE
      > 0 8 (object header: mark) N/A
      > 8 4 (object header: class) N/A
      > 12 4 (array length) N/A
      > 12 4 (alignment/padding gap)
      > 16 0 byte [B.<elements> N/A
      > Instance size: 16 bytes
      > Space losses: 4 bytes internal + 0 bytes external = 4 bytes total

            shade Aleksey Shipilev
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: