Re: Memory Problems
Re: Memory Problems
- Subject: Re: Memory Problems
- From: Jens Alfke <email@hidden>
- Date: Fri, 5 Feb 2010 19:49:29 -0800
On Feb 5, 2010, at 5:49 PM, Greg Robertson wrote:
> I'm fairly certain I do not have a memory leak it is just that the NSString is very large. Is there anyway to increase the memory allocated or clean up the code to reduce its memory usage?
Use an NSAutoreleasePool (check the docs) inside every iteration of the loop. Autoreleased objects don't get freed until the nearest autorelease pool exits, and as written that's not going to happen until your method returns, so everything that gets allocated in it fills up memory.
—Jens_______________________________________________
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