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

相关推荐
源远流长jerry7 分钟前
在 Ubuntu 22.04 上配置 Soft-RoCE 并运行 RDMA 测试程序
linux·服务器·网络·tcp/ip·ubuntu·架构·ip
学不完的9 分钟前
Docker数据卷管理及优化
运维·docker·容器·eureka
twc82923 分钟前
大模型生成 QA Pairs 提升 RAG 应用测试效率的实践
服务器·数据库·人工智能·windows·rag·大模型测试
lay_liu28 分钟前
Linux安装redis
linux·运维·redis
w-w0w-w2 小时前
Unix网络编程
服务器·网络·unix
寂柒2 小时前
序列化与反序列化
linux·网络
lay_liu2 小时前
ubuntu 安装 Redis
linux·redis·ubuntu
曾经拒绝刘亦菲2 小时前
Clamav在麒麟V10离线安装指南
运维
志栋智能2 小时前
超自动化巡检:应对复杂IT环境的必然选择
运维·网络·安全·web安全·自动化
li星野2 小时前
[特殊字符] Linux/嵌入式Linux面试模拟卷
linux·运维·面试