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

@Contended on class may break the field alignment

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3
    • hs25
    • hs25, 8
    • performance
    • b16

    Description

      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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: