diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2024-02-05 18:41:24 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-05 18:41:24 +0530 |
commit | d13094c8215e7e0285e7bf4bcb23ac97a126c198 (patch) | |
tree | bb35534c1a8f903c5b152cb8367166a934a065ed /runtime/ops/os/sys_info.rs | |
parent | 961fa27c769452a5ef233994886f5a9be9690773 (diff) |
fix(os): total and free memory in bytes (#22247)
Diffstat (limited to 'runtime/ops/os/sys_info.rs')
-rw-r--r-- | runtime/ops/os/sys_info.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/runtime/ops/os/sys_info.rs b/runtime/ops/os/sys_info.rs index 40cdc52fa..e865bc8f9 100644 --- a/runtime/ops/os/sys_info.rs +++ b/runtime/ops/os/sys_info.rs @@ -260,7 +260,6 @@ pub fn mem_info() -> Option<MemInfo> { std::ptr::null_mut(), 0, ); - mem_info.total /= 1024; let mut xs: libc::xsw_usage = std::mem::zeroed::<libc::xsw_usage>(); mib[0] = libc::CTL_VM; @@ -320,9 +319,9 @@ pub fn mem_info() -> Option<MemInfo> { let result = sysinfoapi::GlobalMemoryStatusEx(mem_status.as_mut_ptr()); if result != 0 { let stat = mem_status.assume_init(); - mem_info.total = stat.ullTotalPhys / 1024; + mem_info.total = stat.ullTotalPhys; mem_info.available = 0; - mem_info.free = stat.ullAvailPhys / 1024; + mem_info.free = stat.ullAvailPhys; mem_info.cached = 0; mem_info.buffers = 0; |