aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_prof
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-30 08:45:20 +0100
committerAleksey Kladov <[email protected]>2020-07-30 08:45:20 +0100
commitdae99b66611759ba48fd164646f077d3e8515dad (patch)
treeeeff62d12b2c762562fa732c21d96d640859e82d /crates/ra_prof
parentad43d6bde67fd649347c3e2ac46bb8a75e71a2ab (diff)
Drop resident from memory usage
Diffstat (limited to 'crates/ra_prof')
-rw-r--r--crates/ra_prof/src/memory_usage.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_prof/src/memory_usage.rs b/crates/ra_prof/src/memory_usage.rs
index 745345fac..857b51321 100644
--- a/crates/ra_prof/src/memory_usage.rs
+++ b/crates/ra_prof/src/memory_usage.rs
@@ -5,7 +5,6 @@ use cfg_if::cfg_if;
5 5
6pub struct MemoryUsage { 6pub struct MemoryUsage {
7 pub allocated: Bytes, 7 pub allocated: Bytes,
8 pub resident: Bytes,
9} 8}
10 9
11impl MemoryUsage { 10impl MemoryUsage {
@@ -14,9 +13,9 @@ impl MemoryUsage {
14 if #[cfg(target_os = "linux")] { 13 if #[cfg(target_os = "linux")] {
15 // Note: This is incredibly slow. 14 // Note: This is incredibly slow.
16 let alloc = unsafe { libc::mallinfo() }.uordblks as u32 as usize; 15 let alloc = unsafe { libc::mallinfo() }.uordblks as u32 as usize;
17 MemoryUsage { allocated: Bytes(alloc), resident: Bytes(0) } 16 MemoryUsage { allocated: Bytes(alloc) }
18 } else { 17 } else {
19 MemoryUsage { allocated: Bytes(0), resident: Bytes(0) } 18 MemoryUsage { allocated: Bytes(0) }
20 } 19 }
21 } 20 }
22 } 21 }
@@ -24,7 +23,7 @@ impl MemoryUsage {
24 23
25impl fmt::Display for MemoryUsage { 24impl fmt::Display for MemoryUsage {
26 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { 25 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
27 write!(fmt, "{} allocated {} resident", self.allocated, self.resident,) 26 write!(fmt, "{}", self.allocated)
28 } 27 }
29} 28}
30 29