Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Just recently I noticed my battery life having a pretty significant drop and the "kernel_task" process using quite a bit of CPU (a constant 1-6% on my 2.8ghz dual-core i7, 2010 MBP). Obviously I think the kernel_task's CPU usage is contributing to the battery drop and I need to find out why.

Searching Google, it seems kernel_task is OS X's version of Windows's "svchost.exe" - the notorious do-everything process that you can't ever truly debug, you have to just manually flip switches until one of them works.

Is there any way I can more easily get to the bottom of the out-of-control kernel_task activity? I haven't tried a reboot because if that does "fix" it, it doesn't really fix the underlying problem.

Activity Monitor shows the CPU usage. When I hit Inspect, it shows 77 threads, 2 ports, hours and hours of CPU time, Context Switches going up about 400 per second, and Mach Messages In and Out both going up at about 6,000 per second.

How can I somehow inspect or monitor this kernel_task process and figure out what's actually using all this power?

(note: my current suspects are the recent 10.6.7 update, Firefox update from 4 beta 10 to RC, or ScreenResX - these are all things I've done recently that I can think of)

share|improve this question
    
I would not describe kernel_task as out of control. Activity Monitor may be not the best utility for diagnoses in this area. In Console, add system log queries to help you identify the ways in which kernel task is used; then refine the opening question to one that may be more easily answered. –  Graham Perrin Mar 31 '12 at 8:07
    
Constant 200% CPU sounds pretty out of control for any process. –  Odin Oct 21 '12 at 3:27

7 Answers 7

Here is a great explanation what a kernel_task is. It could be drivers (kexts), network or disk activity. You cannot simply use Instruments to attach to the kernel_task process.

Look for other signs, like logs (Console.app), disk activity (for example: iotop fs_usage), network activity (try disconnecting from local network, turning off devices in network preferences), try to uninstall/remove from memory (kextunload) drivers, which are from third party - tablets, usb 3g modems and etc. Check for applications, that are installing kexts

Also make sure that your file system is not corrupted, if you had any crashes recently - do a check.

share|improve this answer
    
I had ~200% CPU usage (2 out of 4 cores) almost constantly, usually starting after a boot when transferring files or something similar, but not returning back to normal afterwards. The reason turned out to be that my system volume needed repairing. Once that was done, kernel_task was back to sane levels of activity. –  Daniel Beck Jun 24 '12 at 10:41
1  
The link in the answer is now dead –  Swader Apr 3 at 10:37
1  
@Santa Thanks for the suggested edit regarding the link, but there's no point removing the link when a version exists on the Wayback Machine. Replace link with link to Wayback Machine. –  grgarside May 2 at 19:21
    
@grgarside thanks for saving the link! –  mspasov May 6 at 10:02

As mentioned by @Christopher, heat can cause the kernel_task CPU to spike. The reason is listed in this post “Fixing” kernel_task CPU Problems in MacOS Lion 10.7. Apparently when the CPU heats up the ACPI_SMC_PlatformPlugin.kext will take up CPU cycles in an attempt to reduce actual CPU load.

So one solution is to cool down your Mac (e.g. fan) through an external fan or something like SMCFanControl.

The article give another solution which is to remove the sub-kext that triggers that behavior. Though I must admit I am personally not sure about how safe it is to turn that behavior off.

share|improve this answer
    
I am going to hazard a guess that this is the reason for the majority of kernel_task making sustained high CPU usage. Every time it happened for me, I am using my machine pretty heavily and it would start to lag, but none of the obvious processes I was using were causing the spike, just kernel_task. Shutdown the heavy processes (videos or games, usually) and eventually it goes away. Meanwhile my 2011 MBP sounds like it is going to lift off! Cracked it open and gave it a good clean, removed the dust blankets on the heatsinks and I was back in business with low fan and no kernel_task crazy. –  Joey T May 20 at 16:47

I'm on OSX Lion with a new 2011 macbook pro, and I recently had kernel_task running around 25-30% of CPU and my fan spinning at max for hours and hours. I tried one thing at a time and what solved it was... closing 5 or 6 windows in the Finder app. Can't say I understand why, but it was clearly that.

share|improve this answer
2  
Do you have any extensions to Finder installed? For example, programs that add something to the toolbar or the right-click (context) menu? –  Ricket Nov 26 '11 at 14:23
1  
This is because one or more of your windows have the "show all sizes" checkbox enabled in the 'View->Show View Options" configuration. Turn that off, then set as default for all folders and it will stop. –  Brian Topping Sep 14 '12 at 8:46

I had a massive spike in kernel_task CPU usage, and it turned out that my CPU fan was partially unplugged. kernel_task has something to do with the throttling of the CPU when it gets too hot. In your case, maybe your fan is just gummed up with junk and dust and needs to be cleaned out.

share|improve this answer
    
That's crazy! Did you ever check your logs when debugging this? How did you come to that solution? –  Ricket Mar 1 '12 at 15:41

On my Mac the CPU use of kernel_task is proportional to the internet bandwidth I use, ranging from about 0% to 50%. It's probably caused by the drivers for my Huawei 3G modem (HuaweiDataCardDriver.kext).

You could try disabling kernel extensions. There's no need to use kextunload: it's safe to just move the kext bundles from /System/Library/Extensions/ to some other folder and restart. You can use Consultant's Canary or kextstat | grep -v com.apple to list kernel extensions that didn't come with OS X.

share|improve this answer

I had the same problem in Yosemite but thanks to this good soul based on these another good fellow I could solve it. I still can't understand what happened, but after losing a whole weekend trying to work it out I just gave up and blindly follow his instructions. Look at my desperation in activity monitor:

All your cpu are belong to us

Be careful, always do a backup first and read the provided links for explanation. I take zero responsibility for any damage caused. You've been warned.

Find the model

$ system_profiler -detailLevel mini | grep "Model Identifier:"

Model Identifier: MacBookPro8,2

Move and backup the file

$ mkdir -p ~/backup

$ cd /System/Library/Extensions/IOPlatformPluginFamily.kext/Contents/PlugIns/ACPI_SMC_PlatformPlugin.kext/Contents/Resources

$ sudo mv MacBookPro8_2.plist ~/backup/

share|improve this answer

I had a similar question about how to identify files and programs connected to kernal_task using the following terminal command:

kextstat -l -k | awk '{n = sprintf("%d", $4); print n, $6}' | sort -n

This will display various kexts and the memory associated with them. For example, 6184960 com.apple.driver.AirPort.Brcm4360 is a big hog for me, but I can't do much about it if I want to use wifi.

One of the suggestions I received was to look up all non-Apple kexts are taking up memory by piping the above to grep -v com.apple. It's possible that some non-Apple programs are using up your resources. You should be able to remove those without breaking anything.

The age old solution of course is to restart your computer. Sometimes that's all it takes to set processes back to their normal levels of CPU usage.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.