Feat:Improve the usage of the Recognizer in the Demo to reduce memory… #212
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.
我看到作者会中文加之我的英文较差怕引起歧义使用中提出此PR。
这一个非常棒的项目,帮我解决了一些项目中的问题。
(1) 我发现Demo在持续运行时内存不断增加。点击停止后按钮内存依旧没有回收。
在翻阅Issues发现类似问题类似Issues
我发现问题有两个:
问题1. Recognizer在Native指针始终没有释放所以点击停止录音并没有释放对应内存
问题2. 持续录制时会不断存储缓存并从不释放,比较核心的代码如下。Expand内部代码内部调用PushArc将内存占用情况劣化。openfst我看到有内存gc机制由于我对于音视频知识匮乏暂无往下继续研究。这个情况我在IOS也发现存在。
此PR主要解决问题1