Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bankshot

macrumors 65816
Original poster
Jan 23, 2003
1,368
425
Southern California
The other day I stumbled upon a bug that caused my CPU to run excessively and produce extra heat. If you see similar symptoms in Activity Monitor, you may be seeing the same thing. I don't have the same problem with my Power Mac G4 (also on Tiger 10.4.6), but maybe it's common on the Macbooks?? I'll try to be concise in my description so you can skip the rest of this if it doesn't apply to you. ;)

Starting the other day, my Macbook began using about half of all available CPU (1 full CPU out of two) constantly, causing a significant rise in temperature. The really strange thing was that the process list in Activity Monitor showed less than 10% of one CPU being utilized, or less than 5% of all available CPU. It was like a ghost was using my CPU! :eek:



To check for the same thing, open /Applications/Utilities/Activity Monitor. Set it to show All Processes and sort by the CPU column. Look at the CPU tab along the bottom and check the reported CPU usage versus what you see in the CPU column above. If yours looks like mine, maybe you have the same issue. In the screen shot above, I have 5.8% of one CPU accounted for in the process list, but a total of 53% of both (106% of one) used in total.

This happened shortly after installing a few updates, including QuickTime 7.1.1, Developer Tools 2.3, CoreDuoTemp, and Parallels RC2. I tried uninstalling each of these (except the QuickTime update) with no luck. No matter how many times I rebooted, the CPU usage came back within 15-20 minutes. What could possibly be using CPU without showing up in the process list?? It made no sense.

Until it hit me that if dozens or hundreds of very short-lived processes were created and destroyed, any single one of those would never run long enough to show up. Aha! I used 'ps' from the command line to search for recent short lived processes, and sure enough there it was: nmbd kept getting restarted about a dozen times a second.

Here's where my Unix experience really pays off. I know that nmbd is part of Samba which provides Windows file sharing services for OS X.

Solution: In System Preferences, turn off Windows Sharing. CPU usage immediately went to near zero.

A perusal of the nmbd log (open /Applications/Utilities/Console, click on Logs, /var/log, samba, log.nmbd) confirms that nmbd keeps exiting because it can't bind to the right network port.



So now I'm armed with the info I need to send in a bug report to Apple. What's interesting is that launchd is responsible for starting nmbd. I believe that launchd is supposed to listen on the network port that nmbd wants, and therefore nmbd is not supposed to even try to open it. Not sure if it's a bug in launchd or nmbd then. However, even so, launchd should throttle back and wait (5, 10 seconds, a minute, whatever) when the process it's starting exits so quickly.

Anyone else see the same thing?
 

Cooknn

macrumors 68020
Aug 23, 2003
2,111
0
Fort Myers, FL
bankshot said:
A perusal of the nmbd log (open /Applications/Utilities/Console, click on Logs, /var/log, samba, log.nmbd) confirms that nmbd keeps exiting because it can't bind to the right network port.
Nice work bankshot. I was pretty familiar with samba and nmbd on an AIX box several years ago. I don't have Windows Sharing on my MacBook enabled so I don't have a log.nmbd, but am impressed with your find none the less ;)
 

benthewraith

macrumors 68040
May 27, 2006
3,140
143
Fort Lauderdale, FL
Cooknn said:
Nice work bankshot. I was pretty familiar with samba and nmbd on an AIX box several years ago. I don't have Windows Sharing on my MacBook enabled so I don't have a log.nmbd, but am impressed with your find none the less ;)

I wonder if this is also present in the Macbook Pro's. My experience with it is that it hasn't run hot while running Windows sharing. But computers are temperamental. ;)

The one thing I've noticed, and it's been mentioned before, is that the CPU whine doesn't run under Windows as it does under Mac.
 

Pressure

macrumors 603
May 30, 2006
5,182
1,545
Denmark
Indeed, I posted that solution here the other day. No one noticed of course but it should get some attention now with your thread ;)
 

Pressure

macrumors 603
May 30, 2006
5,182
1,545
Denmark
benthewraith said:
I wonder if this is also present in the Macbook Pro's. My experience with it is that it hasn't run hot while running Windows sharing. But computers are temperamental. ;)

The one thing I've noticed, and it's been mentioned before, is that the CPU whine doesn't run under Windows as it does under Mac.

It does if you install the latest updates for Windows. The whine that is . . .
 

benthewraith

macrumors 68040
May 27, 2006
3,140
143
Fort Lauderdale, FL
Pressure said:
It does if you install the latest updates for Windows. The whine that is . . .

Funny, cuz I did install them when I first set up the Dual boot and haven't been plagued with the issues....course Bluetooth works off and on. :S
 

bankshot

macrumors 65816
Original poster
Jan 23, 2003
1,368
425
Southern California
Pressure said:
Indeed, I posted that solution here the other day. No none noticed of course but it should get some attention now with your thread ;)

Cool, the more the merrier. I really am curious as to how many people actually see this issue. I almost made this thread a poll, but even so it would probably be wildly inaccurate. ;)
 

MattyP

macrumors member
Dec 13, 2005
71
0
San Francisco
bankshot said:
So now I'm armed with the info I need to send in a bug report to Apple. What's interesting is that launchd is responsible for starting nmbd. I believe that launchd is supposed to listen on the network port that nmbd wants, and therefore nmbd is not supposed to even try to open it. Not sure if it's a bug in launchd or nmbd then. However, even so, launchd should throttle back and wait (5, 10 seconds, a minute, whatever) when the process it's starting exits so quickly.

Excellent sluething! Smart people are rad.
 

Pressure

macrumors 603
May 30, 2006
5,182
1,545
Denmark
benthewraith said:
Funny, cuz I did install them when I first set up the Dual boot and haven't been plagued with the issues....course Bluetooth works off and on. :S

When you have paired your MacBook Pro with another device through Bluetooth, the whine goes away.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.