703

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?

Adam
  • 12,720
  • Woah, this just got much more interesting. Any chance we can get both snapshots updated a second time - same all process CPU sorted and the detailed power measure? – bmike Jul 01 '19 at 22:41
  • 8
    @bmike I managed to both reproduce the issue and fix it at will. iStatMenus graphs confirm, the cause in my case is high chassis temperature from charging and peripherals plugged in to the left TB ports. – Adam Jul 06 '19 at 01:42
  • 3
    Yes - that temperature sensor does have the ability to cause this precisely. Thanks for the edit - that helps clarify greatly the situation for the record. – bmike Jul 06 '19 at 13:12
  • If I recall I was told that the left port will pull more current for charging and that I could damage the laptop if charging from the right side. – Polygon Pusher Apr 23 '20 at 17:22
  • I see you have Docker running. I am curious whether you have some sort of polling going on in there that's causing the high CPU usage. For example, I had to turn off Django's dev watcher to get my CPU usage to drop back to normal (https://github.com/docker/for-mac/issues/1759#issuecomment-332754641). – Blake Petersen Apr 23 '20 at 18:55
  • 4
    Just for reference (not any fix or workaround), kernel_task (PID 0) is the kernel (i.e., heart of the OS) itself and the very first process after the macOS/iOS/tvOS/watchOS boot process. Several core features are done in the kernel, temperature control being one of them, and it seems it’s exactly that that is behaving badly. This process obviously can’t be killed without bringing the whole system down so it’s especially bad when something in it misbehaves. Apple mentions its temperature control feature here: https://support.apple.com/en-us/HT207359 – Constantino Tsarouhas Apr 24 '20 at 07:07
  • 1
    @BlakePetersen I went down that red herring at first too. The issue is unrelated to whether or not Docker is running, and frankly any other piece of software I could kill. – Adam Apr 25 '20 at 00:23
  • 2
    @ConstantinoTsarouhas that Apple link is patently wrong. The graphs below clearly show a kernel_task with very low CPU temperatures. High CPU temperature is fixed by throttling the CPU, not by kernel_task. – Adam Apr 25 '20 at 00:25
  • 1
    Adam is very correct - the general kernel task role to protect against Tjunction of 100C being exceeding is not in play here. It could be the same code base that’s misbehaving or it could be the rate of change is triggering this - not absolute temp. This will need to be reproduced in a lab setting, but Adam’s empirical evidence is overwhelming that it’s relating to power handling in his Mac. I haven’t seen anyone reproduce this either - it would be good to have a second answer documenting which model, which accessories can reproduce what Adam reports IMO. We tried and failed to reproduce this. – bmike Apr 26 '20 at 14:21
  • 1
    Oddly thought this was the norm. I have a bottom case that I usually have on. I took that off and it seemingly dropped off. Weird - but thanks! – John M Jul 07 '20 at 14:57
  • If you have an external monitor, just unplug the monitor. That was the main cause for me. kernel_task process was 925% CPU load and went down to 4.5% almost instantly. I've seen in some websites that there is some nasty bug related to connection to external devices, and its been there for a while. – Pedro Luz Apr 17 '21 at 11:13
  • 1
    The temperature in summers reach 40 degrees Celsius at my place, I was facing this issue whenever I connected an external monitor. I solved it by switching on the room AC. I can work without it but my MBP can't work without AC. – Zaraki Apr 30 '21 at 09:55
  • 1
    This happened to me today and I noticed the fans were not working. I installed Mac Fans Control, set it to full blast and boom... kernel_task dropped to 0. – Francisco Gutiérrez Nov 02 '21 at 09:36
  • 3
    Can't add an answer, so I will just comment, I tried every solution on the web, switching sides of power and monitors, using a dock, shutting down true tone, hardware acceleration, i basically wasn't able to use my 2019 macbook pro when connected to an external monitor, the only 2 things that worked for me were: 1) using macbook in clamshell mode, but you loose cam, mic, fingerprint, trackpad etc..., 2) and I CAN'T STRESS THIS ENOUGH, CLEAN YOUR FANS!! (by a pro or if you know what you're doing) then SMC reset, see my before and after pics here, https://i.imgur.com/ChgoGlj.jpg – bentael Mar 16 '22 at 21:14
  • 2
    I was having the same issue for years before I figured it out. I am already following everything said by Adam, and it works out well for both my 2015 MBPr and 2019 MBPr. This post gave more insights.

    @Zaraki's issue is same as mine. This is how it all started. Whenever I connect my Macbook to my TV, this happened and I got frustrated, changed thermal paste etc., nothing worked at the end of the day, until I figured it worked like a beast inside AC room.

    – Sibidharan Jun 14 '22 at 19:28

15 Answers15

957

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.
  • If using both laptop display and external display try switching to just one or the other (I switched to external only, laptop lid closed). Some MBP (eg 15" Intel touchbar models) have a design quirk where this config can get hotter than it should.

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.

Adam
  • 12,720
  • 26
    this exact problem has been plaguing me to the brink of insanity for months, and I've tried everything to stop it. Recently, rolling back to HS from Mojave "solved" it, but it came back tonight out of the blue a week later, with seemingly no event triggering it again. I've don't about 30 different steps that I've found in forums over probably 40 hours since starting to troubleshoot. A new user on the same system seems to start fresh, but inevitably the problem comes back. I too feel like it has something to do with power/thunderbolt/heat. – Ellis Edwards Jul 06 '19 at 03:04
  • 2
    For me it's not what you're doing with the machine, it's what's plugged in to it. Charging raises temperature by about 40 degrees, peripherals by about 15. For me kernel_task goes away when charging is done. Similarly using ports on both sides of the machine evens out the load and also solves the problem. – Adam Jul 06 '19 at 03:21
  • Does kernel task go away entirely for you after charging or does it still hang out with low % in activity monitor? – Ellis Edwards Jul 06 '19 at 04:56
  • Problem is for me, once Kernel_task and window server show up, NOTHING I can do will get rid of them or the bloat on the system. I used the system (and pushed it) for weeks and even on heavy use, kerneltask & windowserver didn't show up at all, until they did, and are stuck using 10-30% even after letting the system cool down and with nothing running. Etrecheck reports high I/O usage when those two processes are present, even on a cool, idle system.

    Do you have ANY thoughts on how to get those processes back in line once they are acting up? I'm pulling my hair out- this is a real nightmare!

    – Ellis Edwards Jul 06 '19 at 03:04
  • 3
    This really solved my problems! I wondered why it was doing it at home but not at work... I changed the side of my dock at home, and everything is normal again! The throttle seems to trigger at about 57ºC on the left side, good to know! – Eradash Oct 28 '19 at 02:44
  • 35
    Just found this answer after my brand new MacBook Pro 16" 'went nuts' on me with ridiculously high kernel_task CPU usage straight after reboot, every time. In my case I had an unofficial PSU (Anker) feeding a Lention C13 plugged in to a left hand side port on the MacBook. I'm now using the official PSU plugged in to the right hand side of the MacBook and all is fine again. Thanks for the help but, honestly, I'm gobsmacked that Apple's hardware and/or OS doesn't handle this better. – Quintin Willison Mar 11 '20 at 09:48
  • 1
    Whoa, yeah, this is happening for me with 2019 MBP 16 ... – vitriolix Mar 19 '20 at 01:24
  • 21
    Just wanted to note that this answer is slightly incorrect, while still hugely useful of course. This is ONE of the causes of high kernel_task CPU usage - not the only one. You can observe that on Macs without Thunderbolt ports for example or on Macs without a battery (I.e. no charging). It is incorrect that high CPU temperature is only corrected by throttling the frequency - Kernel_task will in fact schedule “no-ops” in order to make the CPU use less power in this case. – jksoegaard Mar 21 '20 at 12:31
  • 2
    @jksoegaard please provide some evidence that kernel_task can be caused by CPU usage or temperature. Otherwise it's a red herring that happens to sound plausible. I also wasted hours on that hypothesis because everyone kept presenting it (without evidence). Yes a CPU can control its own temperature on its own, primarily by controlling frequency. OS intervention by some undependable crude mechanism not required. This has been true for 15 years. You used to be able to fry a CPU by removing its cooler. That will no longer happen. – Adam Mar 21 '20 at 17:53
  • 1
    @jksoegaard the key takeaway is that the cause is high CHASSIS temperature. Charging is by far the largest contributor to chassis temperature in laptops. Comments here are the first time I hear of non-laptops suffering from this issue. Note the left/right split: charging on the right doesn't cause a kernel_task, I speculate because this code is old and all pre-TB laptops only charged on one side,. If the issue was truly CPU or something else then the charging side would have no effect. If you have a non-TB laptop with this issue I bet unplugging will also cure it. – Adam Mar 21 '20 at 17:58
  • 17
    @Adam It's not just some hypothesis that I have... I have read the actual kernel code for doing so. It's definitely not bullshit. I haven't said that it is "caused by CPU usage" - that's completely not true. It is however caused by TEMPERATURE. And yes, I know that a CPU can be throttled through frequency control - but this is something entirely different meant for an "out of the ordinary situation" (i.e. cooling failure). And yes, I know that CPUs automatically control their frequency and/or shutdown entirely when reaching their max Tjunction... that's a seperate mechanism. They have [...] – jksoegaard Mar 21 '20 at 20:13
  • 2
    similar safeguards for Tcase, which is what you have ran into here. Still temperature, but not CPU temperature. – jksoegaard Mar 21 '20 at 20:13
  • 2
    The left/right split sounds like a hardware error causing overheating on one side where that problem simply does not exist on the right side. I really doubt that it is caused by "old code" - the code in place does not regulate anything depending on "left side" or "right side" - that's entirely up to the IOPlatformPlugin, which is different for each type of architecture - i.e. not something that's really old and left over from legacy systems. – jksoegaard Mar 21 '20 at 20:16
  • 32
    If you're a developer, you can take a look at the kernel source code in kern/thread_info.h, here you'll find the that the flag "TH_FLAGS_GLOBAL_FORCED_IDLE", which means that the purpose of the thread is to force idleness. In kern/thread.h you'll find that the thread option for it is TH_OPT_GLOBAL_FORCED_IDLE, which is described as "Thread performs forced idle for thermal control". Actually starting this process is triggered in the PlatformPlugin - i.e. on a new Mac you'll be looking at the ACPI SMC Platform Plugin's "ForcedIdlePLimit". You can search your logs for "plimit" and "p-state" [...] – jksoegaard Mar 21 '20 at 20:54
  • 3
    to find messages relating to the SMC plimit. – jksoegaard Mar 21 '20 at 20:55
  • 9
    Depending on the version of macOS you're running, you can use the command "ioreg -l | grep ForcedIdle" to get a bit of information regarding the forced idle state. On Catalina I think you only get the "ForcedIdleTable", which defines the configuration. On older macOS version you also get the "ForcedIdlePLimit" attribute itself. Another interesting command is "ioreg -l | grep IdlePLimit". Here you will on older systems find "IdlePLimitRegistered". – jksoegaard Mar 21 '20 at 21:45
  • 4
    I also found this. The IT department thought I was crazy when I told them my macbook was slower when charging on the 'left side'. Turns out I was right. 2018 MBP – spuder Apr 22 '20 at 22:12
  • On Windows, using ThrottleStop to disable BD_PROCHOT fixes throttling-related frame skipping and regularly occurring (every 10s or so) frame freezes in games for me. TurboBoost may also play a role, but does not seem to fix common performance issues due to throttling when disabled. – DoctorPangloss Apr 23 '20 at 16:50
  • 9
    Note that you can get a good handle on what the kernel is doing without going through the hassle of using a kernel debugger: try spindump(8). It gathers kernel stack traces too. – saagarjha Apr 23 '20 at 17:05
  • 1
    Just buy a small desk fan and point at laptop. I have 4 monitors connected to MacBook 16, and use this fan otherwise I get kernel task and heating issues: https://www.amazon.de/dp/B07PDW6RZW/ref=cm_sw_r_cp_api_i_lebPEbBC8TVM4 – vaughan Apr 25 '20 at 10:31
  • 1
    I can totally confirm this technic I accidentally discovered it after getting a repair offer from Apple for 800 bucks. My recommendation don't buy Inte processorsl based computers is not only a problem with Macbooks, I have also an Intel NUC running Linux with similar thermo throttling issues (it uses an Intel mobile processor like my 2017 15' MacBook pro). Basically the problem is Intel design and thermal specifications. I haven't tried AMD but the final fix will come with future ARM based Macbooks until then refrain from buying Intel. – Vlax Apr 25 '20 at 14:54
  • I was experiencing the same problem, but not due to the charging cable. It was due to a Thunderbolt 3 to 2 adapter on the left hand side. Moving to the right made the fans calm down for the first time since I bought this brand new 16" MBP. – Jeremy Apr 27 '20 at 20:40
  • 1
    What do you do if you have a 2-port MBP or MBA? You cannot switch to right side ports, because there are none. Ideas? – iOSapps.de May 15 '20 at 15:25
  • @youngpilot provide more cooling – Adam May 16 '20 at 03:56
  • 1
    Can confirm this works on my MacBook Pro (15-inch, 2019) running macOS Catelina 10.15.3 – Bas van Dijk Jun 13 '20 at 07:51
  • I've been having this problem for the past couple of months on my MBP (older, 15-inch, Mid-2015). This model only has the one charge port (mag-safe), so I can't switch to another port sadly. I've been experimenting with this this afternoon. Rebooted machine, no applications running, but the kernel_task process is eating 500% CPU, for the past hour. Oddly enough, it seems to correlate with time of day (perhaps hotter in the afternoon?). Not sure. – spacemanjosh Jun 15 '20 at 22:53
  • It works! The fan stop within mins. Thank you! – Far Jangtrakool Jul 14 '20 at 16:50
  • can confirm that this works on Catalina 10.15.6 on a 2017 15" touchbar MBP – ghettosoak Jul 29 '20 at 14:22
  • @Adam How can I measure the thunderbolt port proximity sensor temperature? Is it part of the sensors covered by powermetrics or istats all or "intel power gadget'? – kossmoboleat Aug 22 '20 at 09:25
  • @kossmoboleat I used "iStat Menus". I don't know if there is a free tool to do the same. Would you mind trying out those two and report back? IIRC the Intel tool is for the CPU and I had no luck with it. – Adam Aug 22 '20 at 14:36
  • @Adam there's an open-source project called iStats (confusingly there's no relation as far as I can see). It doesn't describe which one is "Thunderbolt Left Proximity", that's why I asked. By comparing I figure it is TTLD for left and TTRD for right. Which seems consistent with this wiki's sensor codes: https://logi.wiki/index.php/SMC_Sensor_Codes – kossmoboleat Aug 25 '20 at 08:21
  • @kossmoboleat that sounds right. I have the first machine on that wiki's list, a MacBookPro14,3. I can't verify the numbers match because iStats doesn't want to install for me due to some Ruby header error that I'm not in the mood to debug. My guess is that the iStats Menus folks wrapped iStats into a useful UI and charged for it. I got a lot of value from their work so I didn't mind paying them a few bucks. – Adam Aug 25 '20 at 17:57
  • "Activity Monitor might show that a system process named kernel_task is using a large percentage of your CPU, and during this time you might notice more fan activity. One of the functions of kernel_task is to help manage CPU temperature by making the CPU less available to processes that are using it intensely." https://support.apple.com/en-us/HT207359 – henrique Oct 01 '20 at 19:23
  • 2
    @valcanaia everyone googling this problem sees that page. It's marketing BS. "one of the functions". What they fail to mention is that that particular function is very rare, if it happens at all. High CPU temperature is controlled by throttling CPU frequency. Also I specifically included CPU temperature in my plots so you can clearly see that they're not elevated when kernel_task is activated. – Adam Oct 01 '20 at 22:30
  • @Adam You demonstrate that kernel_task entry and exit from forced idle state correlates with temperature, which clearly explains how my MacBook Pro (15-inch Mid/Late 2007) gets into this kernel_task state. In my case the trick for getting back to normal is to put my CPU to sleep, wait for the Sleep Indicator Light to pulsate on and off slowly for a few cycles, and wake the CPU from sleep. Bingo, the the kernel_task percent CPU goes back near zero. – Christopher Haydock Jan 23 '21 at 20:58
  • Thank you for your answer and your proof. This was incredibly interesting. Literally I had my CPU fluctuating at 400-800%. I have my laptop closed with 2 monitors hooked up to it's thunderbolts. I was wondering, what in the world? Low and behold I have a box of wheat thins sitting right behind the fan of the laptop. When I came across this post and realized it was throttled because of heat, I took away the box from behind the computer and opened the window, literally 30 seconds later my kernel_task went back down to about 6%. Amazing. – Paul Carlton Feb 15 '21 at 19:13
  • I have the same problem @Adam. I will keep the charging on the right side. If I use a hun, should I put that on the left side then ? – seralouk Mar 12 '21 at 08:57
  • I've been struggling with similar issues since the upgrade to Big Sur. Recently I found out the problem was caused by "MacBook Pro not cooling down its CPU"... So I bought a laptop-cooler, and it worked fine with a cooled down CPU! I've published on medium about this – Yilmaz Guleryuz Apr 02 '21 at 10:18
  • Just to be sure, when you say "try charging on the right and not on the left" do you mean my right or the laptop's right when it's facing me? – RodrikTheReader Apr 07 '21 at 15:15
  • All the answers above, plus: Open your MacBook and have a look at the fans, they may require some cleaning. In my case I removed a good handful of dust from the fans and coolers with ant static towel and a pressurized air can. – mana Apr 23 '21 at 07:48
  • 1
    THANK YOU! Still happens with the 2019 Macbook Pro 16" running MacOS 10.15.7. I moved the charging cable to the right side and the process stopped within seconds; went from over >1000% to <18% – Rafe Jun 03 '21 at 00:05
  • 2
    "try charging on the right and not on the left" -- is this for real?!?! – ovi Jul 02 '21 at 15:22
  • I've been having this same trouble on my laptop. I had switched my power to the right side at one point, remembering this advice, but it actually caused the problem. It seems that even more important is keeping the power and other peripherals on separate sides of the computer, not having them both on the same side. – Nathan S. Jul 30 '21 at 15:21
  • @Adam I'm having the same issue but I'm not having heat issues. I have a mid 2012 Macbook Pro. The only new fact is that my battery is finishing is useful life (If I unplug the charger, my laptop turns off immediately) Could that be the cause of the kernel_task process running? – Alvaro Pedraza Aug 24 '21 at 02:23
  • 1
    I joined apple.stackexchange only to +1 you – crissal Sep 18 '21 at 20:17
  • 1
    An upvote arrow doesn't really convey the emoji I want to describe this hardware hack. – mhvelplund Nov 12 '21 at 14:10
  • 2
    So... does OSX actually communicate "your CPU is too hot" is any meaningful way, or is the rage-inducing CPU-throttling it? – tschumann Jan 17 '22 at 05:55
  • @tschumann read the answer again. The rage-inducing condition is NOT caused by the CPU getting too hot. It's caused by a different part of the laptop getting hot. – Adam Jan 25 '22 at 07:59
  • Has anyone literally just tried unplugging the power for a few seconds and plugging it back into the same port? Left vs right is kinda sus given the other potential solutions here. – Ryan Haney Jan 27 '22 at 07:13
  • 1
    Today I fixed this problem by pulling down the blinds so the sun was not directly shining on it – Hannele Mar 07 '22 at 16:39
  • And people pay big money for these....... – Luca De Nardi Jun 27 '22 at 09:36
  • 1
    Github link to source code: https://github.com/apple-oss-distributions/xnu/blob/e7776783b89a353188416a9a346c6cdb4928faad/osfmk/kern/thread.h#L314 – Antony Stubbs Aug 15 '22 at 15:36
  • I can confirm that that was the exact issue on my MBP 16' 2019. Actually only switching from one USBC on the right to the other solved the issue! kernel_task went from 1000% to 65% !!!! – aurawindsurfing May 26 '23 at 05:47
  • This just seems like a blatant design problem. For me, prior to Monterey / Ventura, 2K external displays had no issue. I even used 4K display here and there. Something about Ventura seemed to push it over the edge and now I see just plugging it into the charger gets Kernel_task over 1000% after a while and / or the external display. Left/right charging no difference. Any lawsuits about this? This didn't hit me until after my 3 yr warranty expired. – learning2learn Jun 23 '23 at 17:42
