When using things like GCD, there is an autostart pool, but you cannot find out when (if ever) the autostart pool is merged by default. If you are sure that atorealized objects are not being released, make sure that you understand that you are using threading api. If the memory serves me correctly, GCD calls (dispatch_async) will sort the abstract pools for you, BUT the actual pool depletion can take a lot of time. NSOperations, on the other hand, allows you to create auto-detection pools.
I have seen a memory leak detection in the Tools based on 10 second intervals, leading to false warnings about a memory leak due to the long delay before the automatic release pool was deleted. So try wrapping the violation code in:
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; ... [your code] ... [pool drain];
I would recommend not trying to replace all auto-implementers with manual versions. Using autorelease results in a balance calculation with saving / freeing in one place. Creating an object and then automatically realizing it immediately prevents many memory errors, in my opinion. Quick, easy. You will forget to release material when making manual calls. Errors when performing manual releases are especially dangerous.
Adhering to the pool itself gives you more control and during intensive work with resources it can sometimes be useful to create and merge your own pools. But, as always, try and check, do not make any assumptions.
Jeroen leenarts
source share