After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 349576 - Scaling many JPG pictures uses all of my memory.
Scaling many JPG pictures uses all of my memory.
Status: RESOLVED FIXED
Product: gthumb
Classification: Other
Component: general
2.7.x
Other All
: High critical
: ---
Assigned To: Paolo Bacchilega
Paolo Bacchilega
: 370104 399128 424872 467971 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-08-01 18:47 UTC by Mikko Segersvärd
Modified: 2007-08-18 19:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixes memory leak (494 bytes, patch)
2006-10-27 12:49 UTC, Michael Chudobiak
none Details | Review

Description Mikko Segersvärd 2006-08-01 18:47:59 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
Comment 1 Uwe Dulz 2006-10-15 22:00:47 UTC
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
Comment 2 Michael Chudobiak 2006-10-27 12:49:18 UTC
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
Comment 3 Michael Chudobiak 2006-10-31 21:19:34 UTC
Patch committed to CVS HEAD.
Comment 4 Michael Chudobiak 2006-11-03 17:03:09 UTC
*** Bug 370104 has been marked as a duplicate of this bug. ***
Comment 5 Michael Chudobiak 2007-01-21 20:33:18 UTC
*** Bug 399128 has been marked as a duplicate of this bug. ***
Comment 6 Michael Chudobiak 2007-03-31 19:27:14 UTC
*** Bug 424872 has been marked as a duplicate of this bug. ***
Comment 7 Michael Chudobiak 2007-08-18 19:23:54 UTC
*** Bug 467971 has been marked as a duplicate of this bug. ***