I parse a binary point cloud file and get large arrays of points and their properties. These more often then not run out of memory when allocating towards VBOs before drawing. I need a solution that handles the memory problem but is still fast enough to feed the buffers. Since the application memory space is too small, could I somehow write a 'file' to the SD Card and populate the buffers piece-wise from there? I can't parse the file more than once.
Crashing lines:
-->ByteBuffer vbb = ByteBuffer.allocateDirect(lasVertices.length * 4);
vbb.order(ByteOrder.nativeOrder());
vertexBuffer = vbb.asFloatBuffer();
vertexBuffer.put(lasVertices);
vertexBuffer.position(0);