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

相关推荐
cxr8285 小时前
自动化知识工作AI代理的工程与产品实现
运维·人工智能·自动化
·云扬·5 小时前
从零开始搭 Linux 环境:VMware 下 CentOS 7 的安装与配置全流程(附图解)
linux·运维·centos
2501_927539305 小时前
EndNote 2025 Mac 文献管理工具
macos·mac·文献管理
晓梦.7 小时前
IPSec 安全基础
服务器·网络·安全
btyzadt8 小时前
虚拟机蓝屏问题排查与解决
linux·运维·网络
小李独爱秋9 小时前
UNIX发展历史与核心技术解析
服务器·操作系统·unix
佩佩(@ 。 @)9 小时前
网络编程-创建TCP协议服务器
服务器·网络·tcp/ip
蓝黑20209 小时前
阿里云ECS服务器搭建ThinkPHP环境
服务器·阿里云·thinkphp
G_H_S_3_9 小时前
【网络运维】Shell 脚本编程:while 循环与 until 循环
linux·运维·网络·shell
张鱼小丸子10 小时前
MySQL企业级部署与高可用实战
运维·数据库·mysql·云原生·高可用·mha·组从复制