• 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: Image Batch Processing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Image Batch Processing


  • Subject: Re: Image Batch Processing
  • From: Simone Tellini <email@hidden>
  • Date: Fri, 21 Sep 2007 17:29:09 +0200

Jere Gmail ha scritto:
HI, I've been trying to do a batch converter for images. The problem
is the memory is not being released properly. When the for ends the
memory is ok, but during the for it continues increasing. I have a
function with a for loop:
for(count=0;count<cant;count++)
{
path=[datos objectAtIndex:count];
save_name=[NSString stringWithFormat:
@"image_d.jpg",count+1];

while the for() is running you're creating several instances of autoreleased objects like the NSString in the line above. These objects are not released until the control returns to the run loop.


So if you don't want to keep on allocating memory during the loop, you can create an NSAutoreleasePool at the start and release it at the end. See http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Concepts/AutoreleasePools.html#//apple_ref/doc/uid/20000047

--
Simone Tellini
http://tellini.info

_______________________________________________

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


  • Follow-Ups:
    • Re: Image Batch Processing
      • From: "Jere Gmail" <email@hidden>
References: 
 >Image Batch Processing (From: "Jere Gmail" <email@hidden>)

  • Prev by Date: Re: Image Batch Processing
  • Next by Date: Re: Question about scope of "convenience objects"
  • Previous by thread: Re: Image Batch Processing
  • Next by thread: Re: Image Batch Processing
  • Index(es):
    • Date
    • Thread