libobs/util: Fix reading memory usage on Linux
Memory usage displayed on Stats was too small due to a misaligned unit of `resident_size` read from `statm` file and libobs.
This commit is contained in:
parent
30c264c8bf
commit
bdb8f3f27b
1 changed files with 3 additions and 2 deletions
|
|
@ -1001,7 +1001,8 @@ bool os_get_proc_memory_usage(os_proc_memory_usage_t *usage)
|
|||
if (!os_get_proc_memory_usage_internal(&statm))
|
||||
return false;
|
||||
|
||||
usage->resident_size = statm.resident_size;
|
||||
usage->resident_size =
|
||||
(uint64_t)statm.resident_size * sysconf(_SC_PAGESIZE);
|
||||
usage->virtual_size = statm.virtual_size;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1011,7 +1012,7 @@ uint64_t os_get_proc_resident_size(void)
|
|||
statm_t statm = {};
|
||||
if (!os_get_proc_memory_usage_internal(&statm))
|
||||
return 0;
|
||||
return (uint64_t)statm.resident_size;
|
||||
return (uint64_t)statm.resident_size * sysconf(_SC_PAGESIZE);
|
||||
}
|
||||
|
||||
uint64_t os_get_proc_virtual_size(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue