Go Back   The macosxhints Forums > OS X Help Requests > System



Reply
 
Thread Tools Rate Thread Display Modes
Old 12-31-2005, 08:21 AM   #1
NightHawk
Prospect
 
Join Date: Mar 2004
Location: Auburn, WA, USA
Posts: 4
High System CPU Usage

For some reason, when I look at the CPU usage graph in activity monitor, the %user is around 25% and the %system is around 70%.

And the system seems to be refusing to give up CPU time to other processes. (For example, games will only take up the ~25% user cpu usage, while the system cpu usage remains the same, which lags the application horribly).

But if I look at cpu usage by process, there's no explanation for the high cpu use.

I'm a little lost, any ideas on troubleshooting this?
__________________
To know recursion, you must first know recursion.
NightHawk is offline   Reply With Quote
Old 12-31-2005, 09:47 AM   #2
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 31,957
Make sure you have Activity Monitor set to show "All Processes".
hayne is offline   Reply With Quote
Old 12-31-2005, 09:59 AM   #3
TrumpetPower!
Major Leaguer
 
Join Date: Dec 2005
Location: Tempe, AZ
Posts: 276
If you would, kindly open up Terminal, paste this in:

Code:
cd; top -l 1 -o cpu > processes.txt
and then post the contents of the file, ``processes.txt,'' that you'll find in your home directory.

Cheers,

b&

PS Do be sure to do a copy / paste of that code, to avoid confusion over ones and ells. b&
TrumpetPower! is offline   Reply With Quote
Old 12-31-2005, 10:05 AM   #4
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 31,957
Quote:
Originally Posted by TrumpetPower!
Code:
cd; top -l 1 -o cpu > processes.txt

That should be 'top -l 2 -o cpu' since there seems to be a bug in 'top' that makes the first iteration show all processes with 0% CPU.
hayne is offline   Reply With Quote
Old 12-31-2005, 03:19 PM   #5
TrumpetPower!
Major Leaguer
 
Join Date: Dec 2005
Location: Tempe, AZ
Posts: 276
Quote:
Originally Posted by hayne
That should be 'top -l 2 -o cpu' since there seems to be a bug in 'top' that makes the first iteration show all processes with 0% CPU.

Ouch--you're right! Nasty. Of course, I just looked at the end of the output, where anything other than a bunch of items with 0% would be suspicious....

Has anybody told Apple? Any C hackers with the Darwin source who would want to send a patch?

Cheers,

b&
TrumpetPower! is offline   Reply With Quote
Old 12-31-2005, 03:24 PM   #6
NightHawk
Prospect
 
Join Date: Mar 2004
Location: Auburn, WA, USA
Posts: 4
Here's the result of that (well, the second iteration, because as was noted, the first iteration showed all processes with 0% cpu).

In any case, you can see what I mean,

Code:
CPU usage:  24.0% user, 76.0% sys, 0.0% idle
Top isn't showing anything using up that much cpu time, but its getting used, and affecting programs in user space (anything i run, essentially)

Code:
Processes:  57 total, 5 running, 52 sleeping... 176 threads            13:19:12
Load Avg:  5.17, 5.33, 5.30     CPU usage:  24.0% user, 76.0% sys, 0.0% idle
SharedLibs: num =  163, resident = 37.5M code, 4.54M data, 8.93M LinkEdit
MemRegions: num =  6572, resident = 92.9M + 10.0M private, 70.9M shared
PhysMem:   108M wired,  103M active,  232M inactive,  444M used, 1.07G free
VM: 5.05G +  118M   18411(3) pageins, 0(0) pageouts

  PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE 
    1 launchd      6.8% 33:43.71   3   255    22   244K   380K   516K  27.7M 
 5191 top          4.3%  0:00.17   1    19    21   232K+  392K+  684K+ 27.0M+
27029 Activity M   2.5%  0:03.44   2    75   182  4.23M+ 14.7M- 13.2M-  171M-
    0 kernel_tas   1.6%  6:30.50  41     2  2381  21.5M+    0K  81.6M- 1.20G-
  909 lookupd      1.6%  6:48.01   2    34    38   580K  1012K  1.34M  28.5M 
27061 pmTool       1.0%  0:00.95   1    23    24   396K  1.09M  1.06M  36.5M 
 3582 mds          0.7%  3:18.55   7    86    63  2.90M+ 1.98M  4.29M+ 42.2M 
  688 WindowServ   0.7%  0:35.80   2   182   295  2.93M- 19.8M+ 20.5M   208M 
 4211 SystemUISe   0.1%  0:38.01   1   103   132  2.12M  8.30M  5.15M   156M 
 4301 USBOverdri   0.0%  0:19.36   1    63    83   616K  2.85M  1.81M   139M 
 3136 Terminal     0.0%  0:00.58   4    91   165  2.55M  12.7M  8.81M   168M 
 4212 Finder       0.0%  0:00.75   3    99   154  2.61M  12.7M  7.54M   168M 
 1183 coreservic   0.0%  0:01.85   3    98   102   936K  12.7M  3.19M  34.4M 
 3595 ATSServer    0.0%  0:00.54   2    86    94   880K  4.87M  3.34M  69.2M 
 1142 ntpd         0.0%  0:02.00   1    11    19   164K   524K   376K  26.9M 
 7281 mdimport     0.0%  0:00.30   4    63    55   932K  5.24M  3.16M  40.1M 
   49 notifyd      0.0%  0:00.34   2    62    21   184K   360K   464K  27.2M 
   42 mDNSRespon   0.0%  0:00.71   3    32    26   284K  1012K  1.04M  27.9M 
 3630 httpd        0.0%  0:01.15   1    12   133    40K  7.73M  4.24M  64.4M 
10574 Adium        0.0%  0:14.20   5   136   283  7.77M  16.2M  15.9M   184M 
11628 ocspd        0.0%  0:00.45   2    28    26   560K  1008K  1.39M  27.6M 
10609 Safari       0.0%  0:09.68   6   128   265  9.60M  21.9M  24.6M   186M 
 4685 ssh-agent    0.0%  0:00.00   1     8    18   144K   368K   292K  26.7M 
 4315 Synergy      0.0%  0:00.73   4   106   195  3.78M  11.3M  8.30M   178M 
 4305 SSHKeychai   0.0%  0:00.80   8   123   172  3.30M  10.2M  7.77M   167M 
 4302 Quicksilve   0.0%  0:05.82   3   106   269  7.62M  14.6M  15.9M   176M 
 4300 iCalAlarmS   0.0%  0:00.24   1    63    85   920K  5.56M  3.00M   144M 
 4299 iTunesHelp   0.0%  0:00.05   1    52    71   540K  2.20M  1.69M   138M 
 4298 GrowlHelpe   0.0%  0:03.82   1    64   111  2.88M  5.75M  4.41M   145M 
 4168 Dock         0.0%  0:00.70   2   112   119  1.04M  13.9M  3.78M   161M 
 4103 pbs          0.0%  0:00.56   2    40    41   880K  5.25M  2.00M  55.0M 
 3727 httpd        0.0%  0:00.00   1    11   133    96K  7.73M   512K  56.4M 
 3618 loginwindo   0.0%  0:00.53   3   121   102  1.94M  6.49M  3.88M   131M 
 3576 DeviceHelp   0.0%  0:00.27   2   112    40   520K   892K  1.41M  28.9M 
 3346 crashrepor   0.0%  0:00.00   1    17    18   120K   328K   200K  26.6M 
 3209 bash         0.0%  0:00.03   1    14    17   228K   840K   868K  27.2M 
 3178 login        0.0%  0:00.01   1    16    36   148K   408K   592K  26.9M 
 1256 automount    0.0%  0:00.02   3    41    30   308K   920K  1.05M  28.7M 
 1181 automount    0.0%  0:00.17   5    78    40   400K   944K  1.22M  29.6M 
 1168 rpc.lockd    0.0%  0:00.00   1    10    17    64K   396K   196K  26.7M 
 1159 nfsiod       0.0%  0:00.00   5    30    25   128K   320K   188K  28.6M 
   86 mysqld       0.0%  0:02.07   9    42    53  11.0M  2.54M  12.6M  60.1M 
   58 distnoted    0.0%  0:00.32   1    45    20   260K   748K   816K  27.0M 
   57 DirectoryS   0.0%  0:00.60   4    82    46   712K  2.08M  1.34M  30.9M 
   53 update       0.0%  0:12.05   1    14    18   128K   324K   224K  26.6M 
   45 cron         0.0%  0:00.04   1    15    21   136K   352K   524K  26.9M 
   44 syslogd      0.0%  0:00.25   1    15    19   148K   352K   420K  26.7M 
   43 netinfod     0.0%  0:01.28   1    14    22   196K   468K   580K  27.0M 
   41 KernelEven   0.0%  0:00.03   2    22    23   224K   348K   620K  27.2M 
   40 sh           0.0%  0:00.02   1    14    17   160K   780K   676K  27.2M 
   38 securityd    0.0%  0:00.25   1   115    27   592K  1.17M  1.56M  28.5M 
   37 memberd      0.0%  0:00.02   3    22    24   244K   356K   628K  27.7M 
   36 diskarbitr   0.0%  0:00.30   1   110    22   400K   852K  1.06M  27.1M 
   35 coreaudiod   0.0%  0:00.26   1   127    34   456K   856K  1.06M  28.2M 
   34 configd      0.0%  0:00.47   3   159    62   564K  1.56M  1.75M  29.2M 
   30 kextd        0.0%  0:01.37   2    19    22   664K   776K  1008K  27.6M 
   26 dynamic_pa   0.0%  0:00.00   1    12    19   128K   324K   168K  26.6M
