JMH: Unsafe deprecation warnings are printed in JDK 24

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: tools
    • None
    • jmh

      This is printed for every benchmark running with JDK 24 now:

      ```
      WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
      WARNING: sun.misc.Unsafe::objectFieldOffset has been called by org.openjdk.jmh.util.Utils (file:/Users/shipilev/Work/shipilev-jmh/jmh-samples/target/benchmarks.jar)
      WARNING: Please consider reporting this to the maintainers of class org.openjdk.jmh.util.Utils
      WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
      ```

      This is part of our checks that padding works at runtime. We need to either fix it to avoid Unsafe (probably impractical), or remove it (it did not fail for a long time).

            Assignee:
            Aleksey Shipilev
            Reporter:
            Aleksey Shipilev
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: