@Contended on class may break the field alignment

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P3
    • hs25
    • Affects Version/s: hs25, 8
    • Component/s: performance
    • b16

      if specified ContendedPaddingWidth isn't quite correct, in the annotated by @Contended class fields will be not aligned.

      excerpts from output 'runtime/8003985/Test8003985' with -XX:+PrintFieldLayout and XX:ContendedPaddingWidth=257:

      Test8003985$Test7: field layout
        @269 --- instance fields start ---
        @269 "int1" I
        @273 "int2" I
        @269 --- instance fields end ---
        @536 --- instance ends ---
        @ 88 --- static fields start ---
        @608 --- static fields end ---

      Test7.int2 isn't aligned.

      suggested fix:
      'ContendedPaddingWidth' value must be corrected during starting

            Assignee:
            Aleksey Shipilev
            Reporter:
            Igor Ignatyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: