depth
Full Member
Offline
Posts: 114
jumpy / pause-y rendering -- GC?
Feb 24th , 2010, 10:35pm
this post got a little long, so i'll preface with a summary: looks like the garbage collector is (periodically) impacting rendering performance, and i'm looking for a way to tame it. for the curious, read on... i'm writing an application that textures a bunch of polys (drawn via a series of begin/endShape() + vertex() calls) with a Capture. i've tuned it to the point that playback is pretty smooth, except that every couple seconds the screen pauses for a frame or two. i've noticed: this does not happen when using a fill() instead of a texture(); decreasing the number of polys increases the time between pauses to 3-4 seconds, but does not eliminate them; decreasing the Capture resolution (from 320x240 -> 160x120) increases the time between pauses to 8-10 seconds, but does not eliminate them. i'm guessing this has something to do with RAM allocation, but it's a total guess. any thoughts on what might be going on here, and how to clear it up? is it possible to.... hm, searched around for more on managing memory, and found more info here: http://processing.org/reference/troubleshooting/#memory so, i tried printing out allocated, free, and maximum. and what i see is that i run for ~25 frames with a lot of free memory, the number drops a bit (but is still ample) for ~10 frames, then the display hiccups as described above, and free memory jumps back up to the previous value. which looks like the garbage collector is running, and affecting rendering.... i know very little about the JVM GC; most of what i know about GC comes from AVM (flash). any ideas on tricks to smooth things out? or thoughts about the accuracy of my analysis? thanks!