JOGL + Swing app experiencing pauses

Hey, I’m using a JOGL GLCanvas along with a few swing components (mainly just panels and labels). Every frame I’m rendering the canvas and updating the text of 4 different JLabels. I have a sleep in of 50 ms. I’m not rendering many polygons – less than 500 in total, and I’m not doing any intensive calculations every frame. The problem is, my program locks up for 2-6 seconds frequently (2-3 times per minute). During this time, the canvas stops rendering and the program stops responding to mouse input.

The lockups occur whenever they want – sometimes it’s right in the middle of the canvas rendering (ie, the background will render but it will freeze before the foreground details finish rendering). I’ve turned on verbose garbage collecting, and the GC does not correspond to when the pauses occur. Anyone have any ideas what may be causing these frequent lockups?

In addition, the program locks up for several seconds whenever I try to resize or move the window – I think this has to do with the JOGL canvas resizing perhaps? Is this supposed to happen when you try to move a JOGL canvas?

Do these kind of pauses happen with the JOGL demos, like the Gears demo?

I’ve seen problems like this on ATI cards in earlier releases of JOGL and they seemed to be caused by the fact that JOGL used to try to perform OpenGL rendering on multiple threads. With 1.1 b10 the threading model was changed so that all of the GLEventListener callbacks are executed on one thread. This solved basically all of the known issues on all platforms (there was at least one bug on each of Mac OS X, Windows and Linux fixed by this change).

If the problems only appear in your application I would try using the DebugGL pipeline or inspect your code to see whether you’re trying to use the GL object outside of your GLEventListener’s callbacks. The OpenGL context is only current when your display(), init(), etc. methods are called and at no other time in your program.

Ah yeah… The lockups occur while running the Gears demo as well. I suppose that is the problem then – I am using an ATI card. I guess the solution then would be to update my version of JOGL? Thanks :slight_smile: