# Memory leak with size() and setResizable()

**URL:** <https://discourse.processing.org/t/memory-leak-with-size-and-setresizable/22887>\
**Category:** Development\
**Created:** [July 28, 2020, 9:41pm UTC](https://discourse.processing.org/t/memory-leak-with-size-and-setresizable/22887 "2020-07-28T21:41:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![processor1](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@processor1](https://discourse.processing.org/u/processor1)\
**Post date:** [July 28, 2020, 9:41pm UTC](https://discourse.processing.org/t/memory-leak-with-size-and-setresizable/22887/1 "2020-07-28T21:41:37Z")

</div>

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.

```auto
public void settings() {
		size(1880, 1000);
	}
	
	public void setup(){
	  //size(1850, 1000); //full window size
	  //fullScreen(P2D,SPAN);
	  //size(1880, 1000); // size always goes first!
	
	  //surface.setResizable(true);
	  //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);
	  
	  InitLayout();

```

Here is the memory analysis in Eclipse  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/b/b4ac14fe3926e3ea8514276036b74ff28606ecb8.png)

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/f/f270f49d8cacc38d2f8a3efb947d9657356c2617.png)

---

<div class="post-metadata">

**Author:** ![villares](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/villares/32/3166_2.png) [@villares](https://discourse.processing.org/u/villares)\
**Post date:** [July 29, 2020, 4:06pm UTC](https://discourse.processing.org/t/memory-leak-with-size-and-setresizable/22887/2 "2020-07-29T16:06:28Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [July 29, 2020, 7:33pm UTC](https://discourse.processing.org/t/memory-leak-with-size-and-setresizable/22887/3 "2020-07-29T19:33:02Z")

</div>

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

> **[processing/processing](https://github.com/processing/processing/issues)**
>
> Source code for the Processing Core and Development Environment (PDE) - processing/processing

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