Mac OS系统下kernel_task占用大量CPU资源导致系统卡顿
CPU负载突然飙升,如截图:
根本原因,大家从各种博主上已知晓,现在提供自己的解决办法,亲测有效
一、设置开机自动禁用温度管理守护进程
1.创建脚本文件
mkdir -p ~/Scripts
touch ~/Scripts/disable_thermald.sh
chmod +x ~/Scripts/disable_thermald.sh
2.编辑脚本内容
vim ~/Scripts/disable_thermald.sh
#!/bin/bash
# 等待30秒,确保系统完全启动
sleep 30
# 禁用温度管理守护进程
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.thermald.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.thermalmonitord.plist
# 可选:记录日志
echo "$(date): 已禁用温度管理守护进程" >> ~/Scripts/thermald_log.txt
3.创建启动项plist文件
touch ~/Library/LaunchAgents/com.user.disablethermald.plist
Label
com.user.disablethermald
ProgramArguments
/bin/bash
-c
~/Scripts/disable_thermald.sh
RunAtLoad
4.加载启动项
launchctl load ~/Library/LaunchAgents/com.user.disablethermald.plist