# Resizing a PGraphics

**URL:** https://discourse.processing.org/t/resizing-a-pgraphics/30227
**Category:** Coding Questions
**Created:** [May 23, 2021, 12:05am UTC](https://discourse.processing.org/t/resizing-a-pgraphics/30227 "2021-05-23T00:05:37Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)
#### Post date: [May 23, 2021, 12:05am UTC](https://discourse.processing.org/t/resizing-a-pgraphics/30227/1 "2021-05-23T00:05:37Z")

</div>

I’ve seen there’s been a previous post about this and thats great as the answer has technically already been posted, however I wanted to know what limitations this might have if i’m planning on making use of resize every frame the canvas elements, for example does this cause memory issues as lot of PGraphics elements are created?

[https://forum.processing.org/one/topic/resize-the-pgraphics.html](https://forum.processing.org/one/topic/resize-the-pgraphics.html)

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [May 23, 2021, 1:10am UTC](https://discourse.processing.org/t/resizing-a-pgraphics/30227/2 "2021-05-23T01:10:47Z")

</div>

i wounder if this refresh the ram or not

```auto
removeCache(offscreen);
or 

removeCache(img);

```

[https://forum.processing.org/two/discussion/6898/how-to-correctly-release-pimage-memory](https://forum.processing.org/two/discussion/6898/how-to-correctly-release-pimage-memory)

---

<div class="post-metadata">

### Author: ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)
#### Post date: [May 23, 2021, 3:00am UTC](https://discourse.processing.org/t/resizing-a-pgraphics/30227/3 "2021-05-23T03:00:46Z")

</div>

I think im probably approaching this wrong as there are alternatives if flexible size is required such as textures

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [May 23, 2021, 10:29am UTC](https://discourse.processing.org/t/resizing-a-pgraphics/30227/4 "2021-05-23T10:29:34Z")

</div>

Hello,

I have had memory problems in the past and used VisualVM to visualize these:

- [https://visualvm.github.io/](https://visualvm.github.io/)
- [PImage garbage not being properly collected](https://discourse.processing.org/t/pimage-garbage-not-being-properly-collected/12252)

`:)`
