Skip to content

Commit

Permalink
try to adjust test
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Jan 14, 2025
1 parent d4b37d9 commit f107407
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions psutil/_psosx.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,12 @@

def virtual_memory():
"""System virtual memory as a namedtuple."""
total, active, inactive, wired, free, speculative = cext.virtual_mem()
total, active, inactive, wired, free, _speculative = cext.virtual_mem()
# This is how Zabbix calculate avail and used mem:
# https://github.com/zabbix/zabbix/blob/trunk/src/libs/zbxsysinfo/
# osx/memory.c
# https://github.com/zabbix/zabbix/blob/master/src/libs/zbxsysinfo/osx/memory.c
# Also see: https://github.com/giampaolo/psutil/issues/1277
avail = inactive + free
used = active + wired
# This is NOT how Zabbix calculates free mem but it matches "free"
# cmdline utility.
free -= speculative
percent = usage_percent((total - avail), total, round_=1)
return svmem(total, avail, percent, used, free, active, inactive, wired)

Expand Down

0 comments on commit f107407

Please sign in to comment.