Releasing memory allocated by CoreData's _PFAllocateObjects function?
Releasing memory allocated by CoreData's _PFAllocateObjects function?
- Subject: Releasing memory allocated by CoreData's _PFAllocateObjects function?
- From: Nick Zitzmann <email@hidden>
- Date: Fri, 18 Mar 2011 16:25:06 -0600
Okay, I have a problem that has been driving me nuts all day now. I have an application that loads tens of thousands of CoreData managed objects across several threads, where each thread has its own unique managed object context.
When I run the allocations instrument in Instruments, I can see that an eight digit amount of bytes is being gobbled up & not freed by thousands of 320 byte mallocs, each of which has the following stack trace:
0 CoreData _PFAllocateObjects
1 CoreData +[NSSQLRow newBatchRowAllocation:count:forSQLEntity:withOwnedObjectIDs:andTimestamp:]
2 CoreData -[NSSQLCore _prepareResultsFromResultSet:usingFetchPlan:withMatchingRows:]
3 CoreData -[NSSQLCore _newRowsForFetchPlan:selectedBy:withArgument:]
4 CoreData -[NSSQLCore newRowsForFetchPlan:]
5 CoreData -[NSSQLCore _prefetchRelationshipKey:sourceEntityDescription:sourceObjectIDs:prefetchRelationshipKeys:inContext:]
6 CoreData -[NSSQLCore _prefetchWithFetchRequest:withObjectIDs:inContext:]
7 CoreData -[NSSQLCore _newRowsForFetchPlan:selectedBy:withArgument:]
8 CoreData -[NSSQLCore newRowsForFetchPlan:]
9 CoreData -[NSSQLCore objectsForFetchRequest:inContext:]
10 CoreData -[NSSQLCore executeRequest:withContext:]
11 CoreData -[NSPersistentStoreCoordinator(_NSInternalMethods) executeRequest:withContext:]
12 CoreData -[NSManagedObjectContext executeFetchRequest:error:]
Question: What does my program have to do to release all of that memory? I've already tried resetting and releasing the managed object contexts, and Instruments confirms that they're gone, but that doesn't clean up this memory. And without the CoreData source code, I can't tell what action is supposed to free up the memory.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden