Status fields:
creation_ts: | 2006-11-08 17:19 |
---|---|
component: | native |
version: | 0.97 |
rep_platform: | All |
op_sys: | Linux |
bug_status: | NEW |
reporter: | hendrich@informatik.uni-hamburg.de |
I just built cacao-0.97 with current classpath cvs in order to track down a memory leak in my image-viewer application [1]. When running a slideshow, the JDKs (1.4.x, 1.5.x, 1.6.x) work fine, but jamvm+classpath slowly leak memory until the JVM crashes. See gcc bugzilla #29420 for details. This occurs after about 200..400 images, depending on -Xmx memory limit and image size. All of this on Linux x86. Unfortunately, it seems that cacao leaks even more memory than jamvm, on the order of 20+ MBytes per image. It seems that image data is not collected at all, and a slideshow will crash after just a few images. No small testcase yet, but you can download the binaries and sources of Niffler from [1]: cacao -Xmx300m niffler.Niffler menu -> select directory -> <select a directory with GIF/JPEG images> menu -> slideshow -> start slideshow (linear) ... crash Note that this happens also when thumbnails-generation, histogram, and exif-preview are switched off: just the plain image loading and image rendering. Could someone please confirm that image/JNI memory is not collected at all by cacao? If so, I don't need to bother testing again... Anyway, I have set this to "critical" for now. [1] http://tams-www.informatik.uni-hamburg.de/people/alumni/hendrich/niffler/
This seems to be caused by the CairoSurface object (gnu.java.awt.peer.gtk.CairoSurface); if you add System.out.println messages to the constructor and finalize() method, you can see that the object does not get garbage-collected. This does not happen with jamvm (using the most recent jamvm, I can't reproduce any leak at all in Niffler), but unfortunately I haven't been able to backport a recent version of Classpath into Kaffe, so I haven't tested for this bug using that VM. I do not suspect weak references play a role, but that's from a visual inspection and quick testing of the relevent Classpath code - I could have missed something. This is also reproducable on other applications as well, not just Niffler; however it is especially obvious in Niffler since it handles large amounts of image data.
Confirmed. The bug seems fixed in jamvm 1.4.4 and classpath cvs (but I can reproduce a small leak with jamvm 1.4.2 and a major leak with cacao 0.97).
Here is the GNU Classpath PR: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29420
I have fixed a memory leak in the Boehm-GC. Could you try again and report what the current memory usage is?
I seem to have hit the same bug using http://www.statsvn.org/. Just run it on any large-ish svn repo (cacao for example), and it will OutOfMemoryError pretty soon.
Still reproducible with current cacao and classpath, although the bug mentioned in comment #3 is supposed to have been fixed years ago. Further, it's unbelievably slow. Not reproducible with OpenJDK.