Find the answer to your Linux question:
Results 1 to 8 of 8
Hello I am developing an app written purely in C and compiled with gcc under my PCLinuxOS distro. This app processes hundreds of megabytes of data read in from the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2005
    Posts
    3

    kdeinit uses ~50% of CPU


    Hello

    I am developing an app written purely in C and compiled with gcc under my PCLinuxOS distro. This app processes hundreds of megabytes of data read in from the harddrive. and thus allocates memory on the fly using malloc(). As expected, when I run my program I can see in 'top' that my program's memory usage is growing. However, what I also see is that the kdeinit process is taking about 40-50% of my CPU time whenever I am running my program. What is that process? Is it related to the numerous malloc() calls my program makes? How can I minimize the CPU usage of kdeinit and give more horsepower to my app?

    Thanks.

    P.S. So far I have asked this question in a number of other forums (including PCLOS), but noone has replied.

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    kdeinit, is, as the name suggests, a process run by the K Desktop Environment ( aka KDE ). This is the process that starts KDE up. If you don't want it hogging your CPU / Ram, either use a WM with less bloat ( like Flux or RatPoison ), or just work from the console without any X.

  3. #3
    Just Joined!
    Join Date
    Nov 2005
    Posts
    3

    why?

    From what I could tell from Googling for kdeinit, it is a process that is used to startup other KDE processes, and, in fact, when you run ps unde KDE, you see lots of instances of kdeinit, none of which usually take more than a few percent of CPU cycles.

    What I am seeing is that kdeinit is hogging half of CPU cycles (the maximum, given that my program is using up the rest of the cycles). My specific question was why? My program has nothing to do with either linux nor KDE It uses nothing but standard C library calls. Going away from KDE is not an option for me in this application, so I truly need to understand it and figure out how to minimize the presence of kdeinit so that more CPU cycles are available for my program.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    1. You make it sound like it only uses CPU cycles when you run your program
    2. What else do you want me to say? If a process uses up too much RAM/CPU, then there's only 3 things you can do:
    -Don't use that program
    -Buy more RAM
    -Buy a better CPU

  6. #5
    Linux Engineer
    Join Date
    Sep 2003
    Location
    Knoxhell, TN
    Posts
    1,078
    he could nice KDE....
    Their code will be beautiful, even if their desks are buried in 3 feet of crap. - esr

  7. #6
    Linux Engineer
    Join Date
    Jan 2005
    Location
    Chicago (USA)
    Posts
    1,028
    Just a guess, but this could be like every KDE process appearing to be a resource hog because shared memory is included. (Things aren't as they seem.)

  8. #7
    Just Joined!
    Join Date
    Nov 2005
    Posts
    3
    I don't mean to push this point much further, but I still did not get an answer for my questions of "Why is kdeinit started with my program?" and "why is it using up so much CPU time?"

  9. #8
    Linux User
    Join Date
    Aug 2005
    Location
    Italy
    Posts
    401

    Strange but...

    Here is a part of my pstree output:

    ...
    |─kded
    |─kdeinit─|─artsd
    | |─firefox-bin
    | |─gaim
    | |─gkrellm
    | |─kio_file
    | |─klauncher
    | |─konsole───bash───pstree
    | |─kwin
    |─kdesktop
    |─kdm─|─XFree86
    | |─kdm───x-session-manag─|─kwrapper
    | |─2*[ssh-agent]
    ...
    As you can see many programs are kdeinit children... I don't know how process launching is managed by KDE, but I suppose that you're program can't have anything about kdeinit: infact your program can't influence other program performance (because you don't use kde libraries, qt widgets, X library... only standard library).

    To answer you, kdeinit is not started by your program, but by kdm or xinit client when X startup. And... why it's so CPU hungry? Maybe nobody knows...
    When using Windows, have you ever told "Ehi... do your business?"
    Linux user #396597 (http://counter.li.org)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •