Bug 358482

Summary: LRU cache of TU's for files opened in editor
Product: [Applications] kdevelop Reporter: Milian Wolff <mail>
Component: Language Support: CPP (Clang-based)Assignee: kdevelop-bugs-null
Status: CONFIRMED ---    
Severity: normal CC: aleixpol
Priority: VHI    
Version First Reported In: git master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Milian Wolff 2016-01-24 14:01:47 UTC
Currently we keep the TU's in memory for all files that are opened in an editor. This can lead to high memory consumption. We should instead implement a manual LRU cache of N translation units.

Reproducible: Always
Comment 1 Aleix Pol 2016-06-14 13:28:16 UTC
Is that really a release blocker? This bug report needs quite some love otherwise.
Comment 2 Milian Wolff 2016-06-14 14:09:31 UTC
OK, lets remove the tag. I do think it should be implemented though.

Currently, we put the clang data into the IAstPtr. That one only gets cleared once the file is not opened in the editor anymore. That means, if you have a hundred files open in KDevelop, you'll keep a hundred clang TUs in memory, which has a significant impact.

Instead, we should not store the data in the IAstPtr but instead have our own kdev-clang specific thread-safe LRU that caches the last N clang TUs.