From 6e2dc7728f612b91d692fac5ab92cdd4521811c9 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Fri, 14 Apr 2023 01:07:42 +0200 Subject: [NetBSD] available mem can be higher than total (#2233) On NetBSD "available" memory can be higher than "total". From now now calculate it exactly the same as Zabbix: https://github.com/zabbix/zabbix/blob/af5e0f80253e585ca7082ca6bc9cc07400afe2a7/src/libs/zbxsysinfo/netbsd/memory.c Fixes https://github.com/giampaolo/psutil/issues/2231 which produced this failure: ``` ====================================================================== FAIL: psutil.tests.test_system.TestMemoryAPIs.test_virtual_memory ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vagrant/psutil/psutil/tests/test_system.py", line 275, in test_virtual_memory assert 0 <= mem.percent <= 100, mem ^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: svmem(total=1019899904, available=1046573056, percent=-2.6, used=603414528, free=545050624, active=234807296, inactive=133210112, buffers=260288512, cached=368312320, shared=0, wired=294912) ``` --- HISTORY.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'HISTORY.rst') diff --git a/HISTORY.rst b/HISTORY.rst index dcb6a0d2..63b43c69 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -34,6 +34,7 @@ 1 minute). - 2229_, [OpenBSD]: unable to properly recognize zombie processes. `NoSuchProcess`_ may be raised instead of `ZombieProcess`_. +- 2231_, [NetBSD]: *available* `virtual_memory()`_ is higher than *total*. 5.9.4 ===== -- cgit v1.2.1