I am trying to do very little coreata import (about 25000 lines) while still maintaining a low memory footprint I have read the documents around the efficient import of data and have tried to implement all the suggestions (to silence anything like my MOC's undo manager).
Unfortunately, my applications memory usage still sit around the application 180 MB points on completion run code under climbs around 180 MB, regardless of the final Ansyuetioreiipyul pole groove call.
Running an application through allocation shows that 95% of the memory usage is due to my - your managed objects In addition to this, I should mention the two problems I am seeing your code: As mentioned above, > Save: Do not enter errors from the operation. You really want - it can highlight some (potentially unrelated) problem. If Save: is successful, you can actually enter [self]. Save Mok: & amp; Error] call what am I doing wrong here?
- (zero) GenerationCak {NSAUTOrilepoolPool = pool = [[NSAUTOriPeople Alok] INS]; NSUInteger count = 0, batch size = 1000; // SNIP SNIP // For our directory structure (in the directory structure for NSString * items) Overwrite {NSDictionary * info = [FM attributesoff itemmet path: item error: zero]; Failrekord * Record = (Failrekord *) [NSEntityDescription insertNewObjectForEntityForName: @ "FileRecordManagedObjectContext: self.moc]; record. Size = [Ansanmber with Snkyauddeshyiy link: [total file size]]; Record.path = item; count ++; if (count == batch size) {NSError * error = null; if ([self. mark Save: & amp; error]) saved by {Anselog (@ "MOC and reset"); [Swkmok reset]; [ Pool Drain]; Pool = [[NSAUTOriasPool Alok] Init]; Calculation = 0;}}} // Any necessary last minute M C delivers if (count! = 0) delivers {{self.moc save: nil]; [Swkmok reset];} // remove our Ansauteriyreppul [pool drain]; // Tell us the main thread that we what are if ([self Jwabः Tsesiyntrk: @ selector (Puarnkache)]) {[object with self-performing Onkmthred: @ selector (Puarnkache): zero wait until No]: Auto release cope with pool Instead, why not manage life clearly In the?}}
NSManagedObject < / Code> of initWithEntity: insertIntoManagedObjectContext: and secure them? You can safely release objects after modifying the properties, because a managed object context retains the newly added object - as long as it is not always saved in the store.
reset . See in the Core Data Guide
Comments
Post a Comment