I have 100,000 photos in the .photolibrary on macOS. When I try to export them, it causes errors like running out of RAM and makes the MacBook reboot.

Paul Xiong
3 min readOct 17, 2024

--

Answer from chatGPT:

Handling such a large number of photos in a `.photolibrary` can indeed strain the system. Here are some strategies to help you export the photos without overloading your Mac:

### 1. **Export in Smaller Batches:**
- Instead of trying to export all 100K photos at once, export them in smaller batches.
- You can create albums in the Photos app, organizing photos by year, event, or any other criterion, and then export each album one by one.
- Start with a small number (e.g., 500 or 1,000 photos) and gradually increase the batch size if the process runs smoothly.

### 2. **Free Up System Resources:**
- Close all other applications while exporting to free up RAM.
- Make sure your Mac has enough free disk space, as exporting may require extra space for temporary files.
- Reboot the Mac before starting the export to ensure maximum available memory.

### 3. **Export Photos to an External Drive:**
- Exporting directly to an external hard drive or SSD can help reduce the load on your internal storage.
- Make sure the external drive is formatted in a macOS-compatible format (e.g., APFS or Mac OS Extended).

### 4. **Use macOS Safe Mode:**
- Restart your Mac in Safe Mode, which limits background processes and can help prevent crashes during the export.
- To enter Safe Mode, hold the **Shift** key while restarting your Mac.

### 5. **Try Exporting Unmodified Originals:**
- If you encounter issues exporting edited photos, try exporting unmodified originals, as the Photos app may struggle to process edited versions.
- You can reapply edits in other software like Lightroom or Photoshop if needed.

### 6. **Use the Photos Library Repair Tool:**
- The Photos app has a built-in repair tool that can fix potential issues with the library.
- Open the Photos app while holding the **Option + Command** keys, and it will prompt you to repair the library.
- This process can take some time, especially for large libraries, but may help resolve export-related issues.

### 7. **Split the Photos Library:**
- Consider creating multiple smaller libraries from your current `.photolibrary` to reduce the overall size.
- Use third-party tools like **PowerPhotos** to split the library without duplicating photos.
- You can then export photos from each smaller library.

### 8. **Use Command Line Tools:**
- If all else fails, you can use command-line utilities like **`osxphotos`** to export photos from the Photos library. `osxphotos` is a Python-based tool that interacts with the Photos database directly, which may bypass some of the memory issues.

These approaches should help you export your photos without overloading the system. Let me know if you need more details on any of these steps!

Then I decided to use Smart Album:

Create a Smart Album
Open Photos App:

Launch the Photos app.
Create a New Smart Album:

Go to File > New Smart Album.
Set Smart Album Criteria:

In the dialog that appears, set the criteria to include photos from the desired years:
For example, choose "Date" is in the range and set it to start from January 1, 2006, to December 31, 2008.
Name your Smart Album (e.g., "Photos 2006-2008").
View Photos in the Smart Album:

This will create a new album containing all the photos taken between 2006 and 2008, allowing you to view them together.
  1. Create photos by year

2. Export photos by year.

--

--

Paul Xiong
Paul Xiong

Written by Paul Xiong

Predicting the next word (token) is what powers ChatGPT, while predicting the next photo (embedding) forms the foundation of ImageGPT.

No responses yet