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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:46:11+00:00 2026-05-20T00:46:11+00:00

I am getting the following memory leak when using NSURL . I use this

  • 0

I am getting the following memory leak when using NSURL. I use this method in quite a few different places and receive memory leaks all the time using the Leaks instruments.

Object Management:

self.objManager = [[HJObjManager alloc] init];
NSString *cacheDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"/Library/Caches/App"];
HJMOFileCache *fileCache = [[[HJMOFileCache alloc] initWithRootPath:cacheDirectory] autorelease];
self.objManager.fileCache = fileCache;
fileCache.fileCountLimit = 100;
fileCache.fileAgeLimit = 60*60*24;
[fileCache trimCacheUsingBackgroundThread];

Where it’s used:

HJManagedImageV *mi = [[[HJManagedImageV alloc] initWithFrame:CGRectMake(self.myHeaderView.profilePictureImageView.bounds.origin.x,
                                                                         self.myHeaderView.profilePictureImageView.bounds.origin.y,
                                                                         self.myHeaderView.profilePictureImageView.bounds.size.width,
                                                                         self.myHeaderView.profilePictureImageView.bounds.size.height)] autorelease];

mi.layer.masksToBounds = YES;
mi.layer.cornerRadius = 8.0;
mi.layer.borderColor = [[UIColor blackColor] CGColor];
mi.layer.borderWidth = 1.0;

mi.url = [NSURL URLWithString:profilePictureUrl];
[mi showLoadingWheel];

[self.myHeaderView.profilePictureImageView addSubview:mi];
[self.objManager manage:mi];

Dealloc:

- (void)viewDidUnload {
    self.tv = nil;
    self.friends = nil;
    self.sortedFriends = nil;
    self.detailView = nil;
    self.profileView = nil;
    self.objManager = nil;
    [super viewDidUnload];
}

- (void)dealloc {
    [tv release];
    [friends release];
    [sortedFriends release];
    [detailView release];
    [profileView release];
    [objManager release];
    [super dealloc];
}

enter image description here

  • 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-20T00:46:12+00:00Added an answer on May 20, 2026 at 12:46 am

    You can use stack trace to determine the place of leak.

    Edit:

    make sure you are releasing the mi.url in dealloc method:

    -(void) dealloc {
       //some other releases
       self.url = nil;
    
       [super dealloc];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Instruments, I keep on getting pointed to a memory leak with a UIImage.
I'm trying to use the CRT memory leak detection but I keep getting the
When i run the instrument tool i'm getting memory leaks in the following lines,(NSString
I am getting the following error: Access denied for user 'apache'@'localhost' (using password: NO)
I'm getting the following error when trying to run a JSP. I'm using Tomcat
I'm getting the following error when trying to build my app using Team Foundation
I'm experiencing a memory leak when using WMI from Delphi 7 to query a
I have been getting a weird memory leak and i just pinpointed what is
I have a hard time grasping this memory leak in my code. Basically it's
I'm getting out of memory exceptions from the following function when RowCollection is 50000+

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.