Bug 155904 - kded4 excessive CPU usage
Summary: kded4 excessive CPU usage
Status: RESOLVED WORKSFORME
Alias: None
Product: kdelibs
Classification: Unmaintained
Component: kded (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-16 13:31 UTC by Nick Warne
Modified: 2009-04-22 21:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Services running (33.91 KB, image/png)
2008-01-16 13:32 UTC, Nick Warne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Warne 2008-01-16 13:31:14 UTC
Version:            (using Devel)
Installed from:    Compiled sources
Compiler:          GCC 3.4.6 
OS:                Linux

SVN update from 15th Jan 2008.

Since starting to use KDE$, I am concerned of the excessive kded4 CPU usage - a constant 4%-6% load.

Here is top after X/KDE4 was up for 26 hours:

15977 nick      20   0 62068  20m  17m S  4.0  1.3  43:47.05 kded4
15906 root      20   0 71484  34m 5520 S  3.3  2.3   9:27.72 X

I think it is KDirWatch that is causing it, but I cannot see where this service is, nor how to turn it off.

I will attach screenshot of services running.

Nick
Comment 1 Nick Warne 2008-01-16 13:32:05 UTC
Created attachment 23072 [details]
Services running


Current services running.
Comment 2 David Faure 2008-01-18 13:19:28 UTC
You can try unloading kded modules one by one to see if one of them is guilty
$ qdbus org.kde.kded /kded loadedModules
favicons
networkstatus
kpasswdserver
kcookiejar
kwalletd

$ qdbus org.kde.kded /kded unloadModule networkstatus
true

But if KDirWatch is guilty, then that's part of the core kded functionality and cannot be unloaded.
Comment 3 Nick Warne 2008-01-18 14:02:23 UTC
OK, thanks for advice.

Turning off each loadedmodule, one-by-one, doesn't reveal anything... CPU usage still @ 4% - 6% constant.

I thne had a thought!  I mount / and /home 'noatime'.  So I remounted with that option removed, alas, still no change.

I have also just run kded4 through strace -f.

This reveals that 'stat64' polls/reads everything in my $HOME/.kde4 directory every second(ish).

Nick
Comment 4 Nick Warne 2008-01-18 14:28:25 UTC
OK, again thanks for the heads up.  I have resolved this issue on my system.

Googling revealed a 3.x.x thread that as FAM daemon isn't available, kded uses 'stat'.

'stat' polling can be controlled by entry in kdedrc thus:

[DirWatch]
PollInterval=60000

Here I have set it to 60 seconds.

This now leaves system happily purring along at 0% - 1%.

Nick
Comment 5 Cyrill Helg 2008-01-26 19:30:02 UTC
I added the options to kdedrc and installed/run famd but still my kded uses all my cpu all of the time.

Comment 6 David Faure 2008-01-28 16:18:24 UTC
> I added the options to kdedrc and installed/run famd but still my kded uses all my cpu all of the time.

Best way to find out why is to run "gdb --pid <pid>" and "bt" to see what it's doing...
Comment 7 Cyrill Helg 2008-03-07 22:57:41 UTC
Here is some debug output:

Reading symbols from /home/kde-devel/kde/lib/soprano/libsoprano_redlandbackend.so...done.
Loaded symbols for /home/kde-devel/kde/lib/soprano/libsoprano_redlandbackend.so
0xb3b02135 in librdf_hash_memory_find_node () from /usr/lib/librdf.so.0
(gdb) bt
#0  0xb3b02135 in librdf_hash_memory_find_node () from /usr/lib/librdf.so.0
Comment 8 David Faure 2008-07-01 12:26:01 UTC
Cyrill Helg: see bug 159027