Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preventing beach balls



Yes, every method has NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; at the beginning and [pool release]; at the end. If they didn't, I'd be leaking a lot more than NSLocks.
Paul

----------Original Message----------
  On 3/3/07 12:13 , PGM (email@hidden) wrote:
> 
> On 3-Mar-07, at 3:06 AM, Paul Borokhov wrote:
> 
>> So...now that threads have been implemented...
>> It appears that NSLock is leaking memory. My application performs 
>> regular updates and retrieves data every 6 seconds from the web. 
>> Each update is done by a separate method and each method is detached 
>> from the main thread when the timer fires. Now, NSLock uses 
>> continuously more memory as the application runs, according to 
>> ObjectAlloc. This is also happening to a lesser extent with CFBag, 
>> CFRunLoopSource, and NSRecursiveLock. I'm not using any of these in 
>> my code directly so I'm a bit curious as to why they are using 
>> memory, and more and more of it with each minute.
>> Any ideas?
>> Paul
> 
> Did you implement an NSAutoreleasePool for your threads? Otherwise 
> any object that will be sent an autorelease method will simply leak 
> memory.
> 
> Good luck, Patrick
> 
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Preventing beach balls (From: Paul Borokhov <email@hidden>)
 >Re: Preventing beach balls (From: PGM <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.