-   Linux - General (
-   -   KDE slow: takes 20 seconds to launch programs (

KWTm 02-19-2005 04:19 PM

KDE slow: takes 20 seconds to launch programs
Hello! Can someone tell me why it takes so long for KDE to start a program?

I've looked at some posts on that seem to deal with this, but I don't think they apply to me. They suggest a lack of memory (I have 600+MB --that *better* be enough!) or incorrect drivers for NVidia/ATI cards, neither of which I have.

When I click on the KWrite icon, for example, it takes about 20 seconds of staring at the "waiting" cursor before the window of the newly launched program comes up. This applies to any program, big or small (including small programs like KWrite or Konsole which should come up almost instantly).

It makes me think that this is something KDE is doing to check every program before it runs, or perhaps it keeps encountering some error and eventually times out and then figures out how to load the program some other way.

Is there some way I can figure out what it's doing as I wait for the program to start? I've tried starting KDE programs from the command line, but there is no error message or output.

I don't know if the following info helps: When I connect (ssh) from another computer and run programs on the command line, there *is* output ... something about not finding the display or something, and then "building ksyscoca" and eventually I am able to run KDE programs on the remote computer, displaying on the X display on my local computer. But I think this is just something that happens anyway whenever I use ssh with X-forwarding.

Can anyone help me? Is there some way I can at least "peek" into the inner workings of what's going on? Is there some config file I should be setting? Some command to tell me what's hogging all the resources in the 20 seconds after program launch? Any help would be appreciated.

I use Mandrake 10.0/official on my Microtel Athlon 1GHz computer with 614MB RAM (1GB swap) and 80GB drive, the Wal-Mart one that came pre-loaded with Lindows, now called Linspire.

cadj 02-20-2005 06:38 AM

A common cause of this problem is the /etc/hosts file
make sure it contains the line

Code:  localhost

musicman_ace 02-20-2005 06:40 AM

how many services are running that don't need to be. Almost every distro I've tried has at least 6-10 services that I don't use. CUPs would be one, but check out others and see what you can disable on startup.

KDE is probably that slow for me, I'm on a AMD 3000+ w/ 1GB of ram, I'm slowly migrating myself to Gnome.

vharishankar 02-20-2005 06:58 AM

No. KDE is quite snappy for me on a machine with 512 MB RAM, Athlon XP 2600+ processor running on 1.7 GHz.

Mostly this is not a KDE problem, but a problem more technical related to hard disk access, cache and so on.

musicman_ace 02-20-2005 06:46 PM

If its disk access, play with hdparm -tT /dev/hda and try various setting to get the timing a little better

foo_bar_foo 02-20-2005 11:09 PM

it is possible that the .kde directory goes with an older version you used to have or something and its hashing over config files it doesn't understand.

try deleting ~/.kde and then when you startup you will get the config wiz and various apps will all rewrite their configs and possibly all will work better
(try turning off that wait cursor and launch feedback as well that stuff is wastefull and stupid)

Glock Shooter 02-20-2005 11:30 PM

Start it from a terminal and see if you get any errors when it is starting.

ssandlin 03-04-2005 09:54 AM


Originally posted by musicman_ace
If its disk access, play with hdparm -tT /dev/hda and try various setting to get the timing a little better
I asked this question in another forum...but I'll try here too to see if there are any other suggestions.

Original Post Link:

I've tried a few suggested changes to my 2.6.10 kernel config, but no luck. Do hdparm changes affect both kernel boots? If so, shouldn't my settings be correct in 2.6.10 if I get good access times in 2.4.29 kernel? Which -X setting should I use if my motherboard's IDE is UDMA 33/66/100 using a 100 cable? If drive settings are consistant no matter which kernel is booted, then that would narrow the problem down to a kernel config error right?

My config and dmesg are in the thread.
Any other ideas?


Ace07 03-04-2005 12:03 PM


Originally posted by musicman_ace
KDE is probably that slow for me, I'm on a AMD 3000+ w/ 1GB of ram, I'm slowly migrating myself to Gnome.
Ive never had much luck with KDE myself. What can I say, I am a Gnome fanboi. ;)

ssandlin 03-04-2005 12:11 PM

I'm getting this slow drive access problem without the glorious help from any X windows running...

btw I just recently made a switch to Fluxbox...sooo nice!

KimVette 03-04-2005 12:23 PM

I don't know why all you are complaining about KDE performance. My box runs fine and it's a lowly Pentium III clocked at only 975Mhz, and kwin is just zippy. If you're on a faster box and it's bogged down, trim back what you're running in the background; edit the runlevel and turn off what you don't need. Also, if you're running Xorg and turned on composite and are running transparent windows, either pick the right video card so you can get hardware acceleration, or forgo some of the eye candy.

ssandlin 03-04-2005 12:35 PM

I have absolutely no problems with KDE. I figure to each his own. It ran just fine for me when I wasn't having drive access slowness.

Anyone have a pointer or 2 about solving my slow hard drive problems?

output from hdparm -tT /dev/hda

2.4.29 (base kernel installed w/ Slack)

cached - 504MB in 2sec = 252.00 MB/sec
buffered - 72MB in 3.01sec = 23.92 MB/sec

2.6.10 (self config from

cached - 56MB in 2.02sec = 27.66 MB/sec
buffered - 30MB in 3.15sec = 9.54 MB/sec

That's a HUGE gap in performance between the two! I'm sure I did something wrong, but don't know enough to see what it is!

you can see output from dmesg and config 2.6.10 at this thread:


exvor 03-04-2005 12:42 PM

Ive always had a slow response in any Full Desktop manager.

Gnome seams a little faster then kde but takes a little getting used to if your going from windows.

i used kde on my server that has a 300mhz with 256mb ram for a long time but eventually swiched to fluxbox because of performance.

I know i bash on kde and gnome way too much on this forem but I just dont see why there so slow even explorer on windows xp is faster on 64mb of ram then kde if kde or gnome will even run. albeit windows explorer slows when lots of other crap is loaded like spyware and other junk.

KWTm 03-05-2005 10:50 AM

KDE slow because of services? How disappointing!
Thank you for all of your replies. The most useful reply to me was from foo_bar_foo, who suggested that it could be a problem with rehashing config files with unrecognized parameters. This is truly a waste of resources, and might explain one main frustration I have with Windows and my Linux and just desktop systems in general: when you first use them, they seem to work well, and then as time goes on, they get more and more bogged down for no particular reason ... and you wonder, hey, if the computer is a digital, predictable system, why on earth would it start working differently as time goes on?? If this is indeed what is going on, then, contrary to popular myth, Linux (or at least Mandrake Linux) *would* benefit from a clean re-install every so often, taking away its advantage over Windows. Bleah.

Another thing I'm peeved about: when a KDE program opens a file dialogue (as in "Save As... [filename]"), it gives a window showing the current directory. It lists all the files in the current directory. And then [gasp!] it puts an icon next to each file that varies depending on whether it's a text file, graphic image, etc. Well, now, unlike Windows, KDE doesn't determine the file type based on the extension --no sir, you can't fool KDE into mistaking that trojan spyware is a text file just because it ends in ".txt"; KDE's going to ANALYZE THE FILE CONTENTS to see what file type it is. Unfortunately, I have hundreds of files in my directories, and it takes a few seconds just to bring up the file list. All this just to save a file. (Please don't suggest that I organize files into subdirectories --I already do, and it just so happens that several directories have hundreds of files.)

Cadj, I wasn't aware that "/etc/hosts" had to contain " localhost". What happens if it doesn't? As it happens, mine contains the actual names of the machines in my home network, and it names itself (eg. " yuma", where yuma is the name of the machine I'm running on). I guess it aids in looking up itself. I'll try that; thanks.

As for other suggestions, I guess I do find them disappointing, although this is by no means the fault of the posters. Turning off unneeded services? Switching to a different Desktop Environment? I thought Linux was more efficient than this. I'm running on a 1GHz machine, and you'd think this would be more responsive than Windows 3.1 running on a 400MHz Pentium1 or something. What in bloody blazes is Mandrake Linux doing with all my computing power? Yes, I do run some non-desktop services, like the "sshd" demon and CUPS (my other computers do need to print), but I consider these *needed* services, and I'm not running an Apache server or anything (although I had been planning to). The thing is, I'm not sure things are much faster on my 1.2GHz machine, and technically they should be 20% faster.

I do think that hard drive access might be a factor, but the applications shouldn't be that hard-drive intensive; I check my swap memory, and it's hardly being used. And it's not thrashing (inefficiently using swap memory due to swap memory full), since I have a 1GB swap partition.

Someone said "run it on command line and see if there are any errors", but I had already said in my original posting that "I've tried starting KDE programs from the command line, but there is no error message or output."

Some posters have said that KDE runs fine on their slower machines. One thing that could be useful is having people post actual times for starting programs, having file windows pop up, etc. It could be just perception of speed. or that I happen to be an impatient guy. Let me do some timings and post them, too.

KimVette 03-05-2005 11:16 AM

Re: KDE slow because of services? How disappointing!

Originally posted by KWTm
As for other suggestions, I guess I do find them disappointing, although this is by no means the fault of the posters. Turning off unneeded services? Switching to a different Desktop Environment? I thought Linux was more efficient than this. I'm running on a 1GHz machine, and you'd think this would be more responsive than Windows 3.1 running on a 400MHz Pentium1 or something.
Ah but then you're falling into the trap of comparing apples to oranges.

If you installed EVERYTHING, then here is a sampling of what you probably have turned on by default in runlevel 5 (the list is MUCH longer but here are some examples):

DHCP server
BIND (dns)
Apache (httpd)
Postfix (or sendmail)

. . . all of which are generally unnecessary on a home machine, unless you're developing web and network apps, or serving up web content.

Some may call it bloat, but Linux gives you the choice to install everything, install nothing, or anything in between those two extremes. If you installed apps and daemons more appropriate for an enterprise server or for a development workstation, don't bother wondering why it's slow - each daemon you load is going to take at least some RAM,

Also, are you running applets in your dock? Do you have applications minimized to your "system tray?" Again, those apps take up precious RAM (even when you have a gig it does matter), and they all take some additional CPU time even when idle because the kernel has to manage each application's handles in its memory space, and although an application may be sitting there taking 0% CPU time in and of itself, it will take the kernel ever-so-slightly longer to process each thread's message.

So, my telling you to edit your runlevel and analyze what you are running is perfectly valid. Out of the box a Linux environment may be running scores of processes, while the desktop version of Windows runs almost nothing out of the box --- so your comparison is apples to oranges and is not fair nor is it objective.

KWTm 03-06-2005 12:01 AM

"strace" shows KDE programs seeking library files in wrong places, delaying startup
To follow up with my previous query, I browsed through some of the archives at I'd have to say that the geek factor there is higher than here, and newbies might find it a bit daunting. Anyway, from there I learned about the "strace" command.

I had said that I tried running commands like "kwrite" from the command line, but it shows no error message or output, so I don't know why it's taking so long to start up. This time I tried running the command

strace kwrite
This tracked the communication between the "kwrite" program (or whatever program you specify) and the Linux kernel. I was able to see that kwrite was looking for all sorts of files in the wrong places, and then finally hitting the right places after a while. For example:

open("/usr/lib/qt3/lib/", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/X11R6/lib/tls/", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/X11R6/lib/", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/", O_RDONLY) = 3

Here we see that it's looking for the file "" under the directory "/usr/lib/qt3/lib/", but it's not there (the Linux kernel says to kwrite: "-1 ENOENT"); then it tries again at "/usr/X11R6/lib/tls/" but again it's not there. It fails again once before getting it on the fourth try.

This is just one example, and it looks for other files, most of which contain the string ".so.", which tells me it's a library file ("so" = "shared object").

So, somehow the KDE programs don't know where their own library is located and have to search. There must be some config setting for me to tell them. Barring that, I might just have to put in symbolic links to the places where the programs expect to find the libraries (by using the command "ln -s /path/to/real/library/ /path/to/where/the/KDE/program/is/looking/") but these are in all sorts of different places, and I'd rather have a clean solution than have to do a hack job on all these libraries.

Anyway, I thought I'd share what I'd learned so far. Main lesson: when things are frustratingly slow, at least "strace <slow-as-molasses-command>" might tell you how a program might be banging its head against the wall.

Second lesson: this is the second time I've found that, when a computer gradually gets slower and slower (over a few months, on the same installation), it's because of stepwise but unnoticed changes in the config. So, no, it's not because of files gradually filling up disk space or something.

To reply to KimVette's post, I do keep services to a minimum, although that minimum does include "sshd" and CUPS, which may be more than what a desktop uses. No BIND, no Apache, no dhcpd, no MySQL. (Hmmm, I am running SWAT ...) But you're right, I should go analyze what exactly the computer is doing ... "strace" is a start.

By the way, I am sheepishly admitting that I actually asked a very similar question a few months back, and completely forgot about it. (I think I was too frustrated with my computer to surf the web and check for answers.) Readers can get some insight there, too; the thread is at:

All times are GMT -5. The time now is 04:17 PM.