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 107418 - fam monitoring/thumbnailing causing very high cpu usage.
fam monitoring/thumbnailing causing very high cpu usage.
Status: RESOLVED DUPLICATE of bug 593229
Product: nautilus
Classification: Core
Component: general
2.26.x
Other Linux
: Normal major
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 103820 114185 154778 155136 158272 164213 172974 300723 305630 310766 312833 317690 353223 374100 384585 440041 462741 585005 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-03-02 21:22 UTC by Mark Finlay
Modified: 2012-08-14 18:30 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
patch to gnome-vfs add notification when files are closed for writing (2.98 KB, patch)
2008-03-17 23:28 UTC, Thomas Folz-Donahue
none Details | Review

Description Mark Finlay 2003-03-02 21:22:27 UTC
When i am downloading a png image into a folder that is being monitored
by nautilus/fam nautilus tries to thumbnail the image every time it
is updated by fam. This causes the cpu to spike and nautilus to 
become unresponsive just because i'm downloading an image.
Comment 1 Mark Finlay 2003-03-08 18:30:18 UTC
See this thread on destkop devel:
http://mail.gnome.org/archives/desktop-devel-list/2003-March/msg00223.html

I think that the issue is that every time a file is changed nautilus
updates it and recreates the thumbnail. But the thumbnailing is only
part of the problem. There is still very high cpu usage with normal
files. 

I would suggest that disabling refreshing when a file's size is changed.
Comment 2 Yoav 2003-03-09 14:32:25 UTC
i have two ideas
1)Mime system will identify the file type ( if this a image file or 
Movie) and It Will Remember is size
then it will refresh every 5 sec if this is little pic ....
(u got the idea?)

2)Disable Auto Refreshing. 
Comment 3 Alexander Larsson 2003-03-12 10:08:15 UTC
*** Bug 103820 has been marked as a duplicate of this bug. ***
Comment 4 Mark Finlay 2003-03-12 13:37:00 UTC
Maybe the best solution would just be not to thumbnail on a fam
induced refresh only on a manual one.
Comment 5 Mark Finlay 2003-03-13 18:06:58 UTC
I just did some experimentations: 

run 'dd if=/dev/zero of=del'
both fam and nautilus showing 20-30% CPU Usage

Doing the same without nautilus fam uses 20-40%

So I don't think that this is really a thumbnailing issue.
It looks unpolished to have the thumbnail trying to generate
as you download, but the CPU usage is almost definately to do with
the actual file monitoring.
Comment 6 Alexander Larsson 2003-03-19 18:09:21 UTC
this is fixed in gnome-vfs head.
Comment 7 sherw 2003-12-09 02:46:36 UTC
This was reintroduced at some time and it is still present in GNOME 2.4
(Debian unstable flavour)..
Comment 8 Matthew Gatto 2004-11-14 20:02:30 UTC
*** Bug 158272 has been marked as a duplicate of this bug. ***
Comment 9 Matthew Gatto 2004-11-14 20:04:57 UTC
Reopening and updating Version based on duplicate bug and comment 7. Does
anybody know if this is still occuring in 2.8?
Comment 10 Ari Pollak 2004-12-11 23:49:03 UTC
this is definitely still occurring in 2.8. But instead of high CPU usage, the
constant re-thumbnailing of a currently-downloading movie file creates a
moderate CPU load (with famd running, anyway) and is kind of annoying.
Comment 11 Sebastien Bacher 2005-01-16 20:31:40 UTC
*** Bug 164213 has been marked as a duplicate of this bug. ***
Comment 12 Gabriel Burt 2005-01-16 21:00:18 UTC
Still occurring in Nautilus 2.9.2, see
http://bugzilla.gnome.org/show_bug.cgi?id=164213 (last duplicate bug)
Comment 13 Sebastien Bacher 2005-02-04 11:40:00 UTC
*** Bug 154778 has been marked as a duplicate of this bug. ***
Comment 14 Sebastien Bacher 2005-04-07 18:48:56 UTC
*** Bug 172974 has been marked as a duplicate of this bug. ***
Comment 15 Gustavo Carneiro 2005-05-02 22:03:32 UTC
Still happening on 2.10/hoary.  Very annoying.  I am copying a movie file from a
DVD to my hard drive.  Each file takes 5 minutes to copy.  During this time,
nautilus keeps respawning /usr/bin/gnome-video-thumbnailer over and over and
over again, making the system unresponsive (even the mouse pointer becomes "jumpy").

I think nautilus needs an exponential backoff on file change notifications, if
you know what I mean...
Comment 16 Martin Wehner 2005-05-08 18:44:35 UTC
2005-05-08  Martin Wehner  <martin.wehner@gmail.com>

	* libnautilus-private/nautilus-thumbnails.c:
	(thumbnail_thread_start):
	Don't try to thumbnail files which have been modified in the
	last few seconds to avoid constantly re-thumbnailing them.
	Current cool-off period is three seconds. Fixes bug #107418.
