Memory leak with size() and setResizable()

Hi everyone,

I have exported a processing application (version 3.5.3) to Eclipse using the proclipsing plugin in order to identify a memory leak. The leak points to PGraphics and after playing around with the code a little, it seems to be related to the size() and setResizable() functions because when I comment those out the leak goes away. I did quite a bit of research but only seemed to find the memory leak issues relating to PImage.

Any thoughts would be appreciated.

public void settings() {
		size(1880, 1000);
	public void setup(){
	  //size(1850, 1000); //full window size
	  //size(1880, 1000);  // size always goes first!
	  //printArray(Serial.list());  // prints all available serial ports
	  plot = new GPlot(this);
	  cp5 = new ControlP5(this);
	  font = createFont("Arial Bold", 60);
	  smallFont = createFont("Arial Bold",25);

Here is the memory analysis in Eclipse


This looks like a great catch! Have you considered opening an issue at the Processing GitHub repo?

@jeremydouglass would you have a look if there is another sub-topic more appropriate/visible for this discussion than libraries?

1 Like

Agreed – many thanks for this @processor1, and I would suggest reporting it to:

You can also cross-link to this thread if you wish.

1 Like