Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3751518
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:05:10+00:00 2026-05-19T09:05:10+00:00

Dear communtity. I has a very strange leak, which i can’t catch up by

  • 0

Dear communtity. I has a very strange leak, which i can’t catch up by instruments. Application eat a memory very quickly from 200M to 450M for one cycle of removing. Call threes list for objects list show me that a problem in NSManagedObjectContext NSFetchRequest-> processRecentChanges-> propagatePendingDeletesAtEndOfEvent.
Data amount is not big, current sqllite store is 37Mb, and memory doesn’t free after process is done.

NSError *error = nil;
NSManagedObjectContext *moc = [self managedObjectContext];
NSFetchRequest *requestCarrier = [[NSFetchRequest alloc] init];
[requestCarrier setEntity:[NSEntityDescription entityForName:@"DestinationsListForSale"
                                      inManagedObjectContext:moc]];
[requestCarrier setPredicate:[NSPredicate predicateWithFormat:@"(carrier.name == %@)",
                              carrierName]];
NSArray *destinationsListsForSale = [moc executeFetchRequest:requestCarrier error:&error];

if (error) NSLog(@"Failed to executeFetchRequest to data store: %@", [error localizedDescription]); 
for (NSManagedObject *destinationForSale in destinationsListsForSale) [moc deleteObject:destinationForSale];


[requestCarrier release], requestCarrier = nil;
destinationsListsForSale = nil;

requestCarrier = [[NSFetchRequest alloc] init];

[requestCarrier setEntity:[NSEntityDescription entityForName:@"DestinationsListWeBuy" inManagedObjectContext:moc]];
[requestCarrier setPredicate:[NSPredicate predicateWithFormat:@"(carrier.name == %@)", carrierName]];
NSArray *destinationsListsWeBuy = [moc executeFetchRequest:requestCarrier error:&error];
if (error) NSLog(@"Failed to executeFetchRequest to data store: %@", [error localizedDescription]); 
for (NSManagedObject *destinationWeBuy in destinationsListsWeBuy) [moc deleteObject:destinationWeBuy];

[requestCarrier release], requestCarrier = nil;
destinationsListsWeBuy = nil;

SOLUTION v.1
rebuild code to move out problem

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
for (NSManagedObject *destination in destinationsList)
{
    [moc deleteObject:destination];
    if (x % 10 == 0) {
        [moc save:&error];
        if (error) NSLog(@"Failed to save to data store removePreviousDestinationsFromMainDatabaseForCarrier: %@", [error localizedDescription]);
        [pool drain],pool = nil;
        pool = [[NSAutoreleasePool alloc] init];
    }
    x++;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T09:05:11+00:00Added an answer on May 19, 2026 at 9:05 am

    Have you tried just fetching the NSMangedObjectID in your code, as suggested in this answer?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Dear stackoverflowers, I have a website in which you can open a page (with
Dear All We had developed a hr application(winform) which consist of almost 98 forms
Dear community members, I have a small problem, which involves a text input field
Dear members of the Stackoverflow community, We are developing a web application using the
Dear Stackoverflowers, I am trying to build a simple web application in ASP.NET where
Dear visitors stackoverflow! I can not solve a simple problem: Body given the background
Dear iPhone Developers, I am writing a Navigation based iPhone application. I want to
Dear Friends good afternoon. My problem may be this is very basic one i.e.
Dear honorable people of stackoverflow, why is my textbox, which is my validated control,
dear all.. i have a DB which built use Mysql. for this case, i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.