GPUImage
GPUImage copied to clipboard
Release the memory of renderTarget in GPUImageFramebuffer immediately
When I use GPUImage and AVMutableVideoComposition.customVideoCompositorClass to process 4K videos, there will be much large size GPUImageFramebuffer cached in GPUImageFramebufferCache. When I use GPUImageFramebufferCache 's purgeAllUnassignedFramebuffers to release all the GPUImageFramebuffer, the GPUImageFramebuffer will dealloc immediately, then the renderTarget in GPUImageFramebuffer will be released, but the memory of renderTarget was not released, so my app always crash easily. Then I found that if I create texture without CVOpenGLESTextureCacheCreateTextureFromImage, the memory of renderTarget can be released immediately, and Now I found a new function in iOS 11.0, which can also create a texture with IOSurface, and the the memory of renderTarget can be released immediately too.