I have a number of images I am filtering and when I do this in a serial queue that I create ,the memory is released after each block is complete. When I dispatch this work to the global GCD queue the memory doesnt release and gets out of control.
I wrapped the statements in an autorelease block but that doesnt seem to make a difference.
Is it due to the fact that the thread pool keeps references to the blocks somehow? After a while the memory gets released, but the app will crash before this with a large number of images.
Why is the memory being kept by the global queue and how could this be fixed so it releases after every block?
dispatch_apply
which will limit the number of concurrent operations. IMEdispatch_apply
will not create more than 2 * #cores threads. (Although that doesn't account for other, concurrent operations that may create threads.) - ipmcc