From edd4a83ee3c887670afd077eeb1ddb8ce1976108 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 22 Jul 2020 18:44:40 +0200 Subject: Use salsa's purge to account for all memory --- crates/ra_ide_db/src/change.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide_db') diff --git a/crates/ra_ide_db/src/change.rs b/crates/ra_ide_db/src/change.rs index 32d9a8d1f..b13df8b85 100644 --- a/crates/ra_ide_db/src/change.rs +++ b/crates/ra_ide_db/src/change.rs @@ -190,11 +190,24 @@ impl RootDatabase { let q: $q = Default::default(); let name = format!("{:?} (deps)", q); acc.push((name, before - after)); + + let before = memory_usage().allocated; + $q.in_db(self).purge(); + let after = memory_usage().allocated; + let q: $q = Default::default(); + let name = format!("{:?} (purge)", q); + acc.push((name, before - after)); )*} } sweep_each_query![ // SourceDatabase ra_db::ParseQuery + ra_db::CrateGraphQuery + + // SourceDatabaseExt + ra_db::FileTextQuery + ra_db::FileSourceRootQuery + ra_db::SourceRootQuery ra_db::SourceRootCratesQuery // AstDatabase @@ -242,15 +255,24 @@ impl RootDatabase { hir::db::TraitImplsInCrateQuery hir::db::TraitImplsInDepsQuery hir::db::AssociatedTyDataQuery + hir::db::AssociatedTyDataQuery hir::db::TraitDatumQuery hir::db::StructDatumQuery hir::db::ImplDatumQuery + hir::db::FnDefDatumQuery + hir::db::ReturnTypeImplTraitsQuery + hir::db::InternCallableDefQuery + hir::db::InternTypeParamIdQuery + hir::db::InternImplTraitIdQuery + hir::db::InternClosureQuery hir::db::AssociatedTyValueQuery hir::db::TraitSolveQuery - hir::db::ReturnTypeImplTraitsQuery // SymbolsDatabase crate::symbol_index::FileSymbolsQuery + crate::symbol_index::LibrarySymbolsQuery + crate::symbol_index::LocalRootsQuery + crate::symbol_index::LibraryRootsQuery // LineIndexDatabase crate::LineIndexQuery -- cgit v1.2.3