We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have an OpenGL program based on a spheres tutorial using old-style OpenGL. It works fine on my computer, but when a friend tries to load it he gets the following errors:
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space at processing.core.PImage.(PImage.java:295) at processing.core.PApplet.loadImageMT(PApplet.java:5892) at processing.core.PApplet.loadImage(PApplet.java:5737) at processing.core.PApplet.loadImage(PApplet.java:5663) at Planets$TexturedSphere.(Planets.java:36) at Planets.setup(Planets.java:170) at processing.core.PApplet.handleDraw(PApplet.java:2281) at processing.opengl.PJOGL$PGLListener.display(PJOGL.java:799) at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:590) at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:574) at javax.media.opengl.awt.GLCanvas$9.run(GLCanvas.java:1218) at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1036) at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:911) at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1229) at javax.media.opengl.Threading.invoke(Threading.java:193) at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:492) at javax.media.opengl.awt.GLCanvas.paint(GLCanvas.java:546) at sun.awt.RepaintArea.paintComponent(Unknown Source) at sun.awt.RepaintArea.paint(Unknown Source) at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$200(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) Already called beginDraw() java.lang.NullPointerException at processing.mode.java.runner.Runner.findException(Runner.java:926) at processing.mode.java.runner.Runner.reportException(Runner.java:871) at processing.mode.java.runner.Runner.exceptionEvent(Runner.java:797) at processing.mode.java.runner.Runner$2.run(Runner.java:686) Could not run the sketch (Target VM failed to initialize). Make sure that you haven't set the maximum available memory too high.
I have a machine with Intel graphics (I think 4000). He has a Dell Precision workstation with a high end NVIDIA card. Surely it's not his card? This error seems like it's his Java environment not being set to request enough RAM.
I have installed the SDK, Eclipse so it's possible that one of these other tools is modifying what processing sees as defaults in Java without my knowledge? Any clue how to fix his problem?
Answers
Try and change the memory settings in the Preferences of the PDE.
I can't increase the memory in the preferences much beyond 1024mb (on my 8gb win7 laptop) otherwise I get the java error:
[0] "Error occurred during initialization of VM"
[1] "Could not reserve enough space for object heap"
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.