• 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
leaking memory in Core Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

leaking memory in Core Data


  • Subject: leaking memory in Core Data
  • From: "John R. Timmer" <email@hidden>
  • Date: Sat, 10 Nov 2007 21:23:30 -0500

Thanks to the advice of Apple employees who responded to my earlier question, I dramatically reduced my memory use. I am, however, still seeing a very low rate of memory leaks. These are very rare (i found 6 after processing 10K of records), but I'm doing a massive import, and they add up. They occur regardless of whether I'm using manual memory management or garbage collection, and eventually run me out of memory or kill the performance in 64bits.

Using Malloc Debug, i've tracked it down to something that happens after I establish a relationship between two objects, but the leak occurs deep in the Core Data methods that follow. I've pasted in the call stack below, with my methods bolded. The "addHierarchyLeafObject:" method is just the standard one produced by XCode at this point.

I could probably handle importing by spawning a series of child processes, so that the leaks die with the process, but I'd prefer to avoid the hassle. Is there any way to set up a relationship without running into this problem?

Thanks for any advice,

John


STACK
Address /1e9ae000/size/0000326c
0x00067ea9 / 0x67ea9 / libMallocDebug.A.dylib
0x913fc444 / PF_ALLOCATE_OBJECT_ARRAY / CoreData
0x9141f6c0 / newFetchedRowsForFetchPlan_MT / CoreData
0x91452ae1 / -[NSSQLCore newFetchedPKsForSourceID:andRelationship:] / CoreData
0x9145258f / -[NSSQLCore retainedRelationshipDataWithSourceID:forRelationship:withContext:] / CoreData
0x914522f7 / -[NSFaultHandler retainedFulfillAggregateFaultForObject:andRelationship:withContext:] / CoreData
0x91429241 / -[_NSFaultingMutableSet willRead] / CoreData
0x9142c037 / -[_NSFaultingMutableSet count] / CoreData
0x9141003c / -[NSManagedObject(_NSInternalMethods) _newPropertiesForRetainedTypes:andCopiedTypes:preserveFaults:] / CoreData
0x9140fd70 / -[NSManagedObject(_NSInternalMethods) _allProperties] / CoreData
0x9140fc64 / -[NSManagedObjectContext(_NSInternalChangeProcessing) _establishEventSnapshotsForObject:] / CoreData
0x91413036 / _PFFastMOCObjectWillChange / CoreData
0x91443a53 / -[NSManagedObject willChangeValueForKey:withSetMutation:usingObjects:] / CoreData
0x000087ad / -[jt_HierarchyObject addHierarchyLeafObject:] / ImportApp
0x91451434 / -[NSManagedObject(_NSInternalMethods) _includeObject:intoPropertyWithKey:andIndex:] / CoreData
0x914128b1 / -[NSManagedObject(_NSInternalMethods) _didChangeValue:forRelationship:named:withInverse:] / CoreData
0x925e6f8e / NSKVONotify / Foundation
0x925639c2 / -[NSObject(NSKeyValueObserverNotification) didChangeValueForKey:] / Foundation
0x914125c7 / -[NSManagedObject didChangeValueForKey:] / CoreData
0x000081d5 / -[jt_ThreadedImport createHierarchy] / ImportApp
0x9256704d / -[NSThread main] / Foundation
0x92566bf4 / __NSThread__main__ / Foundation
0x96b82075 / _pthread_start / libSystem.B.dylib
0x96b81f32 / thread_start / libSystem.B.dylib
ENDSTACK
_______________________________________________


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


  • Prev by Date: re:[Core Data] Lightweight Objects
  • Next by Date: Misc questions
  • Previous by thread: Re: IKImageView Behavior
  • Next by thread: re: leaking memory in Core Data
  • Index(es):
    • Date
    • Thread