Post

Replies

Boosts

Views

Activity

Reply to NSPersistentCloudkitContainer Memory Leak -> Crash? (iOS 15 beta 4 & 5)
This is all very confusing to me... ...and it's quite possible that this 'bug' is something I'm doing wrong when ingesting data from a backup file, despite it all appearing to save to Core Data just fine. But why now though? Why has it been working just fine for almost 2 years without modification? Backup Restore Process The backup file that my users create is a serialised dictionary file, which includes encoded data for images (if present). When I restore it, I use a private context to ingest it on a background thread, with a progress bar being updated on the main thread. As I do not want partially imported data to be incorporated into the user's Core Data store I only save the context at the end of the import when successful. This has been working flawlessly for the past 2 years with NSPersistentCloudKitContainer, with the data syncing after the import finishes and is saved to Core Data... but was it only working by accident all this time!? Should I not be using the private context to save imported data?? Is it me? I'm quite happy to eat humble pie if it's my problem which as only appeared now because Apple has fixed something at their end and I was 'getting away with it' until now. That's why I filed the TSI (780063461) and why I really want to have a one-on-one with someone!
Sep ’21
Reply to NSPersistentCloudkitContainer Memory Leak -> Crash? (iOS 15 beta 4 & 5)
Update While the issues is not yet resolved in iOS 15.1 beta 2 (just downloading beta 3 now), I have been very happy with the Apple Developer Technical Support Representative I contacted (via a TSI) they have been the 'intermediate' to liaise with the Framework Engineers. Had I been trying to troubleshoot this with Apple via messages here, or through the Feedback Assistant (no two-way communication ever occurred there), it would have been a very long & tedious process as we've run into several hurdles. We've been exchanging several emails per day. So far I've run many tests and uploaded tens of gigabytes of .trace data, etc. (some files are 60GB or more and tests that take hours to run) to get to the bottom of this. They can see their is an issue with CPU & RAM consumption and they're looking into it. This is great news. While the bug (if it's a bug) is a big concern concern, the communication aspect of resolving it was far more important to me. I no longer feel like I'm 'yelling into the void'. It might take time to fix (that's fine) but there does appear to be something going on when trying to sync lots of relationships - either an initial sync of 'default data' or 'backup data' or when adding objects to an already large & complex (relationship-wise) database. Syncs with fewer relationships between objects (but the same data model) seem to sync just fine, although sometimes it takes while before any data is transmitted. On earlier versions of iOS syncing would start pretty quickly, but relationships would often be the last to complete to 'finish' the sync and have the data appear correct on other devices. It's as though it's trying to sync everything in one hit so you don't see any incomplete relationships as objects sync. In iOS 14 this wasn't the case and it took time before the data all synced and looked correct. Perhaps this is a bug related to attempting to stop this from occurring as it might confuse the end user? The problem is that when the number of metadata objects required to sync exceeds a thousand or so (from my crude test runs), it ends up using so much CPU & RAM, it crashes the app and the actual syncing of data never has a chance to start. It also results in serious battery drain, listing my app as the cause of it!
Oct ’21
Reply to NSPersistentCloudkitContainer Memory Leak -> Crash? (iOS 15 beta 4 & 5)
Quick Update (Note: I've not received any official update from Apple yet) I've just installed iOS 15.2 (beta 2 19C5036e) today and have noticed that data now seems to be uploading from my App (App Store version) when previously it would just sit there... then crash. If I look under iCloud -> Manage Storage -> MyApp I can see the figure for data stored going up slowly. Better yet, I'm seeing data come DOWN to my other devices now. I'm not near my development setup so I can't test this on a physical device to see what the console output shows, but I'll try and do this tonight on my iPad. I'll ingest my large external backup file into Core Data and see if it uploads to iCloud and report back. There is no new update for Xcode yet so I don't think we can test with iOS 15.2 (beta 2) in a simulator environment. I'm not going to count my chickens just yet...
Nov ’21
Reply to NSPersistentCloudkitContainer Memory Leak -> Crash? (iOS 15 beta 4 & 5)
Seems like this is back with iOS 18 & 18.1 (so far...). I had to reset everything for my app in the production environment so wiped the iCloud data, reset everything then reinstalled and imported my data into the primary device (iPhone) Sync completed after a day or so, then I installed the app on the iPad. Sync starts and appears to be doing something then nothing appears to happen for a while (maybe 20 minutes), then the app crashes again. No further data appears to have been downloaded. This happens every time I restart the app. Sigh... It's as though it's trying to do 'everything at once' for the initial sync instead of incremental syncs in small batches... and then it drops out. EDIT: Apple censored the word for 'drops out' that I used (ie. the thing they drop from planes) and substituted it with five asterisks - seriously? What puritanical nonsense is this??
Nov ’24