# Memory usage increases as images are loaded. Help me

**URL:** <https://discourse.processing.org/t/memory-usage-increases-as-images-are-loaded-help-me/39450>\
**Category:** Coding Questions\
**Created:** [October 26, 2022, 9:47pm UTC](https://discourse.processing.org/t/memory-usage-increases-as-images-are-loaded-help-me/39450 "2022-10-26T21:47:47Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [October 26, 2022, 10:16pm UTC](https://discourse.processing.org/t/memory-usage-increases-as-images-are-loaded-help-me/39450/2 "2022-10-26T22:16:39Z")

</div>

[**removecache()**](https://forum.processing.org/two/discussions/tagged%3FTag=removecache().html)

> [@Memory leak in PGraphics](https://discourse.processing.org/t/memory-leak-in-pgraphics/24500/4):
>
> Most I can do is tell you what I know about how a PGraphics caches a PImage. Processing got 3 methods to display a PImage on a PGraphics: [background()](https://processing.org/reference/background_.html)[set()](https://processing.org/reference/set_.html)[image()](https://processing.org/reference/image_.html) Both background() & set() merely transfer a PImage::pixels[] to a PGraphics disregarding any transparency & tint between them; but having the advantage of not being cached. Method image() is more complete, but it caches its PImage argument if it’s not been yet. Each cache primarily consists of a whole clone of a PImage::pixels[…

---

_[View the full topic](https://discourse.processing.org/t/memory-usage-increases-as-images-are-loaded-help-me/39450)._
