high cpu load on startup and when mounting

Bug #239167 reported by Oben Sonne
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
nautilus (Ubuntu)
Invalid
Low
Ubuntu Desktop Bugs

Bug Description

Binary package hint: nautilus

I know there are several bugs concerning nautilus and a high CPU load. However, they does not really fit to my situation.

The problem is that whenever nautilus starts (e.g. on login or after a 'killall nautilus'), it uses 80% to 100% of the CPU and I can use nautilus only with a high latency. The high CPU load lasts for about 30 seconds. Then I can use nautilus in a normal fashion (although it still eats a lot of CPU again when browsing folders, but only for a second per folder).

The problem (i.e. duration of high CPU load and interaction latency) gets worse if I mount a remote share using ssh (fusermount) - no matter if I access the mount point with nautilus or not.

I disabled any preview functionality, but this did not solve the problem. Tracker is disabled also.

I did not experience this problem in Gutsy.

It looks like nautilus is crawling the whole filespace to gather whatever information .. this would be ok, if it could do that with a reasonable low priority and without blocking it's UI.

System information:
Ubuntu 8.04
libnautilus-burn4 2.22.1-0ubuntu1
libnautilus-extension1 1:2.22.3-0ubuntu2
nautilus 1:2.22.3-0ubuntu2
nautilus-cd-burner 2.22.1-0ubuntu1
nautilus-data 1:2.22.3-0ubuntu2
nautilus-sendto 0.13.2-0ubuntu1
nautilus-share 0.7.2-0ubuntu5

Thanks in advance for spending time on this issue :)

ProblemType: Bug
Architecture: i386
Date: Wed Jun 11 15:16:43 2008
DistroRelease: Ubuntu 8.04
ExecutablePath: /usr/bin/nautilus
Package: nautilus 1:2.22.3-0ubuntu2
PackageArchitecture: i386
ProcEnviron:
 PATH=/home/username/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: nautilus
Uname: Linux 2.6.24-18-generic i686

Tags: apport-bug
Revision history for this message
Oben Sonne (obensonne) wrote :
Revision history for this message
Oben Sonne (obensonne) wrote :

I've added a backtrace while nautilus consumes 100% CPU (sent SIGTERM to nautilus to get the backtrace via GDB).

One reason why nautlius consumes so much CPU at login, when mounting a drive or while browsing (especially directories wiht many files) may be that it simply forgets its "thumbnail" information between 2 sessions .. just a guess !?

Revision history for this message
Sebastien Bacher (seb128) wrote :

thank you for your bug report. do you get the issue using an another user on the same configuration? do you use the standard theme? the stacktrace is not really useful, the bug could be due to a file on your desktop it's trying to thumbnail, do you have any svg there?

Changed in nautilus:
assignee: nobody → desktop-bugs
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Oben Sonne (obensonne) wrote :

Sorry for the delayed answer ..

I've created a new user and when logging in with this user, the problem does not occur. However, I have no big files on my desktop which could stress nautilus. The problem (high CPU load) is most annoying when browsing any directory with a lot of image files (also SVG) - but browsing the same directories with the new user works just fine.

Both users have the standard Ubuntu Hardy theme (compiz enabled).

What could I do to determine the relevant difference between the new user (which works fine) and the one I am using regularly (where the problem occurs)?

Thanks,

Oben

Revision history for this message
Sebastien Bacher (seb128) wrote :

could you copy some files to the new user directory until getting the issue and try to figure what makes a difference there?

Revision history for this message
Oben Sonne (obensonne) wrote :

I think I found the problem.

Instead of copying files to the new user home I hided some directories (chown to root and chmod to 700).

Here is a list of the directories in my home with number of files and size.

opt: 12912 files / 349M
bin: 168 files / 1.9M
data/Desktop: 498 files / 6.1G
data/Documents: 306 files / 78M
data/Download: 39 files / 703M
data/Misc: 17 files / 11G
data/Projects: 10087 files / 435M
data/Public: 0 files / 0M
data/Resources: 219017 files / 22G
data/Software 2196 files / 8.7G

I could avoid nautilus' high CPU load after hiding data/Projects, data/Resources and data/Software. Un-hiding these directories step by step again increased nautilus' CPU load and nautilus UI usage latency.

My first guess was that nautilus simply has problems with directories containing a lot of files. On the other side the directory 'opt' had no impact on the problem.

The actual problem with 'data/Projects', 'data/Resources' and 'data/Software' was that I configured my '~/.config/user-dirs.dirs' like this:

XDG_DESKTOP_DIR="$HOME/data/Desktop"
XDG_DOWNLOAD_DIR="$HOME/data/Download"
XDG_TEMPLATES_DIR="$HOME/data"
XDG_PUBLICSHARE_DIR="$HOME/data/Public"
XDG_DOCUMENTS_DIR="$HOME/data"
XDG_MUSIC_DIR="/mm/Music"
XDG_PICTURES_DIR="/mm/Photos"
XDG_VIDEOS_DIR="/mm/Videos"

After setting

XDG_TEMPLATES_DIR="$HOME/data/Documents"
XDG_DOCUMENTS_DIR="$HOME/data/Documents"

and running

$ xdg-user-dirs-update
$ xdg-user-dirs-gtk-update
$ killall nautilus

the problem was away, also if I un-hided the 3 problematic directories.

So I guess because nautilus considered '~/data/' as a document folder, it did something it does not do with "normal" folders - whatever it did, it could not handle the large number of files within '~/data/'.

Revision history for this message
Oben Sonne (obensonne) wrote :

Just want to add, that the xdg-user-dir setting also explains why the CPU load and usage latency got worse when mounting a remote share - the mount point was below ~/data/ .

Changed in nautilus:
status: Incomplete → New
Revision history for this message
Sebastien Bacher (seb128) wrote :

the template directory is what is used to list the documents templates which can be created, if you have some hundred thousand templates it's normal it takes a while to create the list, that's not a nautilus bug but a configuration issue

Changed in nautilus:
status: New → Invalid
Revision history for this message
hamlet77 (tkapela) wrote :

I had the same and making template directory empty solved the problem. I was using this directory as a temporary folder (I think I misunderstand the word template).
But I was searching for solution for half a year,
and I was seriously thinking of giving up Ubuntu because of this annoying behavior. I did not use nautilus at all
and it had 100% CPU and 60% memory used. Killing it was not helping.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.