librime doesn't release memory after maintainence
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.
Similar issue: https://github.com/rime/squirrel/issues/134 no memory leak was found previously.
There are many tricks may be take if you think the issue is about STL container.
- shrink_to_fit , but mostly limited to vector
- do deep copy on the data.
Have you ever tried to use run heap profiler like massif to see where can be improved?
There are many tricks may be take if you think the issue is about STL container.
- shrink_to_fit , but mostly limited to vector
- 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.