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

librime doesn't release memory after maintainence #440

Open
wengxt opened this issue Jan 18, 2021 · 3 comments
Open

librime doesn't release memory after maintainence #440

wengxt opened this issue Jan 18, 2021 · 3 comments

Comments

@wengxt
Copy link
Contributor

wengxt commented Jan 18, 2021

Not sure if we use the API right, but we just simply call start_maintainence.

ibus-rime seems to be affected the same issue.

Easy way to reproduce it to remove all all start and start from a clean environment. The initial deployment will not release its memory.

图片

@lotem
Copy link
Member

lotem commented Jan 19, 2021

Similar issue: rime/squirrel#134
no memory leak was found previously.

@wengxt
Copy link
Contributor Author

wengxt commented Jan 19, 2021

There are many tricks may be take if you think the issue is about STL container.

  1. shrink_to_fit , but mostly limited to vector
  2. do deep copy on the data.

Have you ever tried to use run heap profiler like massif to see where can be improved?

@lotem
Copy link
Member

lotem commented Jan 19, 2021

There are many tricks may be take if you think the issue is about STL container.

  1. shrink_to_fit , but mostly limited to vector
  2. do deep copy on the data.

Have you ever tried to use run heap profiler like massif to see where can be improved?

No, I haven't. I don't think improving dictionary building is worth the effort.
Ideally deployment should be done offline. https://github.com/rime/weasel has it implemented as a separate depoyer process. For Linux and macOS, there is the rime_deployer executable to do the same, but it has to access user data files exclusively. The missing part is a cross-platform way to communicate with the running engine process and temporarily put it in maintenance mode.

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

No branches or pull requests

2 participants