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

  • Home
  • SEARCH
  • 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 1108011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:01:06+00:00 2026-05-17T02:01:06+00:00

using sdk 4.1. I’m getting growing memory footprint followed by crash (observed in Instruments)

  • 0

using sdk 4.1. I’m getting growing memory footprint followed by crash (observed in Instruments) when loading a thumbnail image into imageview in table view cell. In addition scrolling is very jerky even with just 7-8 cells

    - (UITableViewCell *)tableView:(UITableView *)tableView  
            cellForRowAtIndexPath:(NSIndexPath *)indexPath {

     static NSString *FavouritesCellIdentifier = @"cellIdentifier";


 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
 if (cell == nil) 
 {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
                                    reuseIdentifier:cellIdentifier] autorelease];

    UIImageView* imgView =  [[UIImageView alloc] initWithFrame:CGRectMake(10,
                                                                     16, 64, 64)];
    imgView.tag = kImageLabelTag;
    [cell.contentView addSubview:imgView];
    [imgView release];

   }

   UIImageView* imgView = (UIImageView*)[cell viewWithTag:kImageLabelTag];

    NSData *contactImageData = (NSData*)ABPersonCopyImageDataWithFormat(personRef,  
                                                    kABPersonImageFormatThumbnail);
    UIImage *img = [[UIImage alloc] initWithData:contactImageData];
   [imgView setImage:img]; 
   [contactImageData release];
  [img release];

    return cell;
  }

In viewdidunload i am setting self.tableview=nil , is there anyway to release the images held by the cell as memory footprint keeps growing even when navigating to totally different viewcontroller. Memory shoots up only when selecting the viewcontroller that holds this tableview.

  • 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-17T02:01:07+00:00Added an answer on May 17, 2026 at 2:01 am

    The reason for crash is that you’re releasing NSData object which you shouldn’t.

    And the scrolling of the table should be slow always because with each scroll, it will call cellForRowAtIndexPath method & with it will create a new image.

    So try the below code & let me know whether it works or not

    - (UITableViewCell *)tableView:(UITableView *)tableView  
         cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *FavouritesCellIdentifier = @"cellIdentifier";
    
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    if (cell == nil) 
    {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
                                       reuseIdentifier:cellIdentifier] autorelease];
    
        UIImageView* imgView =  [[UIImageView alloc] initWithFrame:CGRectMake(10, 16, 64, 64)];
        imgView.tag = kImageLabelTag;
        [cell.contentView addSubview:imgView];
        [imgView release];
    
        NSData *contactImageData = (NSData*)ABPersonCopyImageDataWithFormat(personRef, kABPersonImageFormatThumbnail);
        UIImage *img = [[UIImage alloc] initWithData:contactImageData];
        [imgView setImage:img]; 
        [img release];
    
    }
    
    return cell;
    

    }

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

Sidebar

Related Questions

I am just getting started with flex and am using the SDK (not Flex
I'm using the MultiPoint SDK to create a collaborative educational application for children in
Is there a way using the iPhone SDK to get WiFi information? Things like
How do I create a self-signed certificate for code signing using the Windows SDK?
How would I expose an Objective-C method within JavaScript when using the iPhone SDK
In Microsoft Oslo SDK CTP 2008 (using Intellipad) the following code compiles fine: module
I'm new to Flex SDK and trying to implement a simple project using Doug
How does one bind an iPhone SDK control (say a UISlider) using Interface Builder?
I built a template-based document generator using the Open XML SDK (1.0) , the
I am using the example from TheElements sample code provided with the iPhone SDK

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.