• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Memory Leaks and ARC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory Leaks and ARC


  • Subject: Re: Memory Leaks and ARC
  • From: Keary Suska <email@hidden>
  • Date: Tue, 22 Apr 2014 16:47:49 -0600

On Apr 22, 2014, at 4:18 PM, Dave wrote:

> This is the main loop of the mainstay of the allocations, it runs this loop around 650 times loading images of varying sizes:
>
> myCount = [myURLArray count];
> LogIfDave(@"myURLArray: %@  Count: %i",myURLArray,myCount);
> for (myIndex = 0;myIndex < myCount;myIndex++)
> 	{
> 	myFileURLString = [myURLArray objectAtIndex:myIndex];
>
> 	myImage = [self commandDownloadImageWithFileURLString:myFileURLString];
> 	if (myImage == nil)
> 		{
> 		LogIfDave(@"Download Failed: %i  Count: %i",myIndex,myCount);
> 		continue;
> 		}
>
> 	LogIfDave(@"Download Image: %i  Count: %i",myIndex,myCount);
> 	}
>
> I assumed that ARC would release myImage on each interation of the loop, however, this seems not to be the case, since, I see a massive release when the test conpletes and the Thread terminates.
>
> Is this correct behaviour?

I understand that it is (or typically is). To get that behavior wrap the loop contents in an @autoreleasepool{}.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Memory Leaks and ARC (From: Dave <email@hidden>)

  • Prev by Date: Re: Strange toolbar/view/resize cursor interaction
  • Next by Date: Re: Strange toolbar/view/resize cursor interaction
  • Previous by thread: Memory Leaks and ARC
  • Next by thread: Re: Memory Leaks and ARC
  • Index(es):
    • Date
    • Thread