82

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

CoyBit
  • 929
  • 12
    What is the time scale of this chart? I assume it takes some time to observe the drop if you change port – Jacopofar Apr 26 '20 at 05:57
  • 31
    Immediately. Literally 2sec! – CoyBit Apr 26 '20 at 08:19
  • MacBook Pro Early 2015: I had this problem a few minutes ago. I was charging an iPhone Xs and the Kernel was going mad (As it normally does now and then). Then I remembered seeing a discussion about this on Hacker News a few days ago that linked to this page. So I've just unplugged the phone. Lo and behold, the CPU load has gone down exactly like in your image here. Crazy crazy. Who would have thought!? – lukik May 12 '20 at 16:08
  • Same situation here. I was charging the Mac via the left Thunderport port and a Promise Technology TD-300 Thunderbolt 3 Dock. Earlier today the Mac ground to a halt due to CPU usage by kernel_task as high as 6000% capacity. Finding this article I unplugged it from the left side and plugged it in via the right side and the CPU usage dropped to normal levels immediately. – cluther May 22 '20 at 02:42
  • 1
    Great for people with a proper mac with MagSafe – Julian F. Weinert Jan 26 '21 at 12:36
  • I was facing similar issue when using an external monitor. Before trying this, I had already spent INR 6000 on an original apple adapter. Didn't help.

    Just by switching ports of connecting the external display and charger, everything worked like a charm!

    – Mohit Kanwar Apr 29 '21 at 07:44
  • Same here! Thank you. https://i.imgur.com/htDvfWI.jpg – v1r00z May 16 '21 at 17:08
  • It seems like mine behaves normally if I use a regular Apple charger and not a dock with other stuff connected to it. – Sridhar Sarnobat Aug 18 '21 at 23:20
  • In my case I had everything connected to a hub (monitor, mouse, keyboard, charger) and the hub connected to the usb-c port. System CPU usage was at 70%, super slow. I just connected the power to a separate port (either left or right side, doesn't matter) and System CPU dropped to 6% instantly. Don't have the charger cable connected through the hub. That's all. – vovahost Oct 20 '21 at 13:51
  • You changed port from which side to which side? Left to RIght? – Rakib Dec 06 '22 at 16:38
82

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.

Update 3: Now I see some folks recommending limiting the CPU frequency with Turbo Boost Switcher. I didn't try it while I was using my MBP 16" since I already had the eGPU (BTW I'm now using ARM Macs where this problem is completely gone), but it might be worth checking out.

