We are about to switch to a new forum software. Until then we have removed the registration on this forum.
My program uses the PGraphics object as a buffer to create graphics before drawing to the screen. After running my program for about 20 minuets it crashes. Looking at the system memory use it looks like this is caused by and out of memory error. Interestingly this seems to only happen when I build the application (not running from the editor).
After reading this post https://forum.processing.org/one/topic/pimage-memory-leak-example.html#25080000001807951 and some more that also reference the g.removeCache(img); solution I tired it out. I think it's clearing the cache, but it's causing only black to be drawn to the screen.
A section of my code:
public void drawRoute() {
tint(255, myAlpha);
image(myPg, 0, 0);
g.removeCache(myPg);
noTint();
}
I'm calling drawRoute() directly from the main draw().
What am I doing wrong? Is this fix still relevant for processing 3.3.4?
Thanks