Finding Out Why Your Mac Is Hot While It's Idle
Jake MarshIn this post
A Mac that’s warm with nothing open is running something you can’t see. Apple’s advice in Keep your Mac laptop within acceptable operating temperatures is where I start:
If your Mac laptop gets warm even when it isn’t doing tasks that require intensive calculations, or if it has fans that run for a long time, use Activity Monitor to check CPU activity.
This is the order I check things in, from the app everyone has to the tools in Terminal. If kernel_task is the one at the top of the list, that’s its own story, and I wrote it up in What kernel_task Is Doing When It’s Using Your CPU.
Activity Monitor’s CPU And Energy Tabs#
The CPU tab, sorted by % CPU, is the quickest answer. The bottom of the window splits the total into System (processes that belong to macOS), User (apps you opened and the processes they started) and Idle, per Apple’s guide. On an idle Mac, a big System number points at one of the daemons further down this post.
The Energy tab has two columns I use for heat. Apple describes Energy Impact as “a relative measure of the current energy consumption of the app (lower is better)”, and on laptops there’s also 12 hr Power, the average over the last 12 hours. Preventing Sleep says whether an app is keeping the Mac from sleeping, which matters because a Mac that should be asleep and isn’t has the whole night to warm up.
top And ps#
In Terminal, top -o cpu is the live version of the CPU tab. For a snapshot I can paste somewhere, I use logging mode with two samples, because the man page warns that “the first sample displayed will have an invalid %CPU”:
$ top -l 2 -s 2 -o cpu -n 8 -stats pid,command,cpu,user
...
PID COMMAND %CPU USER
784 WindowServer 58.1 _windowserver
1164 iTerm2 53.6 jakemarsh
0 kernel_task 24.7 root
1636 superwhisper 12.9 jakemarsh
2668 2.1.330 10.0 jakemarsh
98106 2.1.330 9.8 jakemarsh
71258 node 9.5 jakemarsh
1283 WeatherWidget 8.1 jakemarshMy Mac wasn’t idle when I ran this. Several agent sessions were working in the terminal, which is why iTerm2 and those 2.1.330 processes are up there.
ps is quicker and doesn’t need a sample window:
$ ps -Ao pid,pcpu,comm -r | head -6
PID %CPU COMM
784 53.3 /System/Library/PrivateFrameworks/SkyLight.framework/Resources/WindowServer
1164 51.0 /Applications/iTerm.app/Contents/MacOS/iTerm2
1636 14.2 /Applications/superwhisper.app/Contents/MacOS/superwhisper
18304 12.2 (python3.11)
98106 11.4 claude-A includes other users’ processes, which you want, since most of the background daemons run as system users. -r sorts by current CPU usage. Two things to know about it. The %cpu column is “a decaying average over up to a minute of previous (real) time”, so a process that just stopped can still show up. And ps never lists kernel_task: it starts at PID 1, so top is the one to use when you suspect the kernel.
Who’s Keeping It Awake#
The quickest answer is one line of plain pmset -g. When something is holding the Mac awake, the sleep line names it:
$ pmset -g | grep '^ sleep'
sleep 0 (sleep prevented by coreaudiod, caffeinate, xcodebuild, caffeinate, caffeinate, caffeinate, sharingd, caffeinate, caffeinate, caffeinate, caffeinate, caffeinate, backupd-helper, caffeinate, powerd)The 0 is my own setting. The man page says 0 disables the system sleep timer, and pmset -g custom shows I have it that way on AC power. The list in parentheses is what would keep the Mac awake anyway: audio, a build, a Time Machine helper and a lot of caffeinate.
pmset -g assertions is the Terminal version of the Preventing Sleep column, with more detail. The man page says it “displays a summary of power assertions. Assertions may prevent system sleep or display sleep.” The top half is a count per assertion type, and the bottom half lists them by owning process. Here’s part of mine:
$ pmset -g assertions
Assertion status system-wide:
BackgroundTask 0
...
PreventUserIdleSystemSleep 1
NetworkClientActive 0
Listed by owning process:
pid 1376(mds_stores): [0x00007aa4000ba5d6] 00:13:51 BackgroundTask named: "com.apple.metadata.mds_stores.power"
pid 85690(caffeinate): [0x00007d3e0001a6de] 00:02:44 PreventUserIdleSystemSleep named: "caffeinate command-line tool"
Details: caffeinate asserting for 300 secs
Localized=THE CAFFEINATE TOOL IS PREVENTING SLEEP.
Timeout will fire in 135 secs Action=TimeoutActionRelease
pid 741(mds): [0x00001468000b8b7f] 07:30:02 BackgroundTask named: "com.apple.metadata.mds.power"
pid 727(powerd): [0x0000063c0001800a] 08:30:29 PreventUserIdleSystemSleep named: "Powerd - Prevent sleep while display is on"The time after each address is how long the assertion has been held. Spotlight’s mds had held one for seven and a half hours. There were ten caffeinate processes in the full list, and every one I checked had a claude process as its parent: my agent sessions run caffeinate -i -t 300, which per its man page creates “an assertion to prevent the system from idle sleeping” that’s dropped after 300 seconds. That’s what I want while they work, and it also means this Mac can’t idle sleep while they’re running.
To see assertions come and go over time, pmset -g assertionslog “shows a log of assertion creations and releases.”
Two more pmset commands answer “did something wake it up?” pmset -g sched “displays scheduled startup/wake and shutdown/sleep events,” and on my Mac it prints nothing, which is what you want to see. pmset -g custom shows womp, which the man page calls “Same as ‘Wake for network access’ in System Settings.” Mine is 1 on AC power and 0 on battery.
Catching It While You’re Away#
The hard version of this problem is a Mac that’s warm when you come back to it, with nothing busy by the time you look. For that I leave a loop running that logs the three busiest processes every minute:
#!/usr/bin/env bash
# Every minute, log the three busiest processes with a timestamp.
while true; do
ps -Ao pcpu,comm -r | sed -n '2,4p' | while read -r cpu cmd; do
echo "$(date '+%H:%M') $cpu ${cmd##*/}"
done
sleep "${INTERVAL:-60}"
doneRun it with ./cpu-log.sh >> ~/cpu.log before you walk away. ${cmd##*/} trims the path so each line is just the name. Two samples from my Mac, 5 seconds apart:
23:52 60.2 java
23:52 45.7 iTerm2
23:52 42.6 git
23:53 96.0 next-server (v16.4.6)
23:53 52.1 WindowServer
23:53 49.4 nodeIn the morning, this counts how often each process made the top three, which points at the culprit even if it ran for twenty minutes at 3am:
cut -d' ' -f3- ~/cpu.log | sort | uniq -c | sort -rn | headRemember the %cpu column is a decaying average, so a short spike shows up smaller and lasts longer than it really did. For counting who keeps showing up, that’s fine.
powermetrics#
powermetrics is the most detailed of these, and it needs root. Without sudo it stops right away with “powermetrics must be invoked as the superuser”. The man page describes it as gathering CPU usage, timer and interrupt wakeups, C-state statistics and CPU frequency, and on supported platforms estimated power for the CPU, GPU and Neural Engine. It also warns that those power numbers “are estimated and may be inaccurate”, so use them to compare one moment on your Mac with another, never one Mac with another.
You pick what it reports with -s. powermetrics -h lists the samplers on this Mac:
tasks per task cpu usage and wakeup stats
battery battery and backlight info
network network usage info
disk disk usage info
interrupts interrupt distribution
cpu_power cpu power and frequency info
thermal thermal pressure notifications
sfi selective forced idle information
gpu_power gpu power and frequency info
ane_power dedicated rail ane power and frequency infoThe default set is everything except thermal and sfi. For an idle-heat hunt, the useful flags are -n (number of samples), -i (sample interval in ms, default 5000) and --show-process-energy, which adds a per-process energy impact number that the man page calls “a rough proxy for the total energy the process uses, including CPU, GPU, disk io and networking.” Put together:
sudo powermetrics -n 1 -i 5000 -s tasks,thermal --show-process-energyI haven’t run that one here, since it needs sudo. The thermal sampler’s value is instantaneous, taken at the end of the sample window, so a long interval won’t average it.
The Usual Idle Culprits#
These are the background processes I see most often at the top of the list on a Mac nobody’s touching. Every description is from the process’s own man page.
mds,mds_storesandmdworker: Spotlight.mdsis “the metadata server”, andmdworkeris “used by mds to scan and index files as a volume is mounted or a file changes.” Apple’s Spotlight article says indexing runs after a software update or upgrade and “can take hours or even days,” and finishes faster when the Mac isn’t in use and is plugged in. On my Macmds_storesruns as_mds_storesand onemdworkeras_spotlight.photoanalysisd: “background processing of photo libraries for Memories, People and scene or object based search.”backupd: “the Time Machine backup daemon”, running as root.clouddandbird: iCloud.clouddbacks CloudKit andbirdis “one of the system daemons backing the Documents in the Cloud feature.” When my disk kept filling up,clouddwas writing about 1.1 GB a minute putting evicted files back, which I tracked down in Finding Which Process Is Filling Your Mac’s Disk.softwareupdated: “the main daemon responsible for running software updates.” It runs as_softwareupdate.
All of these finish on their own. If it’s Spotlight or Photos after an update, I leave the Mac awake and plugged in overnight and check again in the morning. If it’s an app that keeps coming back at login, Apple’s Login Items & Extensions settings is where you turn it off.
Keeping An Eye On It#
I keep Multimeter in my menu bar with CPU and thermal pressure meters, so I see the jump when a background job starts instead of finding out from the fan. It shows the totals. To get the process name, I still open Activity Monitor or run the top command above.
If none of these show anything and the Mac still runs warm with the fans going, Apple’s next step is to close and open the lid or restart, and on an Intel Mac to reset the SMC.