95

We got a new iMac for Christmas and it has seemed really slow for the past couple of days. In desperation I checked out Activity Monitor and it shows photoanalysisd as the guilty process that is hogging my CPU. I assume this is related to the Photos app, but that's not even running!

What is "photoanalysisd", why is it using 77% of my CPU, and can I safely stop the process?

Monomeeth
  • 64,558

9 Answers9

128

Update for 2019, 16" MacBook Pro running Catalina 10.15.2:

  1. start Photos, let it continue past the first dialogue box;

  2. now Preferences… in the main app menu under Photos just right after Apple logo is clickable (it wasn't before);

  3. Preferences… (⌘+,) → General tab , and untick both check boxes in Memories;

    Memories settings

  4. close Photos.

This stops photoanalysisd cold, no reboot or kill required.

foobar
  • 1,381
  • I don't see this with 10.15.1 maybe there's a reason to finally upgrade to .2 (and deal with all the bullshit that breaks every time like xcode) – dcsan Jan 08 '20 at 15:52
  • @dcsan I've upgraded to 10.15.2 and I have this Photos option. Also an Xcode developer, and see no issues to date. – Nate Jan 16 '20 at 11:43
  • This worked for me on my 2015 15" Macbook Pro, also Catalina 10.15.2. – minseong Feb 12 '20 at 00:30
  • 10.15.3 with no photos, but photoanalysisd had been running 3h+ CPU time. That's weird. I think I got my cores back, now. – akauppi Mar 09 '20 at 19:19
  • 2
    This helped for a while, but recently it came back. I don't use photos, and have zero pictures. The only thing left was the checked box 'import photos', so I unticked that as well. It might just have been opening / closing photos that did it, but its gone (again) now. – Andrew Jun 15 '20 at 13:04
  • 2
    Worked for MacBook Pro 13", mid 2012. Thanks! – Winona Jun 18 '20 at 03:28
  • My hero. Fixed my problem of 100h+(!) CPU time analysing...an empty photo library. – Volker Stolz Jun 27 '20 at 12:18
  • 3
    This is the best answer.. I had full CPU usage, after unchecking both everything went to normal again! Thanks – davidev Aug 05 '20 at 12:10
  • This worked for me on MacBook pro 13" 2014, Catalina 10.15.6. Thanks – nima Sep 15 '20 at 12:14
  • 2
    Thanks, worked great! I didn't even run Photos at first (never have) and have 0 photos in my gallery or photos folders or anywhere, never used those features at all. I simply opened Photoshop to edit a screen capture on the desktop, and BAM this process kicked in and was eating 99.9% of my CPU for the last 2 hours on my 2017 10 core iMac Pro, ridiculous. Makes me want to trade up to the latest generation mac now...seems like a good excuse anyway. :) – reactive-core Nov 12 '20 at 21:00
  • Worked for me as well. Why is this processing running, when I have no photos, and iCloud Photos turned off (I do have photos in iCloud but on other devices)? – Paul Mar 02 '21 at 19:02
  • Works immediately. I faced 100% usage after upgrade to Mac Catalina 10.15.7 in May 2021. Also when Photos is stopped, the photoanalysisd was not interfering anymore. – peter_v May 23 '21 at 09:08
  • 1
    Can't uncheck those boxes. Both are checked, but disabled so I can't change them. Stupid mac. – Mnebuerquo Jun 28 '22 at 13:08
  • This is just one of the problems that manifested upon upgrade from Catalina to Monterey. Unfortunately, in Preferences, the boxes are already unticked. Opening "Photos" app does seem to temporarily close "photoanalysisd". I hate being forced to do upgrades; they are always downgrades of performance, in exchange for features I will never use. – IAM_AL_X Aug 12 '23 at 14:11
  • Thanks, this was exactly what I needed. I never noticed this 'photoanalysisd' thing in the background before, no idea why it recently started acting up. Your answer saved the day! – RocketNuts Jan 29 '24 at 09:12
72

Your iMac is currently processing the photos in your Photos library, presumably because you’ve just imported/converted an existing Photos library from an earlier version of macOS.

If you suspect this has been the cause of your sluggishness for a couple of days, then it’s most likely you’ve got a very large photo library and that it’s being processed for the first time on your new iMac.

The fact that Photos isn’t running actually fits with your scenario, as launching the Photos app will pause the photoanalysisd daemon.

Although it takes a long time, once it’s finished your Photos app will be able to perform a lot of advanced functions due to all the metadata etc it’s processed, so I would let it finish what it’s doing.

NOTE:

Should you need to pause the process in order to free up some of your CPU, I would recommend just opening the Photos app for a while and then quitting it when you’re not using the computer. Note, however, that minimising the Photos app will act to restart the photoanalysisd daemon, so just leave it running in the background while you want to keep the daemon paused.

Monomeeth
  • 64,558
  • 7
    My photo library is 360GB in size, so it did take a long time, but all is working great now. Thanks! – user269919 Jan 01 '18 at 20:59
  • I see this running (via ssh on another account) when I'm trying to log in! It has been sitting here for 10 minutes not letting me log in and I see this stupid background process and wonder why I'm still not logged in!!! – Michael Jun 17 '18 at 05:59
  • 3
    Running Photos application has no effect in photoanalisysd for me, it's still taking most of the CPU... (macOS Mojave, 10.14.1) – Marinov Iván Nov 28 '18 at 13:04
  • 2
    Opening Photos does not seem to pause photoanalysisd, whether in the background or foreground. It just leads to both photoanalysisd AND photolibraryd eating CPU. – David J Jan 18 '18 at 22:30
  • On macOS Catalina 10.15.7 photolibraryd will only be running for a few minutes with Photos opened. When it is closed, photolibraryd will stop again after a few minutes. There's no real pattern visible when the process starts using CPU and when not. – Markus Rudel Oct 27 '20 at 07:01
  • Wow. This is counterintuitive. I have a related issue. My library is located on an external drive. Copying files to it is sluggish, and I've found the culprit seems to be photos-related (using lsof) even though the Photos app is not running. I never thought to open Photos in order to do my copy more quickly. – Victor Engel Feb 23 '21 at 16:33
5

After photoanalysisd had been taking up 3 cores for over a month, I found a solution that reduced the CPU usage dramatically for me on High Sierra. I went into Photos and added names to some pictures - 4 pictures in total using 3 names. Photoanalysisd is currently using 0% whether or not Photos is open.

TimC
  • 51
  • 2
    Just updated to Catalina. I had photoanalysisd taking 80% CPU all day, it only got through 900 photos. I followed this advice, named 5 faces it found, and now it's made 1600 scans in just an hour. Definitely add some names, if we can't get away from this feature, we can at least stop it from spinning. – Matt Stephenson Dec 04 '19 at 01:09
  • Yah, "feature". – IAM_AL_X Aug 12 '23 at 14:13
3

I have only a dozen or so photos in my library (this is my spare computer, my photos are on my main computer) and I've let the process run for a week, and it is still eating up 100% of both cores. My machine is unresponsive with the CPU fan at 100% (13" MacBook Pro Mid-2010). None of the solutions I found on the web worked, I finally temporarily renamed my photo library to hide it from the deamon, and instantly had both CPUs go from 100% to around 5%.

Hamid
  • 91
  • This is the only solution that worked for me (Catalina 10.15.6 and I don't use Photos) – Maiaux Sep 26 '20 at 12:38
  • I renamed it and another one was instantly created and photoanalysisd still is running, unfortunately. On Catalina 10.15.7. I also don't use Photos. I tried unchecking the config as mentioned here but still no luck. – romellem Jun 10 '21 at 21:28
3

Might I suggest the use of App Tamer?

It lets you pause/stop a process when it reaches a % of the processor time.

Since I use it, my computer temperature is always quite low.

Hope it helps!

P.S.: I am not affiliated at all with App Tamer. I am just a happy customer!

3

I don't use the Photos app and I have no photos in it. Still, my mac (Catalina) is regularly slow and sluggish due to this process. I've now renamed the Photos library which seems to help. It's annoying constantly having a process running for a feature that is not used. Surely Apple can detect wether they actually need to run this process?

user199085
  • 39
  • 1
  • 1
    The process always runs - what chances is if it detects there’s analysis to do on changed items. – bmike Jan 20 '20 at 18:00
  • 4
    Do you by any chance have an Exchange / Office 365 Account enabled for Contacts? I had very high CPU usage from photoanalysisd every couple minutes on macOS 10.15.2 with an empty Photos library and it stopped after I went to System Preferences -> Accounts -> My Exchange Account and unchecked Contacts. Obviously this will also make you Exchange Address Book unavailable in Mail, Contacts etc. – felixbuenemann Jan 21 '20 at 10:45
  • I do have an office365 account enabled for contacts. I ended up renaming my ~/Pictures/Photos Library.photoslibrary directory. I did kill the photoanalysisd process and haven't rebooted since so I can't actually say if renaming the folder helped. I'll do some testing to see if I can reproduce it. – user199085 Jan 21 '20 at 21:38
  • @felixbuenemann nice catch! Who'd think about a relationship between Exchange contacts and photoanalysisd... in fact, that explains why, in my case, I don't get any pictures on Exchange contacts: it must be checking those with all sorts of tools first, including photoanalysisd, and I suppose that before this daemon finishes its processing, I won't get any images anyway... – Gwyneth Llewelyn Oct 08 '21 at 07:52
0

In my case, it was photolibraryd and not photoanalysisd that was hogging CPU and also causing massive HD churn, but I'd like to provide an answer here that worked for me in stopping photolibraryd, because (1) I think these tips will work for stopping photoanalysisd too, (2) this page is one of the top Google results for people searching for info about photolibraryd, and (3) none of the advice on this page (as of 2021-07-01) worked for me in stopping photolibraryd.


First, I was initially experiencing massive disk churn, particularly disk-writing not reading. This started when I moved the Photos library from one user account to another on the computer. This problem was partially due to the fact that my new account did not own the files inside the Photos Library bundle. I had to open the bundle (go to ~/Pictures/Photos Library.photoslibrary and right-click it, then choose "Show Package Contents"), Get Info on each subfolder (database/, external/, originals/, etc.), and under the Sharing & Permissions section add my new user account, set its privileges to "Read & Write", and then click the ellipsis-in-a-circle button at the bottom and choose "Apply to enclosed items…". I had previously given myself Read & Write privileges for the overall Photos Library bundle, but this was not enough.

Giving myself R&W access to all the contents stopped the disk-writing churn and the errors that were showing up in Console.app from photolibraryd, however it still continued to dump tons of non-error messages into Console and was reading continuously from the HD at 15MB/s for hours despite the fact that I don't have enough photos to occupy it for more than a couple minutes at that speed.

At this point, the advice here from mbackschat on 2020-01-03 worked instead, which is to rename the folder ~/Pictures/Photos Library.photoslibrary/database to something else (for example, to database.xxx). This confounds photolibraryd so that it stops thrashing the computer. Note that launching Photos after doing this will initiate a "Restoring…" process that recreates database/, so you will have to do this after each time you use Photos.

0
launchctl disable user/$UID/com.apple.photoanalysisd
launchctl kill TERM gui/$UID/com.apple.photoanalysisd
killall photoanalysisd

restart

if that not help

Just create new file call tcookiped.sh and then run it in terminal sh tcookiped.sh

killall -STOP photoanalysisd

or

while true; do
killall photoanalysisd

sleep 10 done

#killall -ABRT corespotlightd

  • 1
    Running killall -STOP photoanalysisd once to pause the process might be the better approach than busy-looping to kill the relaunches. Neither solution solves the underlaying problem though. – nohillside Aug 29 '22 at 08:00
-1

That process interferes severely with time machine by hogging all available CPU. It is the only process that I encountered so far that is that annoying. Now I finally stop the process manually through Activity Monitor > select CPU > select "photoanalysisd" > click red stop sign in top left – as soon as it starts to interfere with my work. Not a permanent solution, but at least I can use my machine for what it is intended.

Meggi
  • 1