ATI on Linux is a problem for me too, I haven’t gotten the open source drivers to work, but I have gotten ATI’s proprietary drivers running. I have had allocation issues as well, but in my case they actually cause a segment violation and crash my JVM. The following JOGL program attempts to allocate 512 VBO’s of size 1MB each (very abusive). I get to about 16MB worth before my JVM exits. It runs on my Windows/NVidia box, although it does eat up some memory by the end.
import java.nio.FloatBuffer;
import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCanvas;
import javax.media.opengl.GLEventListener;
import javax.swing.JFrame;
import javax.swing.WindowConstants;
import com.sun.opengl.util.BufferUtil;
public class VboCrash
{
public static void main(String[] args) throws Exception
{
JFrame frame = new JFrame("CrashTest");
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
GLCanvas canvas = new GLCanvas();
frame.add(canvas);
canvas.addGLEventListener(new GLEventListener()
{
public void init(GLAutoDrawable drawable)
{
GL gl = drawable.getGL();
final int len = 1024 * 1024;
long total = 0;
for (int i = 0 ; i < 512 ; i++)
{
int[] id = new int[1];
gl.glGenBuffersARB(1, id, 0);
gl.glBindBufferARB(GL.GL_ARRAY_BUFFER_ARB, id[0]);
System.out.println("Bound id " + id[0]);
FloatBuffer fb = BufferUtil.newFloatBuffer(len);
gl.glBufferDataARB(GL.GL_ARRAY_BUFFER_ARB, len, fb, GL.GL_STATIC_DRAW_ARB);
System.out.println("Generated VBO length " + len);
total += len;
System.out.println("Used id " + id[0] + " (total:" + total + ")");
//gl.glDeleteBuffersARB(1, id, 0);
}
}
public void display(GLAutoDrawable drawable) {}
public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {}
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
});
frame.setSize(320, 240);
frame.setVisible(true);
}
}
The stack trace in the JVM dump shows that the crash occurs a few levels deep into the ATI code, so I doubt it’s anything that JOGL could work around. My next Linux laptop will have an Nvidia card…