xji
  • 2,018
  • What was your eGPU setup? – arxpoetica Apr 18 '21 at 18:59
  • @arxpoetica https://egpu.io/ has pretty comprehensive guides. I bought the Mantiz Saturn as the enclosure, though I'm sure something like Razer Core would also be fine. Then I just bought an RX 580 as the graphics card and it works pretty well (the card doesn't need to be the newest model) – xji Apr 21 '21 at 16:35
  • 3
    It's really a shame that Macbook Pro 16" (2019) behaves like this, I was completely devastated when I read that the solution would be to buy an external GPU just to get the computer working normally with an external monitor. Then I found this video though and after I've installed Turbo Boost Switcher Pro my problem actually went away! Now I turn off Turbo Boost as soon as the computer gets a bit hot. Before that I had tried to put my Mac on a cooling pad, but that didn't help much... – Martin Odhelius Jun 01 '22 at 11:28
  • Thanks for the updates, turning off Turbo Boost solved this for me. I have Macbook Pro 16" (2019), connected to 4k monitor. Running web dev server triggered the kernel_task problem. After turning off Turbo Boost, CPU usage went down from 80-100% to 10-20% in less than 10 seconds. – JuroOravec May 24 '23 at 13:18
  • I can't get TurboBoost to reliably solve this but the information was appreciated. Trying to decide whether to get an eGPU or just give this MacBook to a friend who won't need 4K. Are any lawsuits pending about the 2019 MBP? – learning2learn Jun 23 '23 at 17:44
