DESCRIPTION OF PROBLEM: When syncing large items (such as images) with NSPersistentCloudKitContainer, my app crashes with the error 'NSAllocateMemoryPages() failed'. This happens repeatedly within a minute of launching the app. It happens both in production and development environments.
The crash does not happen if the user disconnects from the internet, or turns off iCloud sync for my app.
The images are stored in Core Data as "Binary Data" in separate entities with "many to one" relationships to their parent entities. The setup is adapted from this exaple: https://developer.apple.com/documentation/coredata/synchronizing_a_local_store_to_the_cloud
STEPS TO REPRODUCE: Add multiple images to core data at once or sync with an iCloud account that already has multiple images in the private iCloud container.
PLATFORM AND VERSION: Happens on both iPhone X and iPad Pro (gen 1) running iOS 13.3.1.
Have anybody else come accross this issue? All suggestions will be very welcome!