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

相关推荐
未济1 天前
linux 配置环境变量
linux
傲世仙尊1 天前
目录即文件-Ext文件系统收尾篇
linux·c语言
虎头金猫1 天前
4K 视频总卡在公网带宽?用 N1 + OpenList 把网盘播放链路重新理顺
运维·服务器·网络·python·容器·beautifulsoup·pandas
_艾伦 耶格尔.1 天前
进程间通信
linux
AI职业加油站1 天前
AI智能体应用工程师证书:政策红利下的职业新风口
大数据·运维·人工智能·学习·职场发展
Liuqy-051 天前
Linux IO编程——静态库、动态库
linux
此冬歌咏1 天前
K8s 节点故障实战:优雅驱逐 31 秒,硬故障 331 秒,以及那个永远 Pending 的 Pod
运维·k8s
彧azz1 天前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
-梅1 天前
linux(8) 软硬链接
linux·运维·服务器
Wang's Blog1 天前
Java 项目实战: 外卖平台-文件下载与ServletOutputStream回写浏览器
服务器·项目开发