Comment 17 Ari Pollak 2005-05-08 19:23:59 UTC
Can this possibly be added to the GNOME 2.10 branch too?
Comment 18 Olav Vitters 2005-05-21 19:29:53 UTC
*** Bug 300723 has been marked as a duplicate of this bug. ***
Comment 19 Olav Vitters 2005-05-27 09:20:04 UTC
*** Bug 305630 has been marked as a duplicate of this bug. ***
Comment 20 Martin Wehner 2005-05-27 18:54:57 UTC
The patch is on the stable branch too now, so it'll be in gnome 2.10.2
Comment 21 Sebastien Bacher 2005-07-18 15:28:18 UTC
*** Bug 310766 has been marked as a duplicate of this bug. ***
Comment 22 Sebastien Bacher 2005-08-08 09:07:49 UTC
*** Bug 312833 has been marked as a duplicate of this bug. ***
Comment 23 Christian Neumair 2005-10-01 14:46:51 UTC
*** Bug 317690 has been marked as a duplicate of this bug. ***
Comment 24 Bastien Nocera 2006-04-10 17:18:39 UTC
*** Bug 114185 has been marked as a duplicate of this bug. ***
Comment 25 Andrew Conkling 2006-07-25 02:22:52 UTC
This is still happening in 2.14; this has been fixed?
Comment 26 Susana 2007-08-07 19:35:21 UTC
Reopening as per recent duplicates.
Comment 27 Susana 2007-08-07 19:35:57 UTC
*** Bug 440041 has been marked as a duplicate of this bug. ***
Comment 28 Susana 2007-08-07 19:36:30 UTC
*** Bug 462741 has been marked as a duplicate of this bug. ***
Comment 29 Susana 2007-08-07 19:36:35 UTC
*** Bug 384585 has been marked as a duplicate of this bug. ***
Comment 30 Susana 2007-08-07 19:38:08 UTC
bug 430043 seams related, although it is not the same issue.
Comment 31 Cosimo Cecchi 2007-12-28 20:06:13 UTC
*** Bug 353223 has been marked as a duplicate of this bug. ***
Comment 32 Nickolay V. Shmyrev 2008-01-26 13:37:52 UTC
*** Bug 155136 has been marked as a duplicate of this bug. ***
Comment 33 Cosimo Cecchi 2008-01-29 20:27:37 UTC
*** Bug 374100 has been marked as a duplicate of this bug. ***
Comment 34 Thomas Folz-Donahue 2008-03-17 23:28:38 UTC
Created attachment 107496 [details] [review]
patch to gnome-vfs add notification when files are closed for writing
Comment 35 Thomas Folz-Donahue 2008-03-17 23:32:49 UTC
The problem here is that Nautilus doesn't know when a program is finished
editing a file, so it updates the thumbnail every time it changes.  However, on
Linux, inotify lets programs know when a file has been closed for writing,
which is exactly the kind of information Nautilus is looking for.

I therefore propose that Nautilus should only update an icon when a file is
closed for writing.  Maybe let it change the icon once when a file is changed, and thereafter not do anything on file change events until there's a file closed for writing event.

Considering that this proposal is a fairly significant break from current
behavior (and that I've already taken two hours to pore over the labyrinth of
Nautilus' file monitoring, icon factory, and thumbnailing code and gotten
nowhere), I'm going to wait until there's a consensus before trying to
implement it.

The necessary changes to GnomeVFS are much simpler, however, and seem a lot more straightforward and uncontroversial.  So, I'm attaching a patch to get GnomeVFS to notify programs of IN_CLOSE_WRITE events (I hope it works... :)

hth,
~thomas
Comment 36 Thomas Folz-Donahue 2008-03-18 02:20:09 UTC
One other thing.  I know that there's this program in POSIX called 'fuser' that will tell you what programs are using a file, and even how they are using that file- for reading, writing, executing, mmaping, as their current directory, or as their root directory.

While IN_CLOSE_WRITE is already the perfect trigger for icon updates on a Linux system, GNOME is supposed to run on systems that don't have inotify yet.  Here's where fuser could be useful: when a file is changed, don't wait three seconds for more changes or make a new icon, check if it's open for writing, and check again every so often until it's closed.  Maybe with a timeout if some ridiculous program that isn't updating it nevertheless wants to keep it open for writing all day.

hth,
~thomas
Comment 37 Gustavo Rahal 2008-12-22 11:45:19 UTC
IMO this is a fairly important bug as it affects me every time I download a video file to desktop. I can save to a different location and avoid this error but will be a annoyance to non-power users. Saving a file (specially a video) to desktop is a very common user operation and will make the whole desktop experience suffer and users won't understand why.

Good to know there is already a proposed solution. Hope to see it in gnome soon (next release?).

Comment 38 A. Walton 2009-01-08 14:10:54 UTC
Patch obsoleted by GIO. Setting patch status.
Comment 39 Behnam Esfahbod 2009-05-20 20:20:14 UTC
I had the idea to prevent creating thumbnails when the file is open in "write" mode; but I am not sure whether it's possible on GIO or not.  Anyone?

I will work on it if someone give me a hint where to start and what's the resolution.
Comment 40 Cosimo Cecchi 2009-06-06 23:19:22 UTC
*** Bug 585005 has been marked as a duplicate of this bug. ***
Comment 41 Cornwall 2010-06-11 19:06:41 UTC
This bug hit me with more than CPU usage. My RAM went flying through the roof (disk started swapping madly), my window borders crashed, and my gnome-panel started to die slowly. It took me a good five minutes to get control of my computer enough to find this bug and kill the running video thumbnailing process.

Very nasty!
Comment 42 André Klapper 2011-08-18 15:09:22 UTC
[Bumping version number as per dup]
Comment 43 Magnetizer 2012-06-25 10:24:28 UTC
The problem still exists.

Ubuntu 12.04 LTS with gnome-session 3.2.1

Are there any workarounds besides not having the download folder open in Nautilus?

As the bug is nearly 10 years old, it could be that I am leaving this comment in the wrong place. If so, please tell me where to report it.

Thanks for any help.
Comment 44 William Jon McCann 2012-08-14 18:30:24 UTC

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