Quick: Taming Photos.app when using iCloud Photos

Quick: Taming Photos.app when using iCloud Photos

Anyone who uses iCloud photos and has syncing turned on on your Mac or Hackintosh will likely one day run into challenges with it. Whether it's the uncontrollable hard drive usage or the incessant background processes that occasionally take over your entire CPU, it's just not ideal and can really throw you out of whatever it is you are actually trying to do on your machine.

Fortunately there is a relatively easy way to avoid or reduce this issue. Using a simple trick you can force a specific storage size upper limit and even ensure background processes don't go take over your computer at times where you really to use your machine. Here I'll list out two methods that you can use that are mostly the same, but each offers some specific benefits.

Screenshot showing multiple Photos.app related processes taking up considerable resources.
While not as crazy at it sometimes gets, on my early 2016 MacBook 12" you certainly notice this.

Step 1, Method 1: APFS

If your Mac/Hack is using APFS you can very easily and quickly create a new volume with an upper size limit set, specifically for your photos. Let's walk through this now.

In Disk Utility, select the hard drive or SSD on which you would like to store your photos on. Click the + volume button, and give it a logical name (e.g. Photos). Click the Size Options button, and set the Quota Size to the maximum amount of hard drive space you'd like your photos library to use. Leave Reserve Size empty. In my case, on my MacBook I selected 40GB.

Screenshot showing Disk Image's new volume size options view.
Setting the "Quota Size" of the volume sets the upper limit.

If your current Photos library is larger than the size you have just chosen, you can't move your existing library over and instead should create a new one. This means it will first have to download all thumbnails and related again. If your current library is smaller though, you can skip the new library creation step and just move the library file over to this newly created volume. By default this library file can be found in your ~/Pictures folder and is usually called Photos Library.photoslibrary.

Step 1, Method 2: Disk Image

If you are not using APFS or for whatever reason do not want to create a new volume, you can instead create a Disk Image. An added benefit of this would be that a disk image is inherently portable, so you could consider bringing it with you and use it directly on multiple machines. Though to be fair, you could achieve the same with an external APFS formatted hard drive and the first method.

Screenshot showing the blank image creation screen of Disk Utility.

In Disk Utility, create a new blank disk image using the File » New Image » Blank Image.. menu option. Give it an appropriate name (e.g. Photos), and under Image Format select sparse bundle disk image. Then, set the desired size. You can write GB too, so if you want a 40 GB image or similar, just write that in there. You can leave other options at their defaults, or optionally set Encryption if you prefer to password protect your disk image (and thus photo library).

Note: If you write out the size first and then adjust the Image Format, macOS resets the size back to the 100 MB default. Make sure you double check the set size before hitting save.

Step 2: Moving your library

As mentioned before, if your existing photos library is of a smaller filesize than the limit you have set to the volume or disk image created, you can simply move it to the new partition. Simply move it over and, when done, double click to open it. From that point onward, whenever you open the photos app it will open this library file.

If this is not the case, though, you'll need to create a new photos library and set it as the system default. Let's do that now.

Screenshot showing the library selector UI from the Photos app

Open the Photos.app and while doing so, hold down option ("alt") on your keyboard. Click Create new and create a new library in the volume or disk image you just created. A completely empty library view will show up, asking you to start by adding some photos.

Open preferences (Photos » Preferences...) and in the General tab, click the Use as System Photo Library folder. You'll likely be shown a warning that states iCloud photos will be turned off if you do this, click OK to proceed.

Now go to the iCloud tab, and re-enable the iCloud Photos and, if desired Shared Albums checkboxes. Make sure the Optimize Mac Storage option is selected.

Screenshot showing the Photos.app updating itself after just enabling iCloud Photos.

And that's it! You'll see the Updating... text as shown above for a bit, after which your photos will start popping up. Initial download may take some time, depending how many photos you have and on your internet connection, but once this is done you will now have access to your iCloud photos and more control over how much hard drive space it will actually take up. Joy!

Now, to handle limiting background resource usage even when Photos.app isn't running; simply unmount the volume or disk image when you are not using the photos app or if you just really need all resources available to what you're working on. When you want to access your photos, simply remount the volume or drive and you're back where you left of.

This does mean that while you have your volume or disk image unmounted, your computer won't be able to synchronize newly made photos and videos in the background. Of course this is exactly why you'd unmount the volume in the first place, but I thought I'd specifically mention it here as an added reminder.

I hope this is useful for some of you, especially if you're running on a computer with more limited resources or want to at least somewhat solve the issue of each of your machines analyzing all your photos and videos separately, instead of synchronizing the results between your devices.

Thank you.