Memory leak with Stereo 3D screen.

Setup: a Philips 3D stereo screen, displaying OpenGL programs, including Jogl programs, in stereo.
It relies on a replacement for opengl32.dll, that sends a normal image together with a depth map to the monitor.

Unfortunately, glCanvas.display() calls start to eat memory, as soon as this DLL is used,
so the application locks up after a few seconds. (Comparable C++ programs don’t suffer from this problem).

Any ideas what is causing this memory leak, or how to prevent it?

Sounds like a driver bug. Are you specifying -Dsun.java2d.noddraw=true on the command line?

Sure. The problem is not there when running in non-stereo mode. Just when using the special (Philips-monitor specific) opengl32.dll
The main class looks like this:

public static void main(String[] arg) {
System.setProperty(“sun.java2d.noddraw”, “true”);.
System.loadLibrary(“opengl32”);
new FirstOpenGL();
}

When I remove the System.loadLibrary(“opengl32”) call, everything runs fine (but obviously not in stereo)

Finally I saw some related issue (Jogl issue 166). The solution was a command line option: -Djogl.GLContext.nofree
That did the trick!. The memory leak (probably somewhere in the Philips opengl32 driver) is gone, or at least, causes no harm.

Before I found this option, I tried to work with OpenGL contexts via the GLCanvas.getContext(). That seemed to work, but when switching to
full screen mode, necessary for the stereo effect), by means of java.awt.GraphicsDevice.setFullScreenWindow(),
the application would not render anymore.

Does anyone know how to work with Jogl’s GLContext objects, in combination with full-screen mode?

Glad you found a workaround.

Interacting with the GLContext should work the same whether you’re in full-screen mode or not.