I have an app that currently holds all state in memory. It fetches a bunch of information from a server as JSON and then holds on to the JSON values in memory. Each JSONObject
can be ~300 bytes and there can be thousands of such objects.
I use this data simply to populate UITableView
.
In order to better handle large amounts of aata, I modified my code to fetch data from the server and store it using CoreData. There JSON objects can be represented as simple entities, each with 3 NSString
attributes and one 1 int32 attribute. I created a NSFetchedResultsController
to use as the data source of the UITableView
. My assumption was that this would reduce the resident memory usage of my application (I assume NSFetchedResults
controllers effectively manages memory to not hold entities that aren t being displayed in the view, vs holding all my state in-memory).
For the purposes of this discussion, let s assume my app purges the CoreData store and re-fetches all data each time it runs.
当我用仪器跟踪器衡量居民记忆和虚拟规模的变化时,我注意到这两个数值几乎相同。 事实是,我用核心数据表示的记忆似乎比我完全掌握本底时多。
While this may be true, I don t have an intuition for why this might be so. Any explanations? From what I have said about my app, does it sound like I don t want to bother persisting in CoreData, and why?