• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CoreData huge memory usage - is this right ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData huge memory usage - is this right ?


  • Subject: Re: CoreData huge memory usage - is this right ?
  • From: email@hidden
  • Date: Fri, 14 Dec 2007 06:57:06 -0800

On Friday, December 14, 2007, at 12:39PM, "Martin Linklater" <email@hidden> wrote:
>Hi - I'm in the process of writing code which will create and populate a CoreData SQLite store. I have a few million objects to deal with. I have written code which imports a text description of my data and then iterates through inserting and setting attributes of my CoreData objects. Things are going fine with the exception of one problem I am having... I am seeing CoreData take huge amounts of RAM to do it's thing. When my SQLite store is at around 10MB in size, my task is taking upwards of 500+MB of memory.

  Hmm, do you have a lot of relationships ? Many to many relationships with inverses eats a lot of memory, because both collections are fetched in a simple addObject =/

[ ... snip ... ]

>This code is executing fine, and my elements are indeed being inserted into the CoreData store because I have ran this code with an XML store and things are being stored fine. Saving of the moc is returning with no errors too.
>
>So I am stumped as to why CoreData is allocating an awful lot of memory for this task... can anyone shed some light on what I'm doing wrong

  You can check the [NSManagedObjectContext setStalenessInterval:] documentation, disable the undoManager, read the http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdMemory.html#//apple_ref/doc/uid/TP40001860  and use a NSAutoreleasePool, even under GC (remember to use drain instead of release).


:: marcelo.alves
_______________________________________________

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

  • Follow-Ups:
    • Re: CoreData huge memory usage - is this right ?
      • From: "I. Savant" <email@hidden>
References: 
 >CoreData huge memory usage - is this right ? (From: Martin Linklater <email@hidden>)

  • Prev by Date: CoreData huge memory usage - is this right ?
  • Next by Date: Re: CoreData huge memory usage - is this right ?
  • Previous by thread: CoreData huge memory usage - is this right ?
  • Next by thread: Re: CoreData huge memory usage - is this right ?
  • Index(es):
    • Date
    • Thread