Login  Register

How to load many textures without leaking memory?

Posted by Phate666 on Jun 19, 2012; 10:48am
URL: https://forum.jogamp.org/How-to-load-many-textures-without-leaking-memory-tp4025245.html

Hi,
In our application we need to load new textures every second (or even more often).
The problem is that native memory (not java heap) keeps increasing without bounds.
Things I already tried:

texture.destroy(gl);
texture = TextureIO.newTexture(new File(texturePath), true);

and

texture.updateImage(gl, TextureIO.newTextureData(Test.glp,
                                                new File(texturePath), true, null));

Both code fragments gets executed every time the texture needs an update.
Any idea how to fix this memory leak?