question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ReflectionAllocator is broken on JDK 16

See original GitHub issue

SEVERE: Buffer cannot be destroyed: java.nio.DirectFloatBufferU

Even by adding this JVM arg (which used to solve that on jdk 11+)

“–add-opens=java.base/jdk.internal.ref=ALL-UNNAMED”

you can test it with

https://github.com/jMonkeyEngine/jmonkeyengine/blob/d76d4dc8c67bc99c5fd197d41a102639194a4e3b/jme3-examples/src/main/java/jme3test/app/TestReleaseDirectMemory.java#L43

Forum post: https://hub.jmonkeyengine.org/t/jme-on-jdk-16/44411/6?u=ali_rs

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:39 (39 by maintainers)

github_iconTop GitHub Comments

3reactions
Ali-RScommented, May 18, 2022

Note, I am talking about this issue:

Sometimes the order of these static executions is different, e.g the one in the BufferUtils runs before the LwjglContext, which will cause BufferAllocator allocator to get initialized with Reflectionallocator and bypass the LWJGL3 allocator. open_mouth So best to specify it via JVM args.

riccardobl sugested to use a different approach to solve the issue of staticly setting allocator in code :

It seems we should find a different way to set the allocator, maybe the renderers should have the buffer allocator under the same class name and namespace so that when the modules are switched it gets replaced without setting it “manually”.

maybe an enhancement to this would be to config the allocator name via properties file (for each backend) instead of using a fixed class name for all allocators.

So that BufferAllocatorFactory will read the property PROPERTY_BUFFER_ALLOCATOR_IMPLEMENTATION from the properties file.

2reactions
Scrappers-glitchcommented, May 20, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

JME on JDK 16 - General Discussion - jMonkeyEngine Hub
Note that ReflectionAllocator seems to be broken with JDK 16. SEVERE: Buffer cannot be destroyed: java.nio.DirectFloatBufferU.
Read more >
JDK 16 Release Notes - Oracle
These notes describe important changes, enhancements, removed APIs and features, deprecated APIs and features, and other information about JDK 16 and Java ...
Read more >
cannot access class jdk.internal.ref.Cleaner (in module java ...
DirectByteBuffer was moved but it would be easy to fix by creating a ... the reflection allocator with Java 9, tested with Java...
Read more >
Verify Java SDK version shipped with IBM WebSphere ...
Version Operating system Java 8.0 SDK tested level (64‑bit only) 9.0.5.14. 22.0.0.12 AIX pap6480sr7fp16‑20220830_01‑1439 (SR7FP16) 9.0.5.14. 22.0.0.12 HP‑UX for Itanium hpia6480sr7fp10hybrid‑20220808_01‑0931 (SR7FP... 9.0.5.14. 22.0.0.12 Linux® PPC...
Read more >
java - How can I fix "unsupported class file major version 60 ...
I downgraded from JDK 16 to JDK 15 to successfully build my app. – Ben Butterworth. Jul 12, 2021 at 8:19. 2.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found