How to find cause of high kernel_task cpu usage?

Occasionally my machine will have a kernel_task instance max out the CPU:

high kernel_task CPU usage

This can last from minutes to sometimes hours. The machine is effectively unusable in this state. Restarting doesn't help; a new kernel_task pops up again until it finishes whatever it's doing.

How can I find out what this process is doing?


TLDR; If your MacBook Pro runs hot or shows a high % CPU for the kernel task, try charging on the right and not on the left.


High kernel_task CPU Usage is due to high chassis temperature caused by charging. In particular Left Thunderbolt port usage.

Solutions include:

  • Move charging from the left to the right side. If you have a second charger then plug it in on the right side. Avoid plugging everything on the right side (see last paragraph below).
  • Unplug something from the left side. Either power or another accessory until the battery is full.
  • Force fans to max before plugging in. iStatMenus has an easy Sensors -> Fans menu item to do so. This only helps in marginal conditions.
  • Move to a cooler room.

Proof:

Actual CPU temperature or application CPU usage is uncorrelated with kernel_task. A hot CPU is throttled by reducing its clock speed, not by scheduling fake no-op load.

The graphs below are from iStatMenus. The machine had been used on battery then plugged in.

State A a USB-C hub (a mouse and keyboard, plus power) and a USB-C HDMI 2.0 adapter, both on the left side. You can see the Thunderbolt Left Proximity temperature sensor rise quickly. About 3-4 minutes later the dreaded kernel_task high CPU usage starts.

State B cures the kernel_task problem by moving power from the left ports to the right. The left side temperature drops and the kernel_task goes away within about 15 seconds.

This is causal. Moving power back to the left side, restoring State A, quickly restores the temperatures and kernel_task again comes back after 3-4 minutes. Again moving power back to the right side, restoring State B, resolves the problem immediately.

State C shows that simply having stuff plugged in to TB ports raises their temperature significantly. Both the hub (mouse and keyboard ONLY) and HDMI adapter individually raise the temperature about 10 degrees, and 15 degrees together.

CPU usage and temperature graphs

(all other temperatures were both low and flat. Under 55 degrees.)

Note that high temperature on the right side appears to be ignored by the OS. Plugging everything into the two right ports instead of the left raised the Right temperatures to over 100 degrees, without the fans coming on. No kernel_task either, but the machine becomes unusable from something throttling.

Ergo, high CPU usage by kernel_task is caused by high Thunderbolt Left Proximity temperature, which is caused by charging and having normal peripherals plugged in at the same time.

2017 15" Macbook Pro, MacOS 10.14.5


To actually answer the question:

How can I find out what this process is doing?

The only way to actually ask the kernel what it's doing is to attach a kernel debugger. That means getting a debug kernel from Apple, rebooting, then using a second Mac to attach to the debugged machine. You can then examine stack traces and guess what they mean.

Otherwise guessing and testing is the only way. Of course that leads to false conclusions more often than not.


Today I had this problem.

Interestingly, after changing the port I'd been using for charging the laptop and using a different port of the laptop, the CPU usage dropped:

enter image description here


If you're encountering this on Macbook Pro 16'' (2019), this seems to be a well-known problem regarding the laptop body not being able to handle the heat from both the CPU and GPU when external monitors are connected. The ultimate solution seems to be to use an eGPU... which would probably not be practical for most people.

An AMD Community thread further pointed out that the culprit is that the dGPU goes on full drive and draws ~20W of power whenever the laptop outputs to multiple monitors, seemingly because the driver lets the dGPU memory run on full clock speed "to avoid tearing". This quickly leads to the chassis overheating. Outputting to only one monitor (the count includes the built-in monitor), with no scaling or integer scaling of the resolution, seems to reduce the power usage to ~9W and thus mostly solve the issue.

From the sensor data, it seems that the trigger for the throttling were most likely the Thunderbolt Left/Right Proximity temperatures.

UPDATE: Now I still connect my MBP to multiple monitors (the dGPU draws ~20W), but I followed the advice from one comment and bought a small desktop fan to point at the MBP... The temperature seems to be mostly under control now and I don't get kernel_task kicking in most of the time. You'd think that you wouldn't need such a hack on the supposedly best laptop you can buy out there, though I guess there are no perfect laptops and I'd still rather stick with Macbook for now.

UPDATE 2: I finally had my eGPU set up and as expected, the MBP 16'' hasn't suffered from throttling yet since then. I guess you could still consider this as an option if all other alternatives fail. You don't need a fancy/expensive graphics card. I am driving one 4K display and 2 additional displays with an RX 580 without any issue.


As it persists for a very long time, and it persists across restarts, it seems likely that your problem is caused by a hardware problem - namely lack of cooling. You do not describe which type of computer you have, but try looking at its cooling to see if it's working as intended. You might have a broken fan, lots of dust or similar.

The kernel_task virtual process does, amongst other things, throttle CPU usage in order to keep the CPU below its maximum operating temperature. The purpose is to keep the CPU from shutting down unexpectedly. kernel_task does this by ensuring that the CPU is doing nothing for long periods of time - essentially making sure the CPU uses as little power as possible, which means that it gives off less heat. This makes it seem like kernel_task is using a lot of CPU, but in reality it is not.


For me this happens almost everytime I connect to an external monitor. The graphics switches to dedicated ones and the system starts to overheat in just under 5 min. Took me quite a while to figure this out. Room temperature is 27C so I don't think it's related to hot weather as well.

Funny thing is my 7 year old laptop still works fine under same conditions (even outperforms the MBP 2019).