Another exploration with less memory:
- In Processing “Preferences” I set maximum available memory to 1024 MB.
- keyPressed() modified so it would do the same as your midnight “reset” for testing.
It crashed on a key press:
void keyPressed() {
if (key == 'p') saveFrame("save.png");
if (key == 'r') {
frameCount = -1;
freeStuffUp();
thread("init"); \\ Added this!
}
You can see where it crashed at end of image:
Same settings as above but with the addition of System.gc() at end of draw():
println(mouseX, ' ', mouseY);
//println(frameRate);
System.gc();
}
And voila! It would only crash if I pressed it during a peak cycle of the “used heap” otherwise seemed to run fine; I would use more memory!