First, I’m running on Solaris 9 but this looks like it will apply to at least some other platforms, e.g. Linux.
I just tried to move to using glDrawArrays() to render my geometry in order to see what speed inprovements I could find. As part of this
I changed the storage of each of my geometry ‘fragments’ to use its own direct ByteBuffer to store vertices, normals texcoords etc.
The result was a huge memory footprint for my process around 900MBytes or about 10x what I would expect. This is apparently caused by the JVM insisting on aligning direct ByteBuffers on page boundaries as documented here:
http://developer.java.sun.com/developer/bugParade/bugs/4820023.html
This makes it pretty well untenable to allocate a large quantity of ‘small’ direct ByteBuffers.
Setting up a smaller number of large buffers and handing out subsections dynamically doesn’t seem like a great solution, since it’ll make it very difficult to reclaim storage when I free a subsection.
So, would anyone, expecially the JOGL developers care to comment on this issue ?
Thanks
Rob