Unix, OS Core, & Why They Eat My CPU

Discussion in 'Mac OS X 10.3 (Panther) Discussion' started by Earendil, Mar 11, 2004.

  1. Earendil macrumors 68000


    Oct 27, 2003
    It might have been nice to have some sort of documentation come with the computer (either as paper, but more useful and likely as .txt) explaining the set up of OSX.
    I've always wondered what all the functions and purposes of all the "programs" I see running in Activity Monitor, most of which I assume is the OS split into different parts.

    Now though I've gone from wondering to an outright need to know basis. I have a little program that sits in the menu and tells me the % of my CPU being used. As of two hours ago it is pegged at 100%. I Opened up Activity Monitor to see who was at fault, and found most of the apps running around norm. The only regular apps above 5% are iTunes (5-9%) and Safari (8-20%, which always seemed like too much to me...). But now though, (null) is eating EVERY last bit of CPU power. It's not tying up my computer, as my PB still functions, but it's literally pegging out the last 60-80% of the CPU.

    I'm running a 1.25ghz AlumPB, 512RAM, and Panther.2

    [edit] WindowsServer is also making random jumps to 26% from 4% [/edit]



    yes, I have done searches, unfortunately the topics for these sort of things come in the millions, and aren't related :(
  2. abhishekit macrumors 65816


    Nov 6, 2003
    akron , ohio
    If you are just looking for a way to know what is eating how much of your cpu, just write 'top' at your terminal ...press enter..it will give u real time usage..to exit just press q...
    and if you were asking as to why certain things eat your cpu as much as they do..I have no idea :D
  3. Earendil thread starter macrumors 68000


    Oct 27, 2003
    Activity Monitor is just an Apple app giving a GUI to that terminal command. It's because of this that I know that (null) is eating my CPU. Now to fix it, and keep it from happening again!

  4. tomf87 macrumors 65816


    Sep 10, 2003
    I would go to terminal, and run:

    ps -auxwl

    Find the null process and see what it's parent process ID (PPID). Then you can see what actually invoked the null process.
  5. cb911 macrumors 601


    Mar 12, 2002
    BrisVegas, Australia
    tomf87, could you explain what the 'ps' command does, and what those flags do?

    i usually don't like typing stuff into Terminal that i don't know what they mean. :p

    sounds useful though. i've always wanted to know how to find out what started a process.
  6. tomf87 macrumors 65816


    Sep 10, 2003
    Sure! ps lists currently running processes. If you want to see all the flags you can send to it, you can open terminal and type:

    man ps

    The man pages state what the flags do, so I won't waste space here posting the entire man page. In essence, -auxwl lists, in a wide format, multiple columns of information about all processes running on the system, including ones you do not own. The -u and -l flags are what get you the multiple columns of information, -w lists it in wide format, and -a lists all processes.

    If the process is really out of control, use Activity Monitor or ps to get its process id and kill it:

    kill <process id>

    If it is stubborn:

    kill -9 <process id>

    The -9 tells the OS to kill the process and not worry about doing it gracefully.
  7. Makosuke macrumors 603

    Aug 15, 2001
    The Cool Part of CA, USA
    Don't forget that as of 10.3 Activity Monitor is also quite capable of displaying a hierarchical view of processes and their parents. I've found that an invaluable tool for tracking down the root cause of runaway sub-processes.

    Just select "All Processes, Hierarchically" from the pop-up in the top right corner of the Activity Monitor window, and follow the chain up from the problem process.
  8. JackRipper macrumors regular

    May 14, 2002
    Culpeper, Va
    Classic is probably to blame

    Everytime I start a classic app and then close it I get that null process that usually starts taking a small percentage of cpu but then eventually takes as much as it can.

    I tried to write a script that I could run in a cron to kill it automatically but was unable to get the ps command to show the process as null.

    I would just use the Activity Monitor to force quit (kill) the process.

    I hope Apple is aware of the bug and fixes it in the next release.
  9. pickles macrumors newbie

    Apr 25, 2003
    San Francisco
    Maybe this will help...

    I recently had the same problem on a Tangerine iMac, a Snow iBook and my TiBook, all running 10.3.2. After looking at Activity Monitor, my issue was with Finder hogging the processor. I saw that Finder had 4 threads running and one of them (null) was eating the proc. I force quit Finder and checked again and this time the Dock was going crazy. So, I trashed to prefs and force quit Finder and everything was fine. Once I started changing the prefs under the View options, I checked the Show Items box, the processor load shot to 100% again. I tried this several times and sure enough, it was that one feature (that I like, btw) that was hogging the proc.

    I don't know if this will help, but it worked for all of my machines.


Share This Page