24

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.

jksoegaard
  • 77,783
  • 1
    You might be right that it's temperature related, but it's definitely not CPU temperature related. Your post made me enable iStat Menus' temperate sensor monitoring, and when this problem happened again the CPU was quite cool. See screenshot in edited OP. – Adam Jul 01 '19 at 22:02
  • If you start in Recovery mode, do you still have high kernel_task CPU "usage"? – jksoegaard Jul 01 '19 at 22:08
  • I anecdotally noticed that the kernel_task went away when the left thunderbolt temperature dropped below 70 degrees. I also noticed that plugging in a charger raises the temperature on the charging side by about 20-30 degrees. This means the effect is testable, and I'll confirm next time this problem happens. – Adam Jul 01 '19 at 22:08
  • I only tried recovery mode once and it made no difference. I haven't been able to reliably reproduce this. – Adam Jul 01 '19 at 22:09
  • "no difference" - does that mean that you also had high kernel_task usage there? – jksoegaard Jul 01 '19 at 22:10
  • that's right. similarly resetting SMC had no effect. – Adam Jul 01 '19 at 22:11
  • I had originally intended this post to mean "how to find out what kernel_task is doing", but I gather there is no way to just interrogate it. It seems everyone just works down a list of possibilities until they find the likely culprit? I mean the OS does this for a reason, does it not log that reason anywhere? – Adam Jul 01 '19 at 22:13
  • Sure, you can interrogate it - but it's just that it is usually easier to figure out the reason by simple reasoning like this than interrogating. In this case, it's temperature. – jksoegaard Jul 01 '19 at 22:19
  • Simple reasoning made me try about 20 things that collectively took many hours. Nobody has yet suggested charging as a possible cause. If you know how to interrogate it I would love to know how. – Adam Jul 01 '19 at 22:22
  • You're misinterpreting what I meant. I meant: kernel_task can use CPU for various reasons. You've now concluded that the reason for you is temperature. This has nothing to do with why the temperature is high - you cannot interrogate kernel_task to get that information. – jksoegaard Jul 01 '19 at 22:50
  • Try taking a look at this: https://www.davidschlachter.com/misc/kernel_task ... If you disable it, the kernel_task should stop using high CPU. Don't use this as a solution, but rather to be really sure that this is the correct reason. – jksoegaard Jul 01 '19 at 22:51
  • I understood correctly. Is there a way to ask it which of the various possible reasons is the one? Temperature could still be the 21st red herring. Of course it's not reasonable to have it tell me why it's hot, but it would be reasonable to have it tell me "i'm throttling because x is too high". – Adam Jul 01 '19 at 23:02
  • Disabling that kext doesn't help troubleshoot the issue, it only masks the problem if you're willing to take the risk that the throttling is unnecessary. That's true for the author of that post because they know why it's doing it. I don't. – Adam Jul 01 '19 at 23:04
  • No, you definitely misinterpreted what I meant - I know what I meant :-) Yes, you can definitely interrogate kernel_task if you want. You cannot however expect to interrogate it as to which component it is that is causing elevated temperature, or "why" the temperature is high. It doesn't have that information. – jksoegaard Jul 01 '19 at 23:05
  • Which is exactly what I wrote to you before - i.e. follow the blog post - it's NOT a solution, but rather a way to confirm the problem. This is really getting too long - better go to chat instead. – jksoegaard Jul 01 '19 at 23:05
  • "Yes, you can definitely interrogate kernel_task if you want." HOW? – Adam Jul 01 '19 at 23:06
20

This is most often due to thermal throttling.

A common issue is the voltage regulator modules (VRM) overheating which have no publicly accessible sensors to view.

Diagnosis

Run: sudo watch -d -t -n1 thermal levels

When CPU > 100, you are being thermally throttled. You should keep an eye on this as you try to solve your issues.

Run: sudo powermetrics --samplers smc |grep -i "CPU die temperature"

This shows your CPU temperature. If it is < 100C, its your VRM causing it.

What is your ambient room temperature? >24C and you will start struggling to cool it adequately using any means.

You can observe throttling visually by installing the Intel Power Gadget.

Fixes

Non-invasive

  • Disable TurboBoost using Turbo Boost Switcher
  • Buy small desk fan and point at laptop
  • Elevate laptop on a laptop stand like the CoolerMaster U150R
  • Use air-conditioning to reduce room temperature
  • Sleep your laptop until the temperatures are reduced. Check thermal levels to confirm.

Invasive

Also, don't place ice bricks under the laptop - this can cause condensation and break things.

vaughan
  • 1,681
  • As far as I know, the kernel is only a software component which is located in /System/Library/kernels/kernel and is an interface between the hardware and software and conducts communication. - But how can a software component communicate more when a hardware module is usually hot and doesn't even have sensors.

    The only thing that would seem logical to me if the fans were turning faster.

    Any ideas? Thanks for the answer

    – BabyBoy Jun 17 '21 at 06:06
  • Thanks! Disabling Turbo Boost fixed it for me. – Brandon Minnick Jun 17 '21 at 18:50
  • 1
    @DarwinOSX I think what the OP meant is that the sensors are not publicly accessible, but are there and can be accessed via other means? – xji Jun 22 '21 at 14:49
  • Funnily enough a colleague of mine suggested Turbo Boost Switcher today, I suggested that he add the answer to this question, and I see that you posted this detailed answer just a week ago. Surprised that nobody posted this earlier. If I saw this solution, I might not have needed to go down the eGPU route :) – xji Jun 22 '21 at 14:55
  • 3
    When im using command "sudo watch -d -t -n1 thermal levels" then i get output on terminal: "sudo: watch: command not found" – Paweł Kanarek Oct 14 '21 at 09:46
  • 1
    @PawełKanarek brew install watch. Or just omit it. Run sudo thermal levels. – vaughan Oct 14 '21 at 21:42
  • @vaughan, thanks, so this is basically the same info as i get from sudo powermetrics --samplers smc, and it says CPU Thermal level: 134 when im starting build my app... I'll clean my fans – Paweł Kanarek Oct 18 '21 at 10:42
  • In my case it was two external SSD's that caused the issue. One for Time Machine and one for projects.

    2019 mac book pro

    Left side: Power and ethernet

    Right side J5 dock: 2 HDMI, wireless keyboard/mouse, usb hub ( this had the 2 external drives on it.

    kernel_task is now down to 2.2% was 45+

    – boyd4715 Jan 18 '22 at 19:59
18

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).

  • 4
    27C is very hot. I would say it’s definitely related to temperature. Buy a desk fan. – vaughan Apr 25 '20 at 10:27
  • 6
    @vaughn Not really very hot, warm. The old saying "10 is cold, 20 is not; 30 is warm, 40 is hot." That said, 35C is the upper end of operating temperature and 27C is pushing that; so a fan is a good idea! – bishop May 23 '20 at 02:26
  • 1
    There is definitely a link between ambient temperature and the mac book pro overheating when connected to an external screen. A few minutes after connecting the external screen, welcome kernel_task ! This is occurring on a Mac Book Pro End 2018 15" i9 6 cores + Samsung external screen (nothing else plugged in). I tried both connecting to the left and the right sides of the Mac book / rebooting / SMC / NVRAM/PRAM, same issue. I had the problem in May (which was around 27°C-30°) then no problem for a few days (ambient temperature had dropped 10°C) then again now (two days at 30°C). – yann-h Jun 25 '20 at 22:48
  • This problem drove me crazy until I decided to put my laptop in the fridge for 15 minutes. The problem went away, so the problem was definitely temperature related. – Trace Jun 13 '23 at 12:08
11

It’s usually temperature. Buy a small desk fan and point it at your MacBook rear. I used to have this problem and since using a fan it never happens.

EDIT: See my other answer

vaughan
  • 1,681
  • 56
    I don't think we expeected to do it on a 3000$ laptop :) – Stas Jun 18 '20 at 10:51
  • 3
    Me neither! I maxed out the specs on my 2018 Macbook Pro which I thought would give me the processing power I need and save me from having to buy a new one for many years, but it seems the chassis is too thin and tightly packed to handle heavy use without getting really hot and then kernel_task having to slow everthing down to stop it overheating! – drkvogel Jun 26 '20 at 08:55
  • 1
    I've heard that it sometimes helps cleaning inside of the MBP from the dust. Models 2012+ are eligible for a free battery exchange at Apple store, going to try it out and ask them to clean the dust out as well. Will see, it that helps with overheating at "not so hot" temperatures. – Sergey Shcherbakov Aug 10 '20 at 15:45
  • @SergeyShcherbakov did the dusting help? – tim-phillips Aug 26 '21 at 21:51
  • They replaced everything except motherboard and disk for free. Meanwhile, I’ve got the latest MPB (before M1) from my company and a new monitor as well. With this new setup I’m not experiencing the issue with attached monitor. – Sergey Shcherbakov Aug 26 '21 at 21:56
  • But the new MBP overheats as well when working at room temperatures above 30C. – Sergey Shcherbakov Aug 26 '21 at 21:57
10

I'll just leave this here in case it helps someone else:

For me, the issue went away when I switched to a charger with higher watt capacity. I accidentally had been running with a 15W charger instead of 87W. This caused the charging to be prolonged, heating up the whole computer.

jonahe
  • 311
6

First measure the temperature around the Mac and then see if cooler air reduces this.

In your case, Skype and Firefox are getting all the cycles left over due to running hot. Windowserver and kernel just do the bidding of the other programs. Also, for a longer term view of what the CPU is doing, watch the energy tab in activity monitor.

By closing the apps that take CPU, you can “let the system run cool”. Running like this won’t hurt things, just there are thermal limits so more efficient apps or less demanding tabs / video / content lets you get more work done before the system protects itself.

Also on Catalina, you can see actual GPU usage in Activity Monitor and test changes to browser settings if you think GPU is putting the machine into thermal throttling states.

bmike
  • 235,889
  • 2
    The CPU temperature is quite low when this problem happens. If anything, it might be due to chassis temperature, in my case hot thunderbolt ports due to charging. If that's true then apple should have throttled charging not the CPU. – Adam Jul 01 '19 at 22:04
  • You’re right. This isn’t the most obvious case and I’ll need to ponder the new data. Excellent edits @Adam I wonder if your circuitry is out of Spec if Apple runs diagnostics or this is just in spec (but unwanted) head generation from the power running through the power and data ASIC. – bmike Jul 01 '19 at 22:39
5

Macbook pro 15" 2018, I have a usb c adapter (7 in 1) 2 monitors, and 2 external usb hdd, the adapter on right side and on the left only charging, I have a few months that I can't work in multitask only a few apps and the macbook just starts burning out extremely, I discover this kernel_task service going to thousands!! on percent column on the activity monitor, after play around connecting on different ports (hdmi, usbc and the dock) the kernel_task just go back to normally!!! my working configuration was move the charger to the right side and one of the monitor cables to the left, so on the left I just have a usbc-hdmi cable and on the right side I have the dock with 2 usb ports used along with the hdmi for the second monitor and the charger, great testing Adam!!

rome3ro
  • 71
  • 1
  • 1
3

Running spindump and or sample process from the activity monitor may help provide you with more information about what’s going on. Try to keep notice of when the CPU usage climbs and then look at the CPU Time on the other items listed in activity Monitor. You may notice a certain process starting up around the same time. Looking into threads in/out can help diagnose too. The issue could be either a bug within the kernel itself or whatever is requesting CPU time. It’s okay to have the CPU jump up every now and then if you don’t notice any system performance or temperature issues. Macs are built with their CPUs to withstand very high temps.

If you download a lot of apps the Launch Daemons, Launch Agents, and startup apps can add up quickly, possibly consuming CPU. It seems your system is having a lot of wake ups. Something could be hung up? You could also run “top” and “lsof” to get an idea of what the kernel is talking to. Also opening console and checking out the logs for any repeating errors helps. Testing a new user account will isolate any user related issues.

Look at you kernel panics and logs to see if there any reoccurring issues.
Make sure your fan starts spinning up when the computer gets warm. If not it could be a SMC issue. You can download software to control the speed of the fans to see if it reduces the CPU %.

The instruments app that comes with Xcode has some debugging and tracking features that also can help.

Theologin
  • 530
  • 2
  • 7
3

I own a MacBook Pro (15-inch, 2016). The theory given in accepted answer is correct that the cause of high cpu usage by kernel_task is due to the fact that you are plugging the charger in sockets at left. Using sockets at right immediately fixes the problem and the cpu usage for kernel_task dropped as well. However following are my findings,

  1. The problem did not occur till the MacOS Catalina update. The charging from left as well as right was fine on High Sierra and Catalina in my experience. I hope that Big Sur will acknowledge the problem and possibly fix it. You can try downgrading the OS and see if it fixes the problem.

  2. I recently replaced 3 year old stock thermal paste with Thermal Grizzly's Kyronaut and cleaned the dust accumulated over years with an anti-static brush. The results are amazing. I am no longer facing the over cpu utilisation by kernel_task while charging from either side. The fans are at 2000(ish)RPM on idle whereas it was 2600(ish)RPM.

