-
Notifications
You must be signed in to change notification settings - Fork 25
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
Translation unit cache is never cleared #4
Comments
Yes, this is a major issue. I also encountered it a few weeks ago, when I started using clang-tags on a big project at work (around 200 translation units, ~1000 files in total). Until now, I just used the following quick and dirty patch to limit cache size to only one translation unit.
But like you, I think a better solution would be to limit the cache size to a maximum size, discarding oldest TUs. While I more or less see how to implement a limit to the number of TUs, I have absolutely no idea how to limit the memory size (or even how to measure the memory consumption of a given TU) |
By the way, which platform do you use clang-tags on ? I've been working lately on a feature to have If you are using Mac OS X or a non-linux kernel, I think I should consider using a higher-level file alteration monitoring system or try to provide another implementation using kqueue or fsevents... |
I think it might be possible to get the memory usage of a translation unit (http://clang.llvm.org/doxygen/group__CINDEX__TRANSLATION__UNIT.html), so I'll see what I can do with that. I'm using Linux, but I'd imagine that other people would probably find OS X support useful. |
Very nice! Thanks. I'm currently in the process of cleaning the Although the |
When indexing a project of mine, the memory usage of
clang-tags-server
grows to over 4GB after parsing about 100 files - the main cause of the memory usage seems to be the caching of translation units.The simplest fix would be to just disable the caching of translation units while indexing, but I think a better fix would be to limit the cache to a maximum number of translation units and/or a maximum memory size so that this problem doesn't occur for
clang-tags complete
as well.What do you think?
The text was updated successfully, but these errors were encountered: