gatech-csl / jes

The Jython Environment for Students allows students to write Jython programs that can manipulate pictures, sounds, and videos.
http://mediacomputation.org/
60 stars 39 forks source link

Python OutOfMemoryError (Java Heap Space)? #142

Open lexf0704 opened 2 years ago

lexf0704 commented 2 years ago

To be honest, I have no idea what this means. I was trying a new function for my homework and got this message. I have a windows laptop. Here's my code and the error at the bottom. Please let me know if you know how to fix this! I'm a biochemistry major I have no idea how this works.

def test6 (picture):
for p in getPixels(picture):
red = getRed(p)
green = getGreen(p)
blue = getBlue(p) color = makeColor(blue, red, green)
setColor(p,color)

fileName=pickAFile() myPicture=makePicture(fileName) explore(myPicture)

======= Loading Program ======= test6(myPicture) The error was: Java heap space A Python OutOfMemoryError happened while running your program, so it stopped. Please check line 2 of C:\Users\lxf07\OneDrive\Python\test6.py

mjguzdial commented 2 years ago

Your picture is too big for memory. Try a smaller picture to see if it works, or maybe use an external program to scale your picture down. There are ways of getting Java to allocate more memory to JES, but it involves editing the source code.


Mark Guzdial (he/him/his), @.*** Director, Program in Computing for the Arts and Sciences https://lsa.umich.edu/computingfor, College of Literature, Science, and the Arts

On Fri, Sep 23, 2022 at 6:15 PM lexf0704 @.***> wrote:

To be honest, I have no idea what this means. I was trying a new function for my homework and got this message. I have a windows laptop. Here's my code and the error at the bottom. Please let me know if you know how to fix this! I'm a biochemistry major I have no idea how this works.

def test6 (picture): for p in getPixels(picture): red = getRed(p) green = getGreen(p) blue = getBlue(p) color = makeColor(blue, red, green) setColor(p,color)

fileName=pickAFile() myPicture=makePicture(fileName) explore(myPicture)

======= Loading Program =======

test6(myPicture) The error was: Java heap space A Python OutOfMemoryError happened while running your program, so it stopped. Please check line 2 of C:\Users\lxf07\OneDrive\Python\test6.py

— Reply to this email directly, view it on GitHub https://github.com/gatech-csl/jes/issues/142, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBN7JS3IHEGGOH63OZHCM3V7YTYHANCNFSM6AAAAAAQULEUBE . You are receiving this because you are subscribed to this thread.Message ID: @.***>