Description
I am creating a 3D model using multiple .stl files. I have updated STLLoaderTask according to my requirement to load multiple .stl files. I also have to add colors, but my model is not rendered correctly with colors. Its getting created for the first time but when I reload the model, my app is crashing with following errors:
Caused by: java.lang.OutOfMemoryError: Failed to allocate a 65431423 byte allocation with 25165824 free bytes and 42MB until OOM, max allowed footprint 517468552, growth limit 536870912
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at java.nio.DirectByteBuffer$MemoryRef.(DirectByteBuffer.java:71)
at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:257)
at org.andresoviedo.util.io.IOUtils.createNativeByteBuffer(IOUtils.java:64)
at org.andresoviedo.util.io.IOUtils.createFloatBuffer(IOUtils.java:43)
at org.andresoviedo.android_3d_model_engine.services.collada.entities.MeshData.getVertexBuffer(MeshData.java:714)
at com.movechair.modules.main.analysis.ThreeDModel.STLLoaderTask.build(STLLoaderTask.java:213)
at org.andresoviedo.android_3d_model_engine.services.LoaderTask.doInBackground(LoaderTask.java:67)
at org.andresoviedo.android_3d_model_engine.services.LoaderTask.doInBackground(LoaderTask.java:19)
at android.os.AsyncTask$2.call(AsyncTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:246)
at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:784)
Please help me with this error.