diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-12-17 17:25:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-17 23:25:51 +0100 |
commit | e9ecfdd20ac3f8a9d920bbcc4e5dd25bd262b4b7 (patch) | |
tree | 7604e5e42823656d5378d60791a4f68b66f7ca69 /core/ops_builtin_v8.rs | |
parent | f46df3e35940fc78163945eed33e58fafed0b06b (diff) |
fix(runtime): `Deno.memoryUsage().rss` should return correct value (#17088)
This commit changes implementation of "Deno.memoryUsage()" to return
correct value for "rss" field. To do that we implement a specialized function
per os to retrieve this information.
Diffstat (limited to 'core/ops_builtin_v8.rs')
-rw-r--r-- | core/ops_builtin_v8.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/ops_builtin_v8.rs b/core/ops_builtin_v8.rs index 5f4f875ee..880a87c8d 100644 --- a/core/ops_builtin_v8.rs +++ b/core/ops_builtin_v8.rs @@ -654,7 +654,7 @@ fn op_get_proxy_details<'a>( #[derive(Serialize)] #[serde(rename_all = "camelCase")] struct MemoryUsage { - rss: usize, + physical_total: usize, heap_total: usize, heap_used: usize, external: usize, @@ -668,7 +668,7 @@ fn op_memory_usage(scope: &mut v8::HandleScope) -> MemoryUsage { let mut s = v8::HeapStatistics::default(); scope.get_heap_statistics(&mut s); MemoryUsage { - rss: s.total_physical_size(), + physical_total: s.total_physical_size(), heap_total: s.total_heap_size(), heap_used: s.used_heap_size(), external: s.external_memory(), |