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

本文章已经生成可运行项目
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值