I got setting “increase maximum availabe memory" to 1400MB, but after running 5 - 10 minutes, the OutOfMemory Error thrown
An OutOfMemoryError means that your code is either using up too much memory
because of a bug (e.g. creating an array that's too large, or unintentionally
loading thousands of images), or that your sketch may need more memory to run.
If your sketch uses a lot of memory (for instance if it loads a lot of data files)
you can increase the memory available to your sketch using the Preferences window.
Exception in thread "Animation Thread" java.lang.OutOfMemoryError
at sun.misc.Unsafe.allocateMemory(Native Method)
at java.nio.DirectByteBuffer.<init>(Unknown Source)
at java.nio.ByteBuffer.allocateDirect(Unknown Source)
at com.sun.opengl.util.BufferUtil.newByteBuffer(BufferUtil.java:65)
at com.sun.opengl.util.BufferUtil.copyIntBufferAsByteBuffer(BufferUtil.java:229)
at javax.media.opengl.glu.GLU.copyToByteBuffer(GLU.java:1450)
at javax.media.opengl.glu.GLU.gluBuild2DMipmapsJava(GLU.java:1524)
at javax.media.opengl.glu.GLU.gluBuild2DMipmaps(GLU.java:1581)
at processing.opengl.PGraphicsOpenGL$ImageCache.rebind(PGraphicsOpenGL.java:954)
at processing.opengl.PGraphicsOpenGL.bindTexture(PGraphicsOpenGL.java:762)
at processing.opengl.PGraphicsOpenGL.renderTriangles(PGraphicsOpenGL.java:684)
at processing.core.PGraphics3D.endShape(PGraphics3D.java:626)
at processing.core.PGraphics.endShape(PGraphics.java:1133)
at processing.core.PGraphics.imageImpl(PGraphics.java:2261)
at processing.core.PGraphics.image(PGraphics.java:2150)
at processing.core.PApplet.image(PApplet.java:7087)
at sketch_jun15a.draw(sketch_jun15a.java:30)
at processing.core.PApplet.handleDraw(PApplet.java:1406)
at processing.core.PApplet.run(PApplet.java:1311)
at java.lang.Thread.run(Unknown Source)