__________________
To know recursion, you must first know recursion.
NightHawk is offline   Reply With Quote
Old 12-31-2005, 04:42 PM   #7
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 31,957
Hmm, it does seem like the process that is taking up the CPU is not showing up in 'top'.
And I note that your load average (shown as "Load Avg" in the 'top' output) is rather high as well - a load average of 5 is unusual.

It is also unusual to have 'launchd' taking that much CPU. Does 'launchd' show up in the 'top' results if you doit again?

I don't know what is happening but it certainly merits further investigation.
Another thing you could do is look at the output of the following command that gives a snapshot of the top CPU using processes. Repeat it several times and see if anything interesting shows up:

ps wwaxr -o pid,stat,%cpu,time,command | head -10

And I see that you are using a few 3rd-party utilities that might be affecting things (e.g. USBOverdrive, Synergy)
You should quit all such extra programs while troubleshooting.
Things like USBOverdrive install a kernel extension and so affect things at the low level. You might consider uninstalling this (and other 3rd-party system extensions - look in /System/Library/Extensions or run the command 'kextstat' to see what extensions are loaded.
You should restart your Mac after disabling the extensions.

But first, maybe just try restarting your Mac without changing anything to see if that makes the problem go away.
hayne is offline   Reply With Quote
Old 12-31-2005, 04:57 PM   #8
TrumpetPower!
Major Leaguer
 
Join Date: Dec 2005
Location: Tempe, AZ
Posts: 276
Quote:
Originally Posted by hayne
Hmm, it does seem like the process that is taking up the CPU is not showing up in 'top'.
And I note that your load average (shown as "Load Avg" in the 'top' output) is rather high as well - a load average of 5 is unusual.

My gut tells me that launchd is constantly re-spawning something over and over and over again. Wasn't there something about a problem with having launchd watch a folder or something like that?

Cheers,

b&
TrumpetPower! is offline   Reply With Quote
Old 12-31-2005, 05:07 PM   #9
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 31,957
I think TrumpetPower's hunch may be right.
I should have asked if you have installed any 'launchd' jobs or used a 3rd-party program that might have installed such jobs.
hayne is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 01:03 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.