NSPersistentStoreCoordinator.migratePersistentStore for SQLite store has huge memory usage spike (10-15x of database size)

Originator:jkirsakmens
Number:rdar://45044215 Date Originated:October 5 2018
Status:Open Resolved:
Product:Core Data Product Version:
Classification:Suggestion Reproducible:Always
 
Area:
Core Data

Summary:
NSPersistentStoreCoordinator.migratePersistentStore method has very large memory consumption (10-15x of the database size, depending on the device which is used to run test case) that (probably?) might lead to app crash due if database ir large/complex.

Steps to Reproduce:
Run attached project on device or simulator, tab button, observe memory consumption.

Expected Results:
Memory consumption is within "green" limits of memory dashboard.

Actual Results:
Memory consumption spikes outside of "green" zone of memory dashboard.

Configuration:
iPhone 5, iOS 10.3.3
Xcode version 10.0 (10A255), iOS12 SDK

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!