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

logs record function memory leak #237

Open
git-jiadong opened this issue Oct 26, 2021 · 7 comments
Open

logs record function memory leak #237

git-jiadong opened this issue Oct 26, 2021 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@git-jiadong
Copy link

多个会话同时开启日志记录时,软件的内存增长得飞快

@git-jiadong
Copy link
Author

image
image

@git-jiadong
Copy link
Author

大概20分钟增长了100MB的内存

@kingToolbox
Copy link
Owner

Thank you. I will investigate this issue. However, this may not be a memory leak. It is most likely that the log module cached the content in memory and did not write to the file in time. If this is the case, I will try to increase the frequency of flushing the log.

Any progress will be updated here, please stay tuned.

@git-jiadong
Copy link
Author

感谢你的支持,我有好几次因为长时间保存日志程序退出的情况,而且我停止了日志保存内存也没有被回收

@kingToolbox
Copy link
Owner

kingToolbox commented Oct 26, 2021

If the memory has been allocated, it may only be released by restarting. The log module uses a third-party library spdlog, so I am not sure if it is wrong with my use or because it has too much internal caching. I remember that I forced the log to be flushed every minute to avoid memory usage. If the repair is simple, I will fix it in the upcoming prerelease 4 version, otherwise, it will be repaired in subsequent versions.

Because long-term testing is rarely done during development, this problem was not discovered in time, which caused you trouble. Sorry.

@git-jiadong
Copy link
Author

感谢你的回复,我会使用screen命令来代替WindTerm记录日志。期待你的新版本。

@kingToolbox kingToolbox self-assigned this Oct 26, 2021
@kingToolbox kingToolbox added the bug Something isn't working label Oct 26, 2021
@git-jiadong
Copy link
Author

应该时目前终端没有限制日志的缓存行数,导致长时间使用会无限制的占用内存。可以参考其他终端增加一个缓存行数的功能来解决这个问题。

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

2 participants