Processing.py-Bugs icon indicating copy to clipboard operation
Processing.py-Bugs copied to clipboard

OutOfMemoryError: Java heap space

Open AndresHC232 opened this issue 3 years ago • 6 comments

Hi, I haven't found this issue in this forum. In Processing 3.5.4, in Python mode, with very little coding, after two or three runnings, the error 'OutOfMemoryError: Java heap space' appears, and it doesn't work anymore. I'm using a powefull laptop. So, what is the problem. Thanks in advance. AndrésHC

AndresHC232 avatar Jan 13 '22 19:01 AndresHC232

Hi @AndresHC232! Thanks for reporting! Could you provide some example code? Are you on MacOS, Windows or Linux? Maybe someone else here might reccomend better ways to investigate this?

villares avatar Jan 13 '22 19:01 villares

Hi, I attach some images: One with the code that cause error after four o five runnings. One with the characteristics of my computer. And the last one wich shows how Processing 4.0b2 displays, I think since I installed the 3.5.4 version, but I'm not sure. I installed first the 4.0b2 version, but I had to change to the 3.5.4 versión but I don't remember wy. And now thah I try to resume with the Processing 4.0b2 to do some test, because is so enormeus. I cant. Do you hve some idea about that last issue, too?

image

image

image

AndresHC232 avatar Jan 14 '22 12:01 AndresHC232

Hi @AndresHC232

I recommend Processing 3.5.4 for Python mode. Processing.py support for Processing 4 is experimental right now.

For the memory error, try increasing the maximum available memory in the Processing preferences (File > Preferences > Increase maximum available memory), to like 1000+ MB. You might need to restart Processing for that to take effect.

tabreturn avatar Jan 15 '22 05:01 tabreturn

Hi, I increased available memory and it works now. Thank you very much! Another question: How can I program with Processing in an android smartphone. I use Pydroid 3 in my smartphone. Thans in advance. AndrésHC

AndresHC232 avatar Jan 15 '22 16:01 AndresHC232

Glad to hear that solved the memory issue.

Regarding your smartphone question --

There is Processing for Android, but you'll need to write Java code for that (and write the code on a computer then deploy it onto your phone). Because of how Processing.py works, you can't just install it like another pip package.

To write Processing.py-esque code on your phone, you might try something web-browser-based, like a py5 notebook or pyp5js. If you're happy writing JavaScript, there are options like p5.js.

tabreturn avatar Jan 15 '22 21:01 tabreturn

Hi, Thanks for that last advice. I think I'll program with Proccessing just in my laptop. Bye. AndrésHC

AndresHC232 avatar Jan 20 '22 06:01 AndresHC232