Open fikricanc opened 1 year ago
Hi!
Thank you for providing this. Its an annoying booboo that I'll dive deeper after my other projects. Hope its not game breaking for your app.
Thanks for responding! I'll try take a look at the source code and see if I can help identify the issue too. It's worth noting that I've also noticed similar memory leak problems in other emoji picker libraries.
I'll keep you updated on my findings.
Thanks again for your help!
Thanks, any help is appreciated!
I'd like to contribute. However, this is not doable for now, due to lack of permission.
To fix it, apply 'weak' to delegate property to avoid from reference cycle.
Could you please apply this small change to the main branch? Thanks. @Finalet
On ElegantEmojiPicker.swift
public var delegate: ElegantEmojiPickerDelegate?
->
public weak var delegate: ElegantEmojiPickerDelegate?
And on ElegantEmojiPickerDelegate.swift
public protocol ElegantEmojiPickerDelegate
->
public protocol ElegantEmojiPickerDelegate: AnyObject
Thanks for the input, I will look into it!
In terms of contributing:
However, this is not doable for now, due to lack of permission.
Are you unable to fork and create a pull request to the base repository? @loongman
The original issue should be fixed now.
However, found another quite interesting issue.
As you can see on the screen recording, after switch among different categories on the toolbar, memory increased rapidly, it stay there even after closed the picker.
After some quick investigations, it seems the OS generated huge cache(1000+ Malloc Blocks) for label.text = emoji.emoji
on EmojiCell.swift
. If simply replace that code line as label.text = "A"
, then, that behavior(1000+ Malloc Blocks) is no longer observable.
Any thoughts/suggestions on that? @Finalet
https://github.com/Finalet/Elegant-Emoji-Picker/assets/2167359/09adcb3c-f547-4b3c-b3fc-1c681f707c09
Have you tried switching the app to the background? I found that it seems to reduce memory usage to a reasonable level.
Good finding. @zizicici
Memory usage can also be reduced if apply 'Debug -> Simulate Memory Warning' to Simulator.
Hi,
First of all, thank you for creating this!
However, I have noticed a memory leak when using the library. EmojiPicker never gets released from memory.
You can reproduce this issue on Demo app.
Steps to reproduce:
Thanks in advance!