mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-02-02 02:22:13 -05:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user