-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory Leak #25
Comments
Hello @dfmarulanda , I'm sorry to hear this. But I can't reproduce it in my own project (using KingfisherWebP 0.5.0, Kingfisher 5.5.0, libwebp 1.0.2 & Xcode 10.2). After double checking the implementation of |
This is my code. viewModel.imageURL.map { itemImages in
let processor = WebPProcessor.default
let inputs: [KingfisherSource] = itemImages.compactMap({ return KingfisherSource(url: URL(string:$0!)!, options: [.transition(.fade(0.33)), .processor(processor), .cacheSerializer(WebPSerializer.default), .scaleFactor(UIScreen.main.scale)]) })
return inputs }
.observeOn(MainScheduler.instance)
.subscribe(onNext: { [unowned self] inputs in
self.itemSlideShow.setImageInputs(inputs)
}).disposed(by: disposeBag) |
I'm guessing you are using override func viewDidDisappear(_ animated: Bool) {
KingfisherManager.shared.cache.clearMemoryCache()
} |
I changed everything from WebP to JPG and remove the library, and i have no leaks right now. |
Hello, have you tried the |
I experience exactly same issue. Massive memory leaks but no issues with JPG and default Kingfisher processors. |
I experience exactly same issue , try |
我也遇到了 内存暴涨的问题··· 请问你是怎么解决的?
|
Hi @duyhungtnn @WangKunKun @Out1and3r , I'm investigating this problem now, but cannot reproduce it myself currently. In order to make sure it's not the cache feature in Kingfisher itself, would you mind trying these methods in your projects? // Limit memory cache size to 20 MB.
cache.memoryStorage.config.totalCostLimit = 20 * 1024 * 1024
// Limit memory cache to hold 50 images at most.
cache.memoryStorage.config.countLimit = 50 The code above is taken from Kingfisher Cheat-Sheet, please let me know whether it works or not. Thank you all 🥺 |
It happened to me at Animated WebP list when I load more items . |
it's fine now and memory used return to normal since I changed all webp url to gif. |
@zhangzhifangi no , after many hour to try :(
…On Wed, Jul 8, 2020 at 3:42 PM zhangzhifangi ***@***.***> wrote:
Hello, did the latest version solve this problem of memory explosion
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAT2GTSVZFS3A7W4OQ5WSPTR2QWNNANCNFSM4HOF7Q5A>
.
--
*Phạm Duy Hưng*
iOS Lead Engineer
+84 9 7467-5965 | https://umbala.tv/ | [email protected] | North Sunrise
City, 27 Nguyen Huu Tho
<https://maps.google.com/?q=27+Nguyen+Huu+Tho&entry=gmail&source=g>, D7,
HCM City
|
I believe the leak is mostly caused by the following allocation:
It is this line: https://github.com/Yeatse/KingfisherWebP/blob/7f5e0f5eb0e799e09d6850a0da85ace97f8d9a74/KingfisherWebP/Classes/CGImage%2BWebP.m#L260 I can't see this memory being deallocated anywhere. @yeatse when can we free this buffer? |
Thanks for pointing it out. The memory pointed by You can test it yourself by forcing KingfisherManager.shared.defaultOptions += [.forceRefresh] |
Thanks for the explanation. I didn’t see that callback. |
内存暴增是由于缓存了解析的每一帧图,目的是降低CPU的消耗 |
NSCache 本身会在收到 memory warning 的时候清理资源所以感觉还好,不加的话在某些场景会非常卡。后面我可以提供个开关配置下。 |
I'm getting around 500MB of memory leak with this lib.
The text was updated successfully, but these errors were encountered: