Login  Register

Re: JOGL Texture Memory Management

Posted by gouessej on Mar 29, 2021; 9:27pm
URL: https://forum.jogamp.org/JOGL-Texture-Memory-Management-tp4041055p4041070.html

I advise you to read carefully what I wrote and quoted. The garbage collection deals with managed memory on the Java heap, an object needs to become eligible to garbage collection in order to be garbage collected. The native memory isn't managed, it's freed when the Java counterpart is garbage collected or when a cleaner (or similar mechanism) is used. If you lack of native memory before lacking of memory on the Java heap, rather free the native memory by yourself and if you use a recent version of Java (you seem to use Java 8, bad news :s), you won't need to use a cleaner. You error message might be caused by Java reading beyond the end of a buffer, you must be sure that the direct NIO buffer is no longer in use before releasing its native memory.
Julien Gouesse | Personal blog | Website