OutOfMemoryError when loading images at startup of sketch

Hi all,
My sketch throws an OutOfMemoryError when I try to run it. However I only try to load in a total of 9 images with a combined size of 5 MB. I also only call loadImage in setup so I’m not constantly loading images or anything. When I comment out the images the program runs fine so it’s also not the rest of the code that’s causing problems. I’ve already tried to increase the amount of available memory but that doesn’t help either.

Does anyone have an idea what might be causing this error?

1 Like

You mentioned the things I’d guessed first.

can you show your code?

Check the images on hard drive, maybe some wrong file extension or size?

restart PC

And welcome to the community and to this forum!

Regards, Chrisir


I found the problem,

I had exported the images from adobe illustrator with a canvas size of 8000 x 8000 pixels, so while the file size wasn’t high, the images were very big. I exported them as 1920x1080 (the size of the actual images) and now everything works fine.