Skip to content

Commit bd9a58b

Browse files
committedDec 17, 2015
FreeBSD: fix total memory
1 parent 24f7b2e commit bd9a58b

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed
 

Diff for: ‎HISTORY.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Bug tracker at https://github.com/giampaolo/psutil/issues
22

3-
3.3.1 - XXXX-XX-XX
3+
3.4.0 - XXXX-XX-XX
44
==================
55

66
**Enhancements**
@@ -15,6 +15,7 @@ Bug tracker at https://github.com/giampaolo/psutil/issues
1515
- #714: [OpenBSD] virtual_memory().cached value was always set to 0.
1616
- #715: don't crash at import time if cpu_times() fail for some reason.
1717
- #717: [Linux] Process.open_files fails if deleted files still visible.
18+
- #724: [FreeBSD] virtual_memory().total is slightly incorrect.
1819

1920

2021
3.3.0 - 2015-11-25

Diff for: ‎psutil/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
]
163163
__all__.extend(_psplatform.__extra__all__)
164164
__author__ = "Giampaolo Rodola'"
165-
__version__ = "3.3.1"
165+
__version__ = "3.4.0"
166166
version_info = tuple([int(num) for num in __version__.split('.')])
167167
AF_LINK = _psplatform.AF_LINK
168168
_TOTAL_PHYMEM = None

Diff for: ‎psutil/arch/bsd/freebsd.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ psutil_virtual_mem(PyObject *self, PyObject *args) {
485485
#endif
486486
size_t buffers_size = sizeof(buffers);
487487

488-
if (sysctlbyname("vm.stats.vm.v_page_count", &total, &size, NULL, 0))
488+
if (sysctlbyname("hw.physmem", &total, &size, NULL, 0))
489489
goto error;
490490
if (sysctlbyname("vm.stats.vm.v_active_count", &active, &size, NULL, 0))
491491
goto error;
@@ -506,7 +506,7 @@ psutil_virtual_mem(PyObject *self, PyObject *args) {
506506
goto error;
507507

508508
return Py_BuildValue("KKKKKKKK",
509-
(unsigned long long) total * pagesize,
509+
(unsigned long long) total,
510510
(unsigned long long) free * pagesize,
511511
(unsigned long long) active * pagesize,
512512
(unsigned long long) inactive * pagesize,

0 commit comments

Comments
 (0)