We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Drawing ellipse and memory error
Page Index Toggle Pages: 1
Drawing ellipse and memory error (Read 950 times)
Drawing ellipse and memory error
Feb 23rd, 2009, 9:02pm
 
I'm having a tough time with intermittent errors generated when drawing ellipse:

Code:

Exception in thread "Animation Thread" java.lang.OutOfMemoryError: Java heap space

at processing.core.PGraphics.vertexCheck(PGraphics.java:922)

at processing.core.PGraphics.vertex(PGraphics.java:965)

at processing.core.PGraphics3D.vertex(PGraphics3D.java:570)

at processing.core.PGraphics3D.ellipseImpl(PGraphics3D.java:2611)

at processing.core.PGraphics.ellipse(PGraphics.java:1517)

at processing.core.PApplet.ellipse(PApplet.java:6965)


I would understand if it is a simple matter of memory use, but I don't think drawing an ellipse should cause it.  Does anyone have any idea what is causing this process to take up so much space?
Re: Drawing ellipse and memory error
Reply #1 - Feb 23rd, 2009, 10:19pm
 
Hard to tell without seeing the code.

One question that springs to mind, though: is it a degenerate ellipse?  One with parameters that are such that the underlying math might break down and cause Processing to do something unexpected?

If these are "ordinary" ellipses that ought to fit in your drawing window, then I have no idea what's going on.

But if not, I'd start looking for ellipses with zero height or width, or ones with very, very long (near infinite) dimensions.  I can imagine some an ellipse with, for example, a VERY long width and VERY small (or zero) height, combined with the inherent numerical innacuracy of IEEE floating point representation, causing some sort of edge case where, instead of Processing being able to iterate points all the way around the ellipse, it instead iterates forever in one direction without ever swinging around the end of the ellipse to come back the other way.

Pure speculation on my part, but it's something to look into.  Either way, I think a strong claim can be made that a graphics primitive like ellipse() should NEVER crash.  So, if you can isolate a clear set of parameters and conditions that reproduce the crash, you should definitely submit it as a bug.
Re: Drawing ellipse and memory error
Reply #2 - Feb 23rd, 2009, 10:41pm
 
Thank you for a very helpful suggestion.  Right now, it's a bit too unwieldy to post the code (it's excruciatingly long for a post), so I'll try to replicate the error in a smaller chunk of code.
Re: Drawing ellipse and memory error
Reply #3 - Feb 24th, 2009, 7:38am
 
See Processing 1.0.2
Quote:
+ OutOfMemoryError with ellipse() in P3D and OPENGL
http://dev.processing.org/bugs/show_bug.cgi?id=1086

Looks like already fixed.
Re: Drawing ellipse and memory error
Reply #4 - Feb 24th, 2009, 8:51am
 
oops, forgot to look in the bug report.  Thank you!
Page Index Toggle Pages: 1