[PATCH] D88415: [clangd] Introduce memory usage dumping to TUScheduler, for Preambles and ASTCache

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 6 02:57:23 PDT 2020


sammccall added inline comments.


================
Comment at: clang-tools-extra/clangd/TUScheduler.cpp:1445
+void TUScheduler::attachMemoryUsage(MemoryTree &MT) const {
+  IdleASTs->attachMemoryUsage(*MT.addChild("ast_cahe"));
+  // Otherwise preambles are stored on disk and we only keep filename in memory.
----------------
should we group by file instead? The fact that the AST-cache is owned by TUScheduler and not ASTWorker seems like a confusing detail that it might be better to omit


================
Comment at: clang-tools-extra/clangd/TUScheduler.cpp:1450
+    for (const auto &Elem : fileStats())
+      Preambles.addDetail(Elem.first())
+          ->addUsage(Elem.second.UsedBytesPreamble);
----------------
why aren't we also using the UsedBytesAST estimate here, and instead walking through the cache directly?


================
Comment at: clang-tools-extra/clangd/TUScheduler.h:316
 
+  void attachMemoryUsage(MemoryTree &MT) const;
+
----------------
(raised naming of these functions in another patch, however that ends up let's ensure they match)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88415/new/

https://reviews.llvm.org/D88415



More information about the cfe-commits mailing list