Re: CoreData huge memory usage - is this right ?
Re: CoreData huge memory usage - is this right ?
- Subject: Re: CoreData huge memory usage - is this right ?
- From: Diederik Hoogenboom <email@hidden>
- Date: Mon, 17 Dec 2007 17:39:22 +0100
Hi Martin,
I have noticed that it is good practice not to save too many MO's in
one save: operation (max 10,000 or so). What you can do is start
inserting the objects in one MOC, save this MOC in a separate thread
and start inserting in a new MOC concurrently (make sure you don't
have dependencies between the objects in the (unsaved) MOCs).
- Diederik
--
Diederik Hoogenboom
AIM: obviousmatter
Twitter: obviousmatter
Obvious Matter - DiskLibrary for Mac
http://www.obviousmatter.com
On 17 dec 2007, at 15:25, Martin Linklater wrote:
Following up on my earlier thread I have cleaned up a lot of my own
memory leaks but I am still seeing CoreData take a lot of memory up.
By the time my application has imported around 500,000 entries my
application memory usage is over 2GB and my machine starts to crawl.
At this point the SQLite store that I'm actually creating is around
20MB in size.
When I run my application through 'Instruments' and get it to trace
Object Allocations I'm seeing a lot of memory (over 50% of total)
being used by Core Data - at the [NSManagedObjectContext save:]
method. This memory use just keeps growing and growing as my
application executes.
I have disabled undo during import and I have set the
stalenessInterval to 1.0. I have my own NSAutoreleasePool which gets
drained every 1000 entries.
I must still be doing something silly - anyone got any ideas ?
Thank you.
_______________________________________________
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
_______________________________________________
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