Login  Register

Re: Crash when creating more than ~15 jogl/awt windows

Posted by GiGurra on Jun 12, 2011; 2:05pm
URL: https://forum.jogamp.org/Crash-when-creating-more-than-15-jogl-awt-windows-tp3054540p3055606.html

I've now tried using NEWT but it also crashes when I hit about 45 windows. Feels like either a JOGL or openGL driver issue.
HOWEVER: Like with AWT, launching windows in separate processes works fine (does not crash)  (4x30 runs fine on NEWT), I can run well over 100 windows without problems.

The entire code I used is visible below:

/********* HelloJogl.java ********/
package hellojogl;

import com.jogamp.newt.event.WindowAdapter;
import com.jogamp.newt.event.WindowEvent;
import com.jogamp.newt.opengl.GLWindow;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLProfile;

public class HelloJogl {

    public static void main(String[] args) throws InterruptedException {

        final GLCapabilities glcapabilities = new GLCapabilities(GLProfile.getDefault());
        for (int i = 0; i < 45; i++) {
            final GLWindow window = GLWindow.create(glcapabilities);
            window.setSize(300, 300);
            window.setTitle("Window " + i);
            window.setVisible(true);      
        }
    }
}

/*********************************/

The error I get is

Detected screen size 1920x1200
Exception in thread "main" java.lang.RuntimeException: javax.media.opengl.GLException: Unable to create temp OpenGL context for device context 0xffffffffb2010ed5
        at jogamp.newt.DefaultEDTUtil.invokeImpl(DefaultEDTUtil.java:185)
        at jogamp.newt.DefaultEDTUtil.invoke(DefaultEDTUtil.java:113)
        at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:199)
        at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:1423)
        at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:698)
        at com.jogamp.newt.opengl.GLWindow.setVisible(GLWindow.java:285)
        at hellojogl.HelloJogl.main(HelloJogl.java:27)
Caused by: javax.media.opengl.GLException: Unable to create temp OpenGL context for device context 0xffffffffb2010ed5
        at jogamp.opengl.windows.wgl.WindowsWGLContext.createImpl(WindowsWGLContext.java:296)
        at jogamp.opengl.GLContextImpl.makeCurrentLocking(GLContextImpl.java:406)
        at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:352)
        at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:348)
        at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:547)
        at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:523)
        at com.jogamp.newt.opengl.GLWindow$1.windowResized(GLWindow.java:89)
        at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:2041)
        at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:1987)
        at jogamp.newt.WindowImpl.setVisibleActionImpl(WindowImpl.java:670)
        at jogamp.newt.WindowImpl$VisibleAction.run(WindowImpl.java:682)
        at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:93)
        at jogamp.newt.DefaultEDTUtil$EventDispatchThread.run(DefaultEDTUtil.java:282)
Exception in thread "main-Display-Windows_nil-1-EDT-1" javax.media.opengl.GLException: Unable to create temp OpenGL context for device context 0xffffffffb2010ed5Java Result: 1


--------------------

Win64,
gtx580 w latest whql drivers
jogl2 b23
6 gb ram
sun/oracle 32bit jvm 6_26
using netbeans 7 ide