GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

Release the memory of renderTarget in GPUImageFramebuffer immediately

Open jdbbjd opened this issue 3 years ago • 0 comments

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.

jdbbjd avatar Nov 28 '20 03:11 jdbbjd