Skip to content

Photos builds a face and scene index, and it is stored on your disk

The background process that recognises faces and scenes keeps its own cache. What it is, why it grows after an import, and why waiting is the fix.

4 min read

After importing a batch of photos, a Mac gets warm, the fans come on, and the disk loses a few gigabytes. Nothing is wrong. Photos analyses images on the device to recognise faces, scenes and text, and that work has both a CPU cost and a storage cost.

Where it is

du -sh ~/Library/Containers/com.apple.mediaanalysisd \
  ~/Library/Containers/com.apple.photoanalysisd 2>/dev/null
du -sh ~/Pictures/*.photoslibrary/resources 2>/dev/null

The containers hold the analysis process's working data, and the library's own resources folder holds the derived thumbnails and index that Photos uses to show you results instantly.

Why it grows and then stops

Analysis runs when the Mac is idle and on power, which is why it appears to happen overnight and why it can take days after a large import. The index it produces is permanent, in proportion to the library. The temporary working files are not, and they go when the pass finishes.

So the honest advice for a Mac that has just imported a few thousand photos is to leave it plugged in overnight rather than to clean anything. Interrupting the pass repeatedly means it starts again, which is the one way to make this genuinely expensive.

If you want it to stop

There is no switch for face recognition itself. What you can do is stop the library growing, which is a different decision covered in what the Photos library actually holds, including the difference between optimised and original storage.

When it is not this

If the disk keeps losing space with no import to explain it, this is the wrong suspect. Space that disappears overnight has a short list of causes and a command that identifies which one, and snapshots are usually the answer.

Common questions

What is mediaanalysisd on a Mac?

It is the background process that analyses images and video for faces, scenes and text so Photos can search them. It keeps working data in its own container under ~/Library/Containers, measured at 282 MB on a Mac with a modest library.

Why does Photos use disk space after importing?

Because analysis builds a permanent index proportional to the number of images, plus temporary working files during the pass. The temporary part goes when analysis finishes, which can take days for a large import.

Can I stop Photos analysing my library?

There is no direct switch. Analysis runs when the Mac is idle and on power, so leaving it plugged in overnight lets it finish. Interrupting it repeatedly is the only way to make it genuinely expensive.

Is it safe to delete the Photos analysis cache?

It is safe but counterproductive. The analysis restarts from the beginning, using more time and more disk activity than leaving it in place.

Read next