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 8898667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:40:05+00:00 2026-06-15T00:40:05+00:00

I’m tracking memory leaks on my iOS application and I have a weird leak

  • 0

I’m tracking memory leaks on my iOS application and I have a weird leak that makes my application crashed …
The responsible frame is : CGImageMergeXMPPropsWhithLegacyProps.
At some point my app received a memory warning …

I’m creating UIImage from ALAsset like this :

    ALAsset *asset = [assetsArray objectAtIndex:index];
    UIImage *image = [UIImage imageWithCGImage:[[asset defaultRepresentation] fullScreenImage]];

Do you have an idea how to solve this ?

  • 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-06-15T00:40:06+00:00Added an answer on June 15, 2026 at 12:40 am

    Hope this help.
    I also use the ALAsset, and I encountered memory warning. I’m still searching my solution for my app… The crash may be because iOS dealloc your view or objects because of memory warning. So, maybe preventing from memory warning is important. Keep peak memory low to bellow 30MB. I encountered memory warning for 50MB for ipad2 and didn’t get it from iphone4. Anyway, lower is the better.
    First of all,you can measure the memory
    by using instrument or the following code. It’s easier measure memory in code for logging.
    1. register a timer for repeatedly report memory usage, you can see the peak memory usage in this way.
    On other hand, I have no idea why this function will increase memory graduately.
    2. “iPhone Programming The Big Nerd Ranch Guide” book said iOS may have 24MB for graphical memory
    “Overuse of graphical memory is typically the reason why an application receives a low-memory warning. Apple suggests that you don’t use more than 24 MB of graphics memory. For an image the
    size of the iPhone screen, the amount of memory used is over half a megabyte. Each UIView, image, Core Animation layer, and anything else that can be displayed on the screen consumes some of the allotted 24 MB. (Apple doesn’t suggest any maximum for other types of data like NSStrings.)”
    So, review graphical memory usage.

    NSTimer * timeUpdateTimer = [NSTimer timerWithTimeInterval:0.1 target:self selector:@selector(reportMem) userInfo:nil repeats:TRUE];
    [[NSRunLoop mainRunLoop] addTimer:timeUpdateTimer forMode:NSDefaultRunLoopMode];
    
    
    -(void) reportMem{
    [self report_memory1];
    }
    
    -(void) report_memory1 {
    struct task_basic_info info;
    mach_msg_type_number_t size = sizeof(info);
    kern_return_t kerr = task_info(mach_task_self(),
                                   TASK_BASIC_INFO,
                                   (task_info_t)&info,
                                   &size);
    natural_t freem =[self get_free_memory];
    if( kerr == KERN_SUCCESS ) {
        NSLog(@"Memory in use %f %f(free)", info.resident_size/1000000.0,(float)freem/1000000.0);
    } else {
        NSLog(@"Error with task_info(): %s", mach_error_string(kerr));
    }
    
    
    
    
    }
    
    
    -(natural_t) get_free_memory {
    mach_port_t host_port;
    mach_msg_type_number_t host_size;
    vm_size_t pagesize;
    host_port = mach_host_self();
    host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t);
    host_page_size(host_port, &pagesize);
    vm_statistics_data_t vm_stat;
    
    if (host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, &host_size) != KERN_SUCCESS) {
        NSLog(@"Failed to fetch vm statistics");
        return 0;
    }
    
    /* Stats in bytes */
    natural_t mem_free = vm_stat.free_count * pagesize;
    return mem_free;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

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.