Out of memory with loadImage in Eclipse, not in Processing IDE
in
Integration and Hardware
•
2 years ago
For some better readablity, I want to use Eclipse (first time) instead of the Processing IDE. I followed the tutorial and managed to clean up the code so Eclipse doesn't give any errors in the code, but when I run the code I do get errors.
Above the setup() I'm declaring a PImage:
- PImage myMap;
In a function somewhere down the code, I want to load an image:
- myMap = loadImage("myimage.png").
This is 84Kb PNG file, with 3600*2700 pixels. In Processing this is no problem. But Eclips keeps throwing errors at me:
- Exception in thread "Animation Thread" java.lang.OutOfMemoryError: Java heap space
- at processing.core.PImage.<init>(PImage.java:241)
- at processing.core.PApplet.loadImageMT(PApplet.java:3791)
- at processing.core.PApplet.loadImage(PApplet.java:3671)
- at processing.core.PApplet.loadImage(PApplet.java:3598)
- at atlas.draw_map(atlas.java:178)
- at atlas.setup(atlas.java:116)
- at processing.core.PApplet.handleDraw(PApplet.java:1583)
- at processing.core.PApplet.run(PApplet.java:1503)
- at java.lang.Thread.run(Thread.java:680)
I tried expanding the available memory for Eclipse, but I can't get this error to go away. I have no idea what is going wrong. I have a feeling the Java app is expecting some allocated room for the image to load in and it doesn't create this dynamically like processing does? (Just a thought).
Any ideas about how to fix this?
1