Leaks in every filter when used via Cocoapods.(Workaround/Fix) #1748
Comments
#1435 is also about the same issue. |
|
@atishay811 |
hey @demon1105 does it mean, that if I installed the latest release (0.1.6) with CocoaPods I won't be having this issue anymore? I still think that the GPUImageFilter leaks for me - 6 filtered images cause 40 MB of memory, which just won't go away for some reason... |
@MartinHerman - That's something completely different. This leak was never substantial. What you're seeing is the expansion of the framebuffer cache, which will expand the cache as needed. That may cause the allocation of additional memory at times, but the cache will purge itself on a memory warning. If the cache is not purging itself, or is triggering memory-related crashes, that's something to be concerned with, but is unrelated to the minor memory leak described here. |
@BradLarson thanks for the prompt reply! |
@MartinHerman You can manually trigger a purge using
but this will only purge any framebuffers not actively tied to a UIImage in memory, or a filter being processed. If the above does nothing, then you're hanging on to images longer than you should, and might need to look to make sure you don't have UIImages staying behind in memory when they shouldn't. You may need to rearchitect your filtering process. |
@BradLarson yes! That does it for me. |
@MartinHerman |
Use OS_OBJECT_USE_OBJC instead of __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0 for ARC check for GCD or drop iOS 5 altogether.
TL; DR
Coming of a 5 hour investigation. It is a weird combination of Cocoapods, GPUImage and ARC that causes this leak.
__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0
checks. It does not useOS_OBJECT_USE_OBJC
check which is the correct way to see if ARC for GCD is supported.As a workaround, I have created a local podspec with ios minimum specified as iOS 7. This fixes the bug for me. I can create a pull request with the entire set of find replace throughout the code, but it seems like a waste of time as just changing a number in the podspec fixes this issue. (The shouldn't be a huge number of developers needing GPUImage against iOS5 SDK)
The text was updated successfully, but these errors were encountered: