fix: lifetime of EspeakWrapper cannot be dropped - #224
Merged
Merged
Conversation
because in available_voices the function is marked as lru cache, and every time a EspeakBackend is inited, it will call support_languages once, this will cause the lifetime of one wrapper be hunge on once the function is invoked. And if with multi thread, every time the thread forks, the __init__ will be called, again, and more support_languages() will be called, then it will cause huge amount of folder being created under /tmp file, and last fd will run out, task will panic and exit
Contributor
Author
|
this did fix my problem.. before , after I ran it to 76 epoch, I will get 5000 folders.. then my program panic.. is this feature added recently? at least the author seems has run to the every end cannot believe one day I meet the gc problem in python |
Contributor
Author
|
@mmmaat friendly ping. This will become a huge problem when using Espeak in multi threads |
Collaborator
|
Hi, please update the CHANGELOG as well and I'll merge it, thanks. |
Contributor
Author
Thank you , added! |
Collaborator
|
close #223 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolve: #223
because in available_voices the function is marked as lru cache, and every time a EspeakBackend is inited, it will call support_languages once, this will cause the lifetime of one wrapper be hunge on once the function is invoked. And if with multi thread, every time the thread forks, the init will be called, again, and more support_languages() will be called, then it will cause huge amount of folder being created under /tmp file, and last fd will run out, task will panic and exit