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

store cached translations #339

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

kolserdav
Copy link
Contributor

@kolserdav kolserdav commented May 1, 2023

Pull request fixing a bug in this issue #337

Created a global storage array of CachedTranslation objects by unique keys.

I tried to make as few changes as possible and as safe as possible. Perhaps this approach is not the best in terms of code style and in the future it may be refactored, but for now the main thing is that it completely eliminates a huge part of the memory leak due to the fact that objects are not created each time new ones, but once created from memory are taken.

@kolserdav
Copy link
Contributor Author

kolserdav commented May 1, 2023

Video demo https://youtu.be/UoMVIKUTWJ0

@argosopentech argosopentech merged commit 598532b into argosopentech:master Jun 23, 2023
@argosopentech
Copy link
Owner

Wow! Thanks for submitting this

I had heard reports that there might be a memory leak in LibreTranslate but had no idea where.

https://community.libretranslate.com/t/libretranslate-under-load/482

https://community.libretranslate.com/t/memory-leak-in-argos-translate/638

@kolserdav kolserdav deleted the fix-memory-leak branch June 23, 2023 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants