I have a very annoying bug on my iMac 2019 (27", Retina 5K, i9, 8cores, Monterey, Radeon Pro Vega 8 Gb, 64GB Ram). It's likely caused by a hardware problem but also triggers a software bug I would try to mitigate.
Sometimes, and currently nearly everyday, my Mac becomes unresponsive, the fan gets stuck to 3600 rpm, and can stay so for hours.
This can be traced to the Mac trying to cool itself by launching a kernel_task process, which is a known strategy when CPUs are heating, devised to exclude other offending processes.
I've installed a some third-party utility and can reproduce the problem:
Quite at random (even in the middle of the night when the computer is asleep), a temperature sensor (named AC/DC T2 Sec HeatSink) would go in seconds from a normal room temperature to 70, 80 or even 125°. All other temp sensors show normal values (<40°) and no spikes.
Then kernel_task kicks in, usually around 1000 %, making the Mac unresponsive then the fan goes to maximum speed (3600 rpm).
After a while, sometimes in few seconds, the sensor usually comes back to normal by itself, and it also does so if I knock physically on the place where it is located (near the plug).
I've studied extensively console logs and could not find any specific process that would trigger this behaviour. I'am very inclined to think this is a hardware bug, and this is also Apple opinion, since I've already brought my Mac for repair for this reason twice, they changed the logic board, and it disappeared for a few monthes.
Remedies and workaround
I surely should go back to Apple now a third time, but I'm wondering if I could delay it, especially since they charged me the last time, for what I believe is a design fault. Last time they were not of great help in understanding the problem, telling me I had too much third-party memory and to go back to 8GB Apple.
Also I don't really want to upgrade my OS, since it would break some third party software again. For the record the problem was here on Catalina and Big Sur and upgrading the OS brought nothing as far as this bug is concerned (except from third-party obsolescence).
Currently, every time this happens, I knock on the Mac to bring the sensor back to normal value if needed, then I suspend activity (using Apple menu), wait for the time for it to happen, between a few seconds and a minute, then I wake up the Mac and all is back to normal.
Clearly there is also a software bug in the OS, since there is no process to cut kernel_task and bring back the fan to normal values when all temperatures are reported within normal operation range.
I don't know the root cause of the hardware bug. I provide some clues for the reader interest:
Have I damaged the sensor by unplugging live the Mac (this can happen unwillingly when you move the screen, the cord plug being stuck on the wall behind) ?
Is there some accumulated dust that produces a short-circuit and moves when I knock ? I can't clean it, the iMac can't be opened
Is there too many USB devices plugged and does this raise the energy needed, triggering the sensor (there is a loosely correlation with the activation of the USB DAC connected, but is also happen when it is not here) ? I plan to buy a self-powered usb hub, just in case.
Which brings me to the objective of this post and my question :
Could I stop the un-needed cooling process without suspending activity ?
There are some utilities that stop the fan but hey don't calm kernel_task, so this is of no use.
Trying to kill the kernel_task process seems a bad idea, as it is essential to the system.
There are obviously under-the-hood actions that cure the problem when activity suspension is triggered, so I wonder if I could reach the same result without loosing the minutes I currently loose because of the activity suspension.
Thanks for your inputs.