GNOME Bugzilla – Bug 349576
Scaling many JPG pictures uses all of my memory.
Last modified: 2007-08-18 19:23:54 UTC
Please describe the problem: I tried Scaling 191 JPG camera pictures from 1600*1200 to 1280*1024. After I pushed the Scale Now button gThumb starts eating my RAM very fast. I have 1gig of RAM and propably 750M was free when this bug occured. I tried to Scale the pictures in groups of 12 at a time. After I Scaled 12 pictures gThumb was allready eating few hundred megabytes of memory and it didnt release the used memory automaticly. So I resized another 12 pictures and the memory hogging continued. Steps to reproduce: 1. Select few dozen pictures 2. Tools -> Scale images -> new resolution -> scale now. 3. observe the memory usage of gThumb. Actual results: My Gnome became so unresponsive I had to reset it with Ctrl-Alt-BackSpace Expected results: Memory usage shoud not depend on the amount of the scalable pictures. Memory Isn't being freed after each scale operation. Does this happen every time? Yes. I tested it three times. Other information: My system: Athlon XP 2100+ 1G RAM Ubuntu 6.06 Kernel 2.6.15-26-k7 gThumb 2.7.6
I have experienced the exact same behaviour as described above. I am having 2GB of RAM which is all used up while scaling images until nothing is remaining, then gThumb crashed. While is closed without leaving notice also two Java-applications (JFritz and Azureus) closed too which suggests that the Java Virtual Machine has something to do with it. I am using Sun's Java from the Ubuntu Repositories. gThumb: 2.7.6 Ubuntu 6.06
Created attachment 75504 [details] [review] Fixes memory leak Manuel Braga has identified a memory leak. From his email to me: (libgthumb/gth-pixbuf-op.c) gth_pixbuf_op_set_pixbufs references the "dest" pixbuf, but in scaling, (libgthumb/async-pixbuf-ops.c) scale_step uses the gdk_pixbuf_scale_simple that set a new pixbuf to "dest", losing the previous pointer in the end (libgthumb/gth-pixbuf-op.c) release_pixbufs only see the new pointer. His patch is attached. Thanks Manuel! - Mike
Patch committed to CVS HEAD.
*** Bug 370104 has been marked as a duplicate of this bug. ***
*** Bug 399128 has been marked as a duplicate of this bug. ***
*** Bug 424872 has been marked as a duplicate of this bug. ***
*** Bug 467971 has been marked as a duplicate of this bug. ***