Skip to content
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 leaks #11

Open
maree91 opened this issue Apr 15, 2023 · 4 comments
Open

Memory leaks #11

maree91 opened this issue Apr 15, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@maree91
Copy link

maree91 commented Apr 15, 2023

Great library but the memory leaks makes it unusable with over 400MB memory usage sometimes that persist even after deallocating multiple parent VCs. I think displaying each emoji in a single UILabel might not be the best way to do it.

@izyumkin
Copy link
Owner

I haven't achieved that much memory consumption, but yes, it's a big problem. For which, unfortunately, I still haven't found a solution. Even using the CoreText does not solve the problem.

The only working solution I have found is to display the emoji as a UIImage, this does not lead to such a large memory consumption.

If you have any ideas or suggestions on how to fix this, I will be glad.

@maree91
Copy link
Author

maree91 commented Apr 16, 2023

What about presenting the view controller with a scroll view.

On the bottom is a horizontal stack view representing the categories. Then on the scroll view you present a list of imageviewes vertically where each imageview represent an emoji category in a single image containing all the emojis related to the category. And when ever the user taps you detect the location of the particular emoji in place then either present the skin tone options or just dismiss the picker and get the selection.
You may also make a table view/ collection view for easier layout of the imageviews.

I am thinking outloud here and haven't thought it through really.

@izyumkin
Copy link
Owner

Interesting suggestion, I will be glad to see your contribution.

I want to still try to figure out how using UILabel you can display emoji without compromising memory. Since this is a global problem in Swift, it would be interesting to solve it and simplify the development of thousands of other developers.

In the current version, the library is still usable, since you will not be able to find analogues without this problem.

@izyumkin izyumkin added help wanted Extra attention is needed bug Something isn't working and removed help wanted Extra attention is needed labels May 25, 2023
@zizicici
Copy link

If the app back to background, the memory will be deallocated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants