Re: Un-managed Memory Usage
Posted by
jmaasing on
Nov 17, 2015; 7:13pm
URL: https://forum.jogamp.org/Un-managed-Memory-Usage-tp4035789p4035798.html
Since it isn't tied to a specific system I guess the easy way "it's a driver problem" is not relevant :-)
And since we can't see the code and it isn't reproduced in a test case it's hard to help apart from generic shouts of encouragement.
I ended up doing this in my code:
gl.glBindBuffer(GL4.GL_ARRAY_BUFFER, this.vbos[bufferIndex]);
FloatBuffer fbVertices = Buffers.newDirectFloatBuffer(values);
final int bufferSizeInBytes = values.length * Buffers.SIZEOF_FLOAT;
this.totalBufferSizeAllocated += bufferSizeInBytes;
this.metrics.counter(Constants.Metrics.GL.VERTEX_ARRAY_BUFFER_SIZE_ALLOCATED).inc(bufferSizeInBytes);
gl.glBufferData(GL4.GL_ARRAY_BUFFER, bufferSizeInBytes, fbVertices, GL4.GL_STATIC_DRAW);
I use a (dropwizard) metrics class to track the allocation of direct buffers and a similar "decrement" to track the buffers I had asked OpenGL to allocate. Helped me track down some loops that only allocated more and more OpenGL buffers. Maybe you could use something similar.