-
Bug
-
Resolution: Unresolved
-
P3
-
jfx24
To reproduce this, use JDK 24 to run any JavaFX application that renders a control or a complex shape, for example, HelloButton (in rt/appls/toys/Hello). You will get the following warning
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::allocateMemory has been called by com.sun.marlin.OffHeapArray (file:.../sdk/lib/javafx.graphics.jar)
WARNING: Please consider reporting this to the maintainers of class com.sun.marlin.OffHeapArray
WARNING: sun.misc.Unsafe::allocateMemory will be removed in a future release
As described in JDK-8334137, the Marlin rasterizer uses sun.misc.Unsafe to allocate off-heap memory. JEP 471 [1] deprecated for removal all of the memory-access methods in sun.misc.Unsafe as of JDK 23.
JEP 498 [2] prints a warning on use of any memory-access methods in sun.misc.Unsafe in JDK 24. This warning can be disabled by "--sun-misc-unsafe-memory-access=allow" in JDK 24. We *must* eliminate our use of sun.misc.Unsafe by fixing JDK-8334137 as soon as possible -- ideally in JavaFX 24 and no later than JavaFX 25.
In the mean time, we will use this bug to inform application developers that they can run java with the following flag to avoid the warning:
java --sun-misc-unsafe-memory-access=allow
[1] https://openjdk.org/jeps/471
[2] https://openjdk.org/jeps/498
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::allocateMemory has been called by com.sun.marlin.OffHeapArray (file:.../sdk/lib/javafx.graphics.jar)
WARNING: Please consider reporting this to the maintainers of class com.sun.marlin.OffHeapArray
WARNING: sun.misc.Unsafe::allocateMemory will be removed in a future release
As described in JDK-8334137, the Marlin rasterizer uses sun.misc.Unsafe to allocate off-heap memory. JEP 471 [1] deprecated for removal all of the memory-access methods in sun.misc.Unsafe as of JDK 23.
JEP 498 [2] prints a warning on use of any memory-access methods in sun.misc.Unsafe in JDK 24. This warning can be disabled by "--sun-misc-unsafe-memory-access=allow" in JDK 24. We *must* eliminate our use of sun.misc.Unsafe by fixing JDK-8334137 as soon as possible -- ideally in JavaFX 24 and no later than JavaFX 25.
In the mean time, we will use this bug to inform application developers that they can run java with the following flag to avoid the warning:
java --sun-misc-unsafe-memory-access=allow
[1] https://openjdk.org/jeps/471
[2] https://openjdk.org/jeps/498
- relates to
-
JDK-8345127 Add --sun-misc-unsafe-memory-access=allow when running tests until JDK-8334137 is fixed
- Resolved
-
JDK-8334137 Marlin: replace terminally deprecated sun.misc.Unsafe memory access methods
- Open