2014/09/23

Processing 錯誤訊息原因

  最近在學 Processing 2,有一次因為到選單 File > Preferenece調整了記憶使用量造成以下錯誤訊息及程式掛在那裡不動,若沒真的很懂 Increase maximum available memory 這項設定,不要亂勾:
 


Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: GC overhead limit exceeded
at processing.opengl.PGraphicsOpenGL$InGeometry.allocate(PGraphicsOpenGL.java:7164)
at processing.opengl.PGraphicsOpenGL$InGeometry.(PGraphicsOpenGL.java:7136)
at processing.opengl.PGraphicsOpenGL.newInGeometry(PGraphicsOpenGL.java:6855)
at processing.opengl.PShapeOpenGL.(PShapeOpenGL.java:325)
at processing.opengl.PGraphics3D.createShapeImpl(PGraphics3D.java:258)
at processing.opengl.PGraphics3D.createShape(PGraphics3D.java:181)
at processing.core.PApplet.createShape(PApplet.java:11689)
at CubicGridRetained.setup(CubicGridRetained.java:48)
at processing.core.PApplet.handleDraw(PApplet.java:2361)
java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.lang.StringBuilder.toString(Unknown Source)
at java.lang.StackTraceElement.toString(Unknown Source)
at java.lang.String.valueOf(Unknown Source)
at java.lang.StringBuilder.append(Unknown Source)
at java.lang.Throwable.printStackTrace(Throwable.java:658)
at java.lang.Throwable.printStackTrace(Throwable.java:643)
at java.lang.ThreadGroup.uncaughtException(Unknown Source)
at java.lang.ThreadGroup.uncaughtException(Unknown Source)
at java.awt.EventDispatchThread.processException(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
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.