fixed memory usage reading

This commit is contained in:
Aaron Blakely 2022-07-07 03:07:59 -05:00
parent 55483a179d
commit 2a6ca41dcf

View file

@ -2731,6 +2731,11 @@ get_memory() {
mem_used="${mem_used/Pages active\: /}"
mem_used="${mem_used/\./}"
pages_inactive=$(vm_stat | grep "Pages inactive")
pages_inactive=${pages_inactive/Pages inactive\: /}
pages_inactive=${pages_inactive/\./}
mem_used=$((mem_used + pages_inactive))
mem_used=$((mem_used * 4096 / 1048576))
else
hw_pagesize="$(sysctl -n hw.pagesize)"