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

复制代码
   <?xml version="1.0" encoding="UTF-8"?>
   <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
   <plist version="1.0">
   <dict>
       <key>Label</key>
       <string>com.user.disablethermald</string>
       <key>ProgramArguments</key>
       <array>
           <string>/bin/bash</string>
           <string>-c</string>
           <string>~/Scripts/disable_thermald.sh</string>
       </array>
       <key>RunAtLoad</key>
       <true/>
   </dict>
   </plist>

4.加载启动项

launchctl load ~/Library/LaunchAgents/com.user.disablethermald.plist

相关推荐
YuMiao4 小时前
gstatic连接问题导致Google Gemini / Studio页面乱码或图标缺失问题
服务器·网络协议
chlk1231 天前
Linux文件权限完全图解:读懂 ls -l 和 chmod 755 背后的秘密
linux·操作系统
舒一笑1 天前
Ubuntu系统安装CodeX出现问题
linux·后端
改一下配置文件1 天前
Ubuntu24.04安装NVIDIA驱动完整指南(含Secure Boot解决方案)
linux
碳基沙盒1 天前
OpenClaw 多 Agent 配置实战指南
运维
深紫色的三北六号2 天前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
linux·扩容·服务迁移
SudosuBash2 天前
[CS:APP 3e] 关于对 第 12 章 读/写者的一点思考和题解 (作业 12.19,12.20,12.21)
linux·并发·操作系统(os)
哈基咪怎么可能是AI2 天前
为什么我就想要「线性历史 + Signed Commits」GitHub 却把我当猴耍 🤬🎙️
linux·github
pe7er3 天前
macOS 应用无法打开(权限问题)解决方案
macos·mac
十日十行3 天前
Linux和window共享文件夹
linux