Increasing memory?
in
Programming Questions
•
2 years ago
I have just encountered the "OutOfMemoryError" and would like to know if I should increase the memory. Right now I have had the Processing memory set at the default since I have downloaded it and would like to know what is the best amount of memory to allow Processing. Also, do I even need to allow more memory? Below is a snip-pit of my code.
Thanks,
TheGamersHaven
- int cSize = 500;
- void keyReleased() {
- if (key == 's' || key == 'S') {
- canvas.save("Test.jpg");
- }
- if (key >= 1) {
- cSize = (key*100);
- startCanvas();
- println(key);
- }
- }
- //Random assortments of code....
- void startCanvas() {
- canvas = createGraphics(cSize+75,cSize+75,P2D);
- canvas.beginDraw();
- canvas.background(255);
- canvas.smooth();
- canvas.noStroke();
- canvas.fill(0);
- canvas.endDraw();
- }
When I run the sketch like it is it runs out of memory, but when I comment out the part where I call startCanvas() it works fine. My question is do I need to up the memory and what is the best amount of memory to allow Processing. If you need more code, or more explanation, I will gladly provide.
P.S. I am using Mac OS X and my main computer uses Windows, so I would also like to know if that would affect anything. I won't be able to respond for at least five to six hours because of school and probably interruptions.
Thanks,
TheGamersHaven
1