Memory Bloat ! & Fix !!
Hope I'm tracking the code correctly...
From what I see, it appears that even when an IndexedGeometryArray has the BY_REFERENCE and USE_COORD_INDEX_ONLY flags set, Java3D is creating needlessly individual copies of the indices array for each of the vertex fields - coords, colors, normals, and for each of the texCoords in the case of multi-texturing.
I've identified the problem to be coming from
From the example I posted a few days back for an IndexedTriangleArray, the float memory (coords+color_3+normals) is 13MB and the indices memory is 8MB. Because Java3D creates multiple copies of the indices array, there is a memory bloat of nearly 24MB.
And if you consider multi-texturing, the bloat is a function of the number of TextureCoordSets !
Incredible !!! Am I really seeing what I think I'm seeing ??? Does OpenGL really need separate copies of the indices array for VertexArray specification ? Is this needed for JNI data transfer ? What am I missing here ?
If you find that there really is a problem and should be fixed, I can go ahead and file an issue. The fix will be a tremendous boost for data visualization applications where even a single copy is often just too large.