New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OutOfMemory in image() #1391
Comments
From f...@processing.org on October 29, 2012 12:18:50 What happens if you set frameRate(10) or 20 inside setup()? I wonder if the (heavyweight) createGraphics() and image() calls aren't allowing any sleep time between draw() calls and therefore starving the GC. |
From fjen...@gmail.com on October 29, 2012 13:36:57 |
From f...@processing.org on October 29, 2012 13:40:31 |
From nonsequi...@gmail.com on November 18, 2012 02:17:03 String[] img_filenames; void setup() int i = 0; // image filename index void draw() |
From f...@processing.org on November 18, 2012 03:08:29 |
From nonsequi...@gmail.com on November 18, 2012 13:25:51 I have an app that runs all day in a gallery and essentially displays random images loaded from disk. There are thousands of possible images, so I have to load them on demand. I have to use loadImage() constantly and it's causing a memory leak. |
From igno...@gmail.com on November 29, 2012 23:27:58 PhiLho offered a more compact example than mine, with a workaround:
The same problem occurs outside a tight loop, in my example. I've tracked it with JConsole. Garbage collection still happens in Processing 1.5.1 but not in Processing 2.0b6. |
From goo...@superduper.org on December 16, 2012 22:19:47 #8 actually fixes it for me. only took a rough look, what strikes me is that there's no awtImage.flush() when the image is loaded |
From f...@processing.org on December 16, 2012 23:21:33 Loading on user interaction is of course important, but if you need new images at 60 fps, you want a movie, or for the images to be loaded once inside setup(), then swapped in as necessary. But the general fact that it runs out of memory is a really significant bug that I haven't had time to track down yet. |
Hi, I've been experiencing a similar problem with using PShapes that has only been occurring in Windows 7. Works fine in Mac: https://forum.processing.org/topic/pshape-memory-leak-in-windows#25080000002001447 |
Fixed in commit 3b64812 |
Hello, I always have this memory leak issue in the 2.09 version, my code call in draw() : this.cam.loadPixels(); Is-it relay fixed ? Thanks |
Yes, I also used version 2.0b9 and still have memory leaks with setupFrameResizeListener() |
But this issue seems to be fixed in the 2.0 stable verions ! :) |
The issue is fixed, please use the forum for further discussion. |
When loading certain streets e.g. Chavila Checker, the programme exceeded 256 MB, even when just one snap loaded and only about 7 quoins. Removing the cache for the image when it was unloaded appeared to fix the problem (processing/processing#1391). There is still some memory problem which I think is down to Processing as a simple load street snap/unload street snap showed that after the unload, the memory didn't return to the initial level before the first load - some memory is not being released. Not sure I can do anything about that other than set the memory bar for the programme a bit higher e.g. to 300mb. As it is useful, on level 1 error tracing, memory information is dumped out when loading/unloading images - can then be put in a spreadsheet (import, split at ,) and graphed so can see what is happening. Also changed quoin output info to only give the class name - type is irrelevant as included in class name information. And improved some tracing for when start processing an item on a street.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Original author: fjen...@gmail.com (October 29, 2012 11:55:40)
I think the ImageCache introduced a memory leak.
Here's a simple example that already shows the problem:
PGraphics pg;
void setup ()
{
size( 200, 200 );
}
void draw ()
{
pg = createGraphics( width, height );
pg.beginDraw();
pg.background(random(255));
pg.endDraw();
}
This runs up to around 3GB of (real) memory in less than a minute .. until it fails with OutOfMemory.
Removing the image() call removes the problem.
Os-X 10.6.8, MacBook
Tested on SVN (< rev 10366) and 2.0b5
Tested with OPENGL and JAVA2D
Original issue: http://code.google.com/p/processing/issues/detail?id=1353
The text was updated successfully, but these errors were encountered: