GPUImage2
GPUImage2 copied to clipboard
Memory leaking - From 70 MB to 700MB, and never releases it
Hello. First of all, I would like to thank the author for this library. It's very intuitive and I consider it much better than CoreImage.
I'm developing a camera app, but I'm facing a huge memory leak. The memory goes from 100 MB to 700MB in matter of seconds, and I have no idea why. Even after I close my controller or release the images, the memory is not release, it only grows more and more.
How can I fix this problem? I don't understand how memory is leaking, I don't know where all this malloc is coming from :(
To begin to debug this, what are you doing when the memory is increasing? What specific actions are you taking that use the framework?
Hello! The memory is drastically increased when I execute this method a few times (it's not a live feed, I just apply filter to 6 images). The input image was created using CoreImage. May be there is a correlation? I believe I might be doing something wrong, but I'm unable to check where and why
func getFilter(_ imageParam: UIImage) -> UIImage? {
var uiimage = imageParam
if let ciImage = uiimage.ciImage{
let cgImage = cicontext.createCGImage(ciImage, from: ciImage.extent)
uiimage = UIImage(cgImage: cgImage!)
}
let rgb = RGBAdjustment()
rgb.red = 1.1
rgb.green = 1.25
rgb.blue = 1.74
let levelAdjustment = LevelsAdjustment()
levelAdjustment.minimum = Color(red: 21.0/255.0, green: 21.0/255.0, blue: 21.0/255.0)
let filteredImage = uiimage.filterWithPipeline { (input, output) in
input --> levelAdjustment --> rgb --> output
}
return filteredImage
}
I observed same behavior using the predecessor of GPUImage2, and looks like there is something similar here. In my case, I was applying a filter to static images few times and got huge memory allocation, and never deallocating.
Hi all, I have faced the same problem. I'm applying filters to series of pictures and the memory is being increased drastically. Is there anyone who has found a solution for this situation?
@ilkayaktas : I'm also facing the same kind of issue. Have you found the solution. How to deallocate the memory in this case.
@smanojarun Unfortunately i gave up looking for a solution. I switched to CoreImage for image processing. It's better.
Got it @ilkayaktas .Thanks.
Anything new?