Error in TestReleaseDirectMemory
See original GitHub issueTesting 3.3.1 release candidate, although it isn’t a regression. I encounter the same issues on 3.2.4-stable.
When running this example with JDK8:
Apr 21, 2020 10:09:02 AM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.3.0-SNAPSHOT
* Branch: v3.3
* Git Hash: a150deb
* Build Date: 2020-04-21
Apr 21, 2020 10:09:02 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: LWJGL 2.9.3 context running on thread jME3 Main
* Graphics Adapter: null
* Driver Version: null
* Scaling Factor: 1
Apr 21, 2020 10:09:02 AM com.jme3.app.LegacyApplication handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.NoSuchMethodError: java.nio.IntBuffer.clear()Ljava/nio/IntBuffer;
at com.jme3.util.BufferUtils.createIntBuffer(BufferUtils.java:927)
at com.jme3.renderer.lwjgl.LwjglGL.<init>(LwjglGL.java:15)
at com.jme3.system.lwjgl.LwjglContext.initContextFirstTime(LwjglContext.java:257)
at com.jme3.system.lwjgl.LwjglContext.internalCreate(LwjglContext.java:424)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:117)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:213)
at java.lang.Thread.run(Thread.java:748)
Exception: java.lang.NullPointerException thrown from the UncaughtExceptionHandler in thread "jME3 Main"
When running on JDK11:
Apr 21, 2020 10:10:38 AM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.3.0-SNAPSHOT
* Branch: v3.3
* Git Hash: a150deb
* Build Date: 2020-04-21
Apr 21, 2020 10:10:38 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: LWJGL 2.9.3 context running on thread jME3 Main
* Graphics Adapter: null
* Driver Version: null
* Scaling Factor: 1
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.jme3.util.ReflectionAllocator (file:/Users/remy/Projects/jMonkeyEngine/jmonkeyengine/jme3-core/build/libs/jme3-core-3.3.0-SNAPSHOT.jar) to method sun.nio.ch.DirectBuffer.cleaner()
WARNING: Please consider reporting this to the maintainers of com.jme3.util.ReflectionAllocator
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Apr 21, 2020 10:10:38 AM com.jme3.renderer.opengl.GLRenderer loadCapabilitiesCommon
INFO: OpenGL Renderer Information
* Vendor: ATI Technologies Inc.
* Renderer: AMD Radeon Pro Vega 20 OpenGL Engine
* OpenGL Version: 2.1 ATI-2.11.21
* GLSL Version: 1.20
* Profile: Compatibility
Apr 21, 2020 10:10:39 AM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio Renderer Information
* Device: MacBook Pro Speakers
* Vendor: Apple Computer Inc.
* Renderer: Software
* Version: 1.1
* Supported channels: 64
* ALC extensions: ALC_EXT_CAPTURE ALC_ENUMERATION_EXT ALC_EXT_MAC_OSX ALC_EXT_ASA ALC_EXT_ASA_DISTORTION ALC_EXT_ASA_ROGER_BEEP
* AL extensions: AL_EXT_OFFSET AL_EXT_LINEAR_DISTANCE AL_EXT_EXPONENT_DISTANCE AL_EXT_float32 AL_EXT_STATIC_BUFFER AL_EXT_SOURCE_NOTIFICATIONS AL_EXT_SOURCE_SPATIALIZATION
Apr 21, 2020 10:10:39 AM com.jme3.audio.openal.ALAudioRenderer initOpenAL
WARNING: Pausing audio device not supported.
Apr 21, 2020 10:10:39 AM com.jme3.audio.openal.ALAudioRenderer initOpenAL
WARNING: OpenAL EFX not available! Audio effects won't work.
Apr 21, 2020 10:10:39 AM com.jme3.util.ReflectionAllocator destroyDirectBuffer
SEVERE: Buffer cannot be destroyed: java.nio.DirectByteBuffer[pos=0 lim=500000 cap=500000]
Apr 21, 2020 10:10:39 AM com.jme3.util.ReflectionAllocator destroyDirectBuffer
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Troubleshooting OutOfMemoryError: Direct buffer memory
This memory is released only when the given DirectByteBuffer object is garbage collected and its internal “cleanup” method is called (the most ...
Read more >java.lang.OutOfMemoryError: Direct buffer memory ... - GitHub
OutOfMemoryError : Direct buffer memory at java.nio. ... The error ist still there with 4.1.12 and tcnative 2.0.3 - will start investigating ...
Read more >Direct buffer memory when invoking Files.readAllBytes
When loading files into memory, java allocates a series of DirectByteBuffers using a different, non-heap pool called the direct memory pool.
Read more >How to Fix java.lang.OufOfMemoryError: Direct Buffer Memory
OutOfMemoryError : Direct buffer memory" error, when you try to allocate memory by running the following code. ByteBuffer buffer = ByteBuffer.
Read more >Troubleshooting Problems With Native (Off-Heap) Memory in ...
OutOfMemoryError : Direct Buffer Memory. Internally, the JVM keeps track of the amount of native memory that is allocated and released by ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I could trace down the reason for
SEVERE: Buffer cannot be destroyed: java.nio.DirectByteBuffer[pos=0 lim=500000 cap=500000]
It appears that in Java 11+ the ReflectionAllocator stuck here and return null
https://github.com/jMonkeyEngine/jmonkeyengine/blob/8aa50e9b485a8e847fe90186caaee0ae4fd9963a/jme3-core/src/main/java/com/jme3/util/ReflectionAllocator.java#L84-L85
and can not clear the buffer
https://github.com/jMonkeyEngine/jmonkeyengine/blob/8aa50e9b485a8e847fe90186caaee0ae4fd9963a/jme3-core/src/main/java/com/jme3/util/ReflectionAllocator.java#L130-L132
to solve it you have to explicitly enable the base module by adding
"--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED"
Please see below links for more info:
https://docs.oracle.com/en/java/javase/11/migrate/index.html#JSMIG-GUID-12F945EB-71D6-46AF-8C3D-D354FD0B1781
https://github.com/uncomplicate/neanderthal/issues/55
Just a note for anyone who might come across this.
ReflectionAllocator seems to be broken (Buffer cannot be destroyed error) again with JDK 16, even using the workaround does not work anymore.