Skip to content

Instantly share code, notes, and snippets.

@huksley
Last active March 27, 2024 17:28
Show Gist options
  • Save huksley/564be2c903312bcee7dffe415d128f90 to your computer and use it in GitHub Desktop.
Save huksley/564be2c903312bcee7dffe415d128f90 to your computer and use it in GitHub Desktop.
Disabling photoanalysisd

For what it's worth (and with all the usual disclaimers about potentially making your mac unstable by disabling system services), here's some commands that will manipulate this service and services like it. Note the $UID in the command, that's just a bash shell variable that will resolve to some number. That's your numeric UID. You just run these commands from a Terminal command line. No special privileges needed.

If you want to disable it entirely, the first command stops it from respawning, and the second kills the one that is currently running:

launchctl disable gui/$UID/com.apple.photoanalysisd
launchctl kill -TERM gui/$UID/com.apple.photoanalysisd

(If you kill it without disabling it will die, but a new one will respawn and pick up where the old one left off)

I don't have this problem myself, so I can't try these next two commands. They're relying on good ole UNIX signals. You could theoretically suspend and resume the process like this ("STOP" and "CONT" are stop and continue):

launchctl kill -STOP gui/$UID/com.apple.photoanalysisd
launchctl kill -CONT gui/$UID/com.apple.photoanalysisd

I don't know what launchd does when running processes are suspended for a long time. Will it detect them as dead and kill and restart them? I dunno. But I do know they won't get any CPU time.

@nitantsoni
Copy link

nitantsoni commented Jul 9, 2022

Small change needed for Monterey. The command to disable the service is now

launchctl disable user/$UID/com.apple.photoanalysisd

The gui changed to user. The command to kill the process is the same

launchctl kill TERM gui/$UID/com.apple.photoanalysisd

@RCurious
Copy link

RCurious commented May 15, 2023

I don’t know about the “tracked” part but “ somebody “ left a mighty big (nearly 16 MB) footprint!!!

Powerstats for: photoanalysisd [1389]
UUID:
EE+**++-346A-388F-@@++
Path:
/System/Library/PrivateFrameworks/PhotoAnalysis.framework/Support/photoanalysisd
Resource Coalition ID: 4((
Architecture:
arm64e
Parent:
UNKNOWN [11
UID:
5&1
Sudden Term:
Tracked (allows idle exit)
Footprint:
12.16 MB -> 15.70 MB (+3632 KB)
Pageins:
273 pages
Start time:
2023-05-12 01:34:49.369 -0500
End time:
2023-05-12 01:37:01.563 -0500
Num samples:
39 (89%)
Primary state: 34 samples Non-Frontmost App, Non-Suppressed, User mode, Effective Thread QoS Background, Requested
Thread QoS Background, Override Thread QoS Unspecified
User Activity: 39 samples Idle, O samples Active
Power Source:
O samples on Battery, 39 samples on AC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment