Bugzilla – Attachment 339 Details for
Bug 565
XWindow memory leak for GLCanvas (includes analysis)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
Test cases to trigger the memory leak
GLCanvasTestJOGL.java (text/x-java), 3.02 KB, created by
Daniel Balog
on 2012-03-15 16:41:53 CET
(
hide
)
Description:
Test cases to trigger the memory leak
Filename:
MIME Type:
Creator:
Daniel Balog
Created:
2012-03-15 16:41:53 CET
Size:
3.02 KB
patch
obsolete
>import jogamp.nativewindow.x11.X11Util; >import org.junit.Assert; >import org.junit.Ignore; >import org.junit.Test; > >import javax.media.opengl.DefaultGLCapabilitiesChooser; >import javax.media.opengl.GLCapabilities; >import javax.media.opengl.GLCapabilitiesImmutable; >import javax.media.opengl.GLDrawableFactory; >import javax.media.opengl.GLPbuffer; >import javax.media.opengl.GLProfile; >import javax.media.opengl.awt.GLCanvas; >import java.awt.Frame; > >/** > * Tests the GLCanvas in JOGL > */ >public class GLCanvasTestJOGL { > > static { > System.setProperty( "jogamp.gluegen.UseTempJarCache", "false" ); > } > > //This test will fail on JOGL 2.0 RC5 when running it in linux using X11 and nativewindow > @Test > public void testX11WindowMemoryLeak() throws Exception { > try { > for ( int j = 0; j < 500; j++ ) { > GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault( GLProfile.getDefaultDesktopDevice() ) ); > Frame frame = new Frame( "JOGL AWT memory leak test for X11" ); > > GLCanvas glCanvas = new GLCanvas( caps ); > frame.add( glCanvas ); > frame.setSize( 128, 128 ); > > final Frame _frame = frame; > final GLCanvas _glCanvas = glCanvas; > > try { > javax.swing.SwingUtilities.invokeAndWait( new Runnable() { > public void run() { > _frame.setVisible( true ); > } > } ); > } > catch ( Throwable t ) { > t.printStackTrace(); > Assert.fail(t.getMessage()); > } > glCanvas.display(); > try { > javax.swing.SwingUtilities.invokeAndWait( new Runnable() { > public void run() { > _frame.setVisible( false ); > _frame.remove( _glCanvas ); > _frame.dispose(); > } > } ); > } > catch ( Throwable t ) { > t.printStackTrace(); > Assert.fail(t.getMessage()); > } > > //Note that this is largely to indicate the problem, feel free to comment this line. >// X11Util.dumpOpenDisplayConnections(); > } > } > catch ( Exception e ) { > e.printStackTrace(); > Assert.fail(e.getMessage()); > } > } > > > //This test will fail on JOGL 2.0 RC5 when running it in linux using X11 and nativewindow > @Test > public void testX11WindowMemoryLeakOffscreenWindow() throws Exception { > try { > for ( int j = 0; j < 500; j++ ) { > GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault( GLProfile.getDefaultDesktopDevice() ) ); > > > GLPbuffer buffer = GLDrawableFactory.getFactory( GLProfile.get( "GL2" ) ).createGLPbuffer( > null, > caps, > new DefaultGLCapabilitiesChooser(), > 256, > 256, > null > ); > buffer.display(); > buffer.destroy(); > > //Note that this is largely to indicate the problem, feel free to comment this line. > X11Util.dumpOpenDisplayConnections(); > } > } > catch ( Exception e ) { > e.printStackTrace(); > Assert.fail(e.getMessage()); > } > } > >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 565
:
337
|
338
| 339 |
342