I would really recommend the second option as it is much easier, cheap and doesn't incorporates any risk of any kind.

  • The plots in the accepted answer were made on 10.14 Mojave so it's not a problem unique to 10.15 Catalina. – Adam Oct 19 '20 at 17:40
  • @Adam No one really knows the cause of the problem. I believe since we all got our shiny new MBPs the left ports were as good as the right ones. I just shared my experience around the same problem. I could very well be wrong though and might have been lucky when cleaning dust off my old MBP. I might need some more people to test the theory in point 2 and see if this fixes the problem. – Arun Chaudhary Oct 20 '20 at 04:58
  • 1
    Dropping in to say that moving the charger port to the right fixed the issue. I was experiencing extremely high kernel_task (new MBP2019). The fans would stay running all night while in clamshell mode and no applications running, powermetrics showed 80C fans at 2900rpm. I'm wondering if the high current through whichever USB-C port it is plugged into impacts the thermal properties. – Freeman Nov 27 '20 at 18:31
2

Edit: Please read through the post as to how I came to the solution, since the underlying factors of how I experienced the slowdown and found the solution are also important, especially to those with similar setups. This is not a lengthy "I have this problem too" comment, since though I do have the same kernel_task issue, the conditions of how I was having it as well as my setup are NOT the same as most here.


I've been having this problem on occasion back then with my previous MBP152011 (yes, the one with the nasty GPU issue) which slowed down while charging. A battery replacement kind of fixed the problem, but, with the GPU issue, it wasn't really long after that I had to replace it. It did serve me well for more than seven years (5 years original Motherboard GPU + 2 year replaced motherboard).

I got a second-hand MBP 15 2014 in 2018, which was in pristine condition. The previous owner is a photographer and he hasn't really used the MBP when he sold it to me.

It had a few issues, specifically, a busted speaker, which I do not really mind, and a USB port that's very choosy when it comes to USB hubs, but I finally found one that works well enough.

Now, after two years of using it, it was scheduled for a battery replacement since the battery started to bloat. I was able to use the Thunderbolt ports with no issue, but I was using the one farther from the charging port ever since I got second external monitor. The first external monitor has always been connected to the HDMI port, which was on the right side.

I started getting the slowdown (kernel_task cpu overload) before the battery replacement, so I thought that that had something to do with it, and replacing the battery, and an SMC reset would fix it.

It didn't. I get a massive CPU slowdown while the MBP was charging, often between 40-80% charge, but sometimes, even beyond that. I don't have any other third party apps installed that shows in Activity Monitor or Stats, so I was already down to the last resort: Backup, reformat, reinstall.

I'm still on Catalina, I've been holding off on Big Sur since I don't really need the nifty new features to get by.

I may also have a faulty GPU, as the display starts to get wonky on certain zoom settings whenever I use Adobe Illustrator, and switching to CPU display fixes that issue.

After reading through the comments and responses here, mostly about using right port for charging instead of the left ports, that heat from charging affects the other port and thus also heats up the port, and by extension, the GPU. After installing stats, I noticed that my MBPs CPU diode is at 90° even after a cold start, with the fans sometimes whirring at full speed, meaning it didn't wake up from sleep. I now shutdown after every session instead of putting the sleep to preserve the battery, and I religiously follow the 40-80% as much as I can, but with the slowdown issue during charging, I often leave it plugged-in when I'm in Zoom teaching sessions (with OBS), and unplug it after a while.

But, since I'm using an older MBP with both TB ports on the left next to the charging port, I'm out of other solutions except the last resort of backing it up, reformatting and reinstalling.

As a last ditch effort, something lit up (in my head), and I switched TB ports, using the one closer to the charging port. I know that counter-intuitive based on the comments, since the charger connection itself does heat up as well when connected.

The result? The kernel_task cpu overload disappeared. I launched Illustrator, Zoom, OBS, VLC, Viber, Slack, along with power hungry Firefox and Safari, observing the kernel_status in Activity Monitor, and the temperatures and fans in Stats, and the temperatures were a breezy 70° with the fans at roughly 3000rpm

I suppose the Thunderbolt port I have been using frequently has started to malfunction, causing the chassis to heat up, and since it's directly connected to the GPU, heats that up as well. So I guess in some cases, it has to do with faulty ports as well. That TB port has been well-used, more often than the other, so it has probably gone wonky for a while now when the slow down started.

Additional information: The charging port and the charging connector also heats up quite significantly during charging and can cause the TB ports to malfunction. Cleaning the ports and charging pins can help quite a lot, but if the pins have started to wear down, or don't pop-up anymore, this causes electricity to arc, heating the charging port a lot more. You will have to purchase a new charger.

XanderX
  • 31
  • 3
    Thjis answer would be better if the last 3 paragraphs were cut down and put at the top. This site looks for good answers not discussions. Most of this answer is not needed and readers will not get to the useful part at the end as it just looks like a long winded attempt of saying I have this problem too. – mmmmmm Oct 21 '21 at 14:04
  • 1
    That's the problem with some people. They just want the solution, and don't bother with how the solution was came upon.

    The art of reading is lost amongst people like you. You complain because I have a lengthy narrative.

    – XanderX Oct 22 '21 at 01:24
  • 2
    This is site for a uestions and answers not discourse the art of writing is to make things understandable – mmmmmm Oct 22 '21 at 12:16
  • 1
    I appreciate the detail, as it can help debug this issue further. – Brett Jackson Oct 27 '21 at 20:03
  • 1
    I always choose the long artistic read about thunderbolt ports over the one with a clear and to the point solution. sarcasm lol – quemeful Feb 17 '22 at 15:09
0

In my case switching the port of the external display helped only for a minute. I've noticed that my laptop battery was very low, the battery was reported as plugged in the power socket but didn't actually charge probably because the socket was malfunctioning. After plugging in my charging cable to the working power socket the problem went away.

chingis
  • 391
0

I had the same issue for a while I tried everything. The simple solution for me was to just clean my fans. There was a lot of dust!