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 344731 - gdk_pixbuf_animation_new_from_file eats up all my memory after open a GIF file
gdk_pixbuf_animation_new_from_file eats up all my memory after open a GIF file
Status: RESOLVED DUPLICATE of bug 585425
Product: gdk-pixbuf
Classification: Platform
Component: general
git master
Other other
: Normal normal
: ---
Assigned To: gdk-pixbuf-maint
gdk-pixbuf-maint
: 413619 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-06-13 05:40 UTC by pwpro
Modified: 2014-10-22 14:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test with gtk_image_new_from_file () (1013 bytes, text/x-csrc)
2007-03-08 16:43 UTC, Claudio Saavedra
Details

Description pwpro 2006-06-13 05:40:05 UTC
Distribution: Debian testing/unstable
Package: EOG
Severity: Normal
Version: GNOME2.14.2 2.14.x
Gnome-Distributor: Debian
Synopsis: eog eat up all my memory after open a GIF file
Bugzilla-Product: EOG
Bugzilla-Component: image viewer
Bugzilla-Version: 2.14.x
Description:
Description of Problem:
eog eat up all my memory after open a GIF file

Steps to reproduce the problem:
1. launch eog
2. file->open
3. open msf-abbrev-demo.gif  (you can get it from
http://www.bloomington.in.us/~brutt/msf-abbrev-demo.gif)

Actual Results:
the program eat up all my memory

Expected Results:
open the picture file correctly

How often does this happen?
every time I open msf-abbrev-demo.gif

Additional Information:
This is the gif file.
http://www.bloomington.in.us/~brutt/msf-abbrev-demo.gif




------- Bug created by bug-buddy at 2006-06-13 05:40 -------

Comment 1 Christian Kirbach 2006-06-13 11:42:03 UTC
sad but true

this also affects nautilus file preview

<nazgul> hmm what lib is used by eog and nautilus to show gif files
<bandini> nazgul, the gtk+ gif loader, I suppose
Comment 2 Sven Arvidsson 2007-03-01 20:41:54 UTC
Should this bug not be reassigned to gtk and gdk-pixbuf?
Comment 3 Claudio Saavedra 2007-03-01 21:08:30 UTC
Agreed, moving. Still present in GTK+ 2.10.
Comment 4 Claudio Saavedra 2007-03-01 21:23:44 UTC
A relevant trace obtained from eog with valgrind shows:

==1425== 118,710,196 bytes in 146 blocks are still reachable in loss record 166 of 166
==1425==    at 0x401D4B0: malloc (vg_replace_malloc.c:149)
==1425==    by 0x4BC8DF3: g_try_malloc (gmem.c:196)
==1425==    by 0x498FCED: gdk_pixbuf_new (gdk-pixbuf.c:269)
==1425==    by 0x6D10B58: gif_get_lzw (io-gif.c:855)
==1425==    by 0x6D11E2A: gif_main_loop (io-gif.c:1405)
==1425==    by 0x6D1240F: gdk_pixbuf__gif_image_load_increment (io-gif.c:1581)
==1425==    by 0x49960F5: gdk_pixbuf_loader_write (gdk-pixbuf-loader.c:466)
==1425==    by 0x806CDAF: eog_image_real_load (eog-image.c:822)
==1425==    by 0x806D3E5: eog_image_load (eog-image.c:998)
==1425==    by 0x807B2EE: eog_job_load_run (eog-jobs.c:340)
==1425==    by 0x8079DCB: handle_job (eog-job-queue.c:77)
==1425==    by 0x807A034: eog_render_thread (eog-job-queue.c:140)
Comment 5 Claudio Saavedra 2007-03-02 03:56:41 UTC
*** Bug 413619 has been marked as a duplicate of this bug. ***
Comment 6 Claudio Saavedra 2007-03-02 03:57:31 UTC
From bug #413619:

"Opened by Sven Arvidsson (reporter, points: 13)
2007-03-01 21:01 UTC [reply]

When EOG opens or Nautilus thumbnails large animated GIF files, for example
screencasts created in Byzanz, very large amounts of memory is used, sometimes
the OOM-killer kicks in. 

Example GIF: http://people.freedesktop.org/~company/byzanz/demo.gif

Possibly related to bug 142428, where some TIFF images eats RAM."
Comment 7 Matthias Clasen 2007-03-08 16:21:55 UTC
If eog uses a GdkPixbufLoader to load a gif, it is responsible for stopping after the first frame if it is only interested in the first frame. 

If it uses gdk_pixbuf_new_from_file or something similar, gdk-pixbuf itself will stop after the first frame.
Comment 8 Claudio Saavedra 2007-03-08 16:43:12 UTC
Created attachment 84252 [details]
test with gtk_image_new_from_file ()

Hm, attached program shows the same problem in gtk_image_new_from_file (). EOG is indeed interested in the first frame, but it seems the code for gif animations in gdk-pixbuf uses a lot of memory. Should a new bug for gtk+ be opened about it?
Comment 9 Matthias Clasen 2007-03-08 17:08:10 UTC
Hmm, that is because GtkImage actually uses gdk_pixbuf_animation_new_from_file to load the full animation, and then throws it all away, except for the first frame.
This is because GtkImage _supports_ displaying animations in this way.
To avoid this, you could use gdk_pixbuf_new_from_file() + gtk_image_set_from_pixbuf()
Comment 10 Björn Lindqvist 2007-08-16 19:46:02 UTC
Retitling and changing product.
Comment 11 Bastien Nocera 2014-10-22 14:23:51 UTC
The original image from comment 0 isn't available any more, but memory usage when loading GIF animations was fixed in bug 585425. I believe this should fix most of the problems with GIF animation memory usage. Please open a new bug if the problem is still present in gdk-pixbuf 2.31 (current master).

*** This bug has been marked as a duplicate of bug 585425 ***