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 515250 - EOG slow, locks up system on bitonal TIFF
EOG slow, locks up system on bitonal TIFF
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: image viewer
2.21.x
Other Linux
: Normal normal
: ---
Assigned To: EOG Maintainers
EOG Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-02-08 18:52 UTC by Pedro Villavicencio
Modified: 2008-02-11 18:52 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
massif output for the first test case (59.05 KB, text/plain)
2008-02-08 20:22 UTC, Claudio Saavedra
  Details
massif output for the second test case (35.82 KB, text/plain)
2008-02-08 20:23 UTC, Claudio Saavedra
  Details
Use loaded pixbuf to create thumbnail (6.00 KB, patch)
2008-02-08 23:31 UTC, Claudio Saavedra
committed Details | Review
massif output for the first test case after the patch (32.65 KB, text/plain)
2008-02-08 23:34 UTC, Claudio Saavedra
  Details

Description Pedro Villavicencio 2008-02-08 18:52:16 UTC
This bug has been reported here:

https://bugs.launchpad.net/ubuntu/+source/eog/+bug/189048

"Some types of bitonal TIFF images load very, very slowly, causing the entire system to slow to a crawl and in some cases lock up Gnome completely requiring switching to a different terminal and rebooting. The images are not that big, around 5 MB. System is a dual-core intel @ 3.40 Ghz and 1 GB RAM. The same images open up fine on a slower machine (2.8 Ghz P4 / 512 MB RAM) using windows XP and acdsee 8."

sample image:

http://launchpadlibrarian.net/11759926/test_img.tar.gz

Thanks,
Comment 1 Claudio Saavedra 2008-02-08 19:07:33 UTC
Trying to open that image with several other gdkpixbuf based viewers, and also trying to thumbnail it with nautilus, caused a *huge* memory usage. This is most likely a problem with the GdkPixbuf TIFF loader.
Comment 2 Claudio Saavedra 2008-02-08 20:20:54 UTC
So, there is something to notice. Opening that image in a newly created directory causes eog to use *twice* as much memory, as what it would need when opening the image if this has already been thumbnailed.

Test case:

1. mkdir testdir/ && cp 00019.tiff testdir/
2. Run eog testdir/00019.tiff
2.1 This causes eog to use about 270 MB of memory to load the image *before* the image icon appears.
2.2 EOG tries to load the image icon with gnome-thumbnail, as the thumbnail doen't exist, gnomethumbnail needs to open the image and create it. This causes eog to use about 270 MB extra.
3. The image icon appears, and eog is using about 550 MB. That image doesn't get released.
4. Close eog.

Second test case.

1. Open eog in the same way, now that we knwow that the image thumbnail already exists.
1.1 Eog uses about 270 MB of memory.
1.2 EOG tries to load the image icon, gnome-thumbnail finds it ~/thumbnails, and loads it from there.
2. The image icon appears, and eog is using *only* 270 MBs.
2. You can close eog.

Comment 3 Claudio Saavedra 2008-02-08 20:22:59 UTC
Created attachment 104735 [details]
massif output for the first test case
Comment 4 Claudio Saavedra 2008-02-08 20:23:39 UTC
Created attachment 104736 [details]
massif output for the second test case
Comment 5 Claudio Saavedra 2008-02-08 23:31:51 UTC
Created attachment 104755 [details] [review]
Use loaded pixbuf to create thumbnail

eog-thumbnailer.c is based in nautilus. There, it makes sense to always use an URI to create thumbnails. 

In eog, however, sometimes we already have the pixbuf loaded in memory, and in these cases, asking gnome-thumbnail to load the pixbuf in order to create the thumbnail wastes memory and bandwidth.

This patch improves this situation. If we can't find a thumbnail but have the pixbuf already loaded, use it to create its thumbnail and save it, instead of asking gnome-thumbnail to load it again.
Comment 6 Claudio Saavedra 2008-02-08 23:34:06 UTC
Created attachment 104756 [details]
massif output for the first test case after the patch

Here we can see that eog needs *only* 280 MBs, instead of 550 MB, after having applied the patch.
Comment 7 Luke Hutchison 2008-02-09 04:56:38 UTC
I reported a very similar bug a while back: Bug 160460.  It is closed now but there is some useful information and cross-refs to other bugs there.
Comment 8 Felix Riemann 2008-02-11 18:03:53 UTC
I gave your patch a try and it seems to work fine. :)
Comment 9 Claudio Saavedra 2008-02-11 18:52:20 UTC
Committed in trunk (rev. 4350). I'm marking this as fixed as I don't see further improvements on the application side (see bug #57183 for reference):

2008-02-11  Claudio Saavedra  <csaavedra@alumnos.utalca.cl>

	* src/eog-jobs.c: (eog_job_thumbnail_dispose),
	(eog_job_thumbnail_new), (eog_job_thumbnail_run):
	* src/eog-jobs.h:
	* src/eog-list-store.c: (eog_job_thumbnail_cb),
	(eog_list_store_add_thumbnail_job):
	* src/eog-thumbnail.c: (create_thumbnail_from_pixbuf),
	(eog_thumbnail_load): Load thumbnail from EogImage instead of
	GnomeVFSURI.
	* src/eog-thumbnail.h:
	* src/eog-window.c:

	Use the pixbuf data in EogImage to create a thumbnail if this exists
	and thumbnail under ~/.thumbnail is not valid/doesn't exist.
	Improves performance and memory usage. Fixes bug #515250.