Out-of-memory when loading 3D OBJ model of 5M size. debug shows the dalvik has 50M memory limit, either on emulator or device. I don't see why this.
mIndicesInt = ByteBuffer.allocateDirect(indices.length * INT_SIZE_BYTES).order(ByteOrder.nativeOrder()).asIntBuffer();
mIndicesInt.put(indices).position(0);
I even increased AVD RAM to 2048M and heap to 1024M, it doesnot help. it always stop with the same numbers:
D/setIndices(2270): Memory: Pss=67.88 MB, Private=66.09 MB, Shared=13.30 MB D/setIndices(2270): maxMem=50331648 D/setIndices(2270): totalMem=50208736 D/setIndices(2270): freeMem=1963736
The OBJ model contains more than 20 objects. I removed several objects then out-of-memory issue disappears, so this is a memory hard limit issue per process?
Any suggestion on handling it? Also AVD optioins to increase RAM and heap size has no effect, why?