mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Track VFS and remaining/unaccounted memory
This commit is contained in:
parent
93d0ac7fa0
commit
f01e7e3601
1 changed files with 14 additions and 4 deletions
|
@ -273,12 +273,22 @@ pub fn analysis_stats(
|
||||||
println!("Total: {:?}, {}", analysis_time.elapsed(), ra_prof::memory_usage());
|
println!("Total: {:?}, {}", analysis_time.elapsed(), ra_prof::memory_usage());
|
||||||
|
|
||||||
if memory_usage {
|
if memory_usage {
|
||||||
for (name, bytes) in host.per_query_memory_usage() {
|
let mut mem = host.per_query_memory_usage();
|
||||||
println!("{:>8} {}", bytes, name)
|
|
||||||
}
|
let before = ra_prof::memory_usage();
|
||||||
|
drop(vfs);
|
||||||
|
let vfs = before.allocated - ra_prof::memory_usage().allocated;
|
||||||
|
mem.push(("VFS".into(), vfs));
|
||||||
|
|
||||||
let before = ra_prof::memory_usage();
|
let before = ra_prof::memory_usage();
|
||||||
drop(host);
|
drop(host);
|
||||||
println!("leftover: {}", before.allocated - ra_prof::memory_usage().allocated)
|
mem.push(("Unaccounted".into(), before.allocated - ra_prof::memory_usage().allocated));
|
||||||
|
|
||||||
|
mem.push(("Remaining".into(), ra_prof::memory_usage().allocated));
|
||||||
|
|
||||||
|
for (name, bytes) in mem {
|
||||||
|
println!("{:>8} {}", bytes, name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue