Core Data的最大存储容量是多少?

时间:2022-02-18 16:47:19
  1. What is the maximum storage capacity of Core Data?
  2. Core Data的最大存储容量是多少?

  3. Is there any capacity limit defined at the app level? Like, out of total available Core Data space, my app can consume only X amount?
  4. 是否在应用级别定义了容量限制?比如,在可用的核心数据空间中,我的应用只能消耗X金额?

  5. What if my app tries to exceed the X?
  6. 如果我的应用程序试图超过X怎么办?

1 个解决方案

#1


14  

Core Data has no hard storage capacity, so you're pretty much just limited by the available disk space on the system. On iOS (and most of the time on OS X) Core Data is backed by SQLite, so if there's any restriction, it's in the size of the backing SQLite database. Unsaved data is stored in RAM, and iOS does not support paging out memory, so your unsaved data set is limited by the available RAM on the device. If you try to exceed the RAM, your app will be shut down. If you try to exceed disk space, I imagine the save action will fail with an appropriate NSError.

核心数据没有硬存储容量,因此您几乎受到系统上可用磁盘空间的限制。在iOS上(大部分时间在OS X上),Core Data由SQLite支持,所以如果有任何限制,它的大小就是支持SQLite数据库的大小。未保存的数据存储在RAM中,iOS不支持分页内存,因此未保存的数据集受设备上可用RAM的限制。如果您尝试超过RAM,您的应用将被关闭。如果您尝试超出磁盘空间,我认为保存操作将失败并带有适当的NSError。

#1


14  

Core Data has no hard storage capacity, so you're pretty much just limited by the available disk space on the system. On iOS (and most of the time on OS X) Core Data is backed by SQLite, so if there's any restriction, it's in the size of the backing SQLite database. Unsaved data is stored in RAM, and iOS does not support paging out memory, so your unsaved data set is limited by the available RAM on the device. If you try to exceed the RAM, your app will be shut down. If you try to exceed disk space, I imagine the save action will fail with an appropriate NSError.

核心数据没有硬存储容量,因此您几乎受到系统上可用磁盘空间的限制。在iOS上(大部分时间在OS X上),Core Data由SQLite支持,所以如果有任何限制,它的大小就是支持SQLite数据库的大小。未保存的数据存储在RAM中,iOS不支持分页内存,因此未保存的数据集受设备上可用RAM的限制。如果您尝试超过RAM,您的应用将被关闭。如果您尝试超出磁盘空间,我认为保存操作将失败并带有适当的NSError。