Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psutil.virtual_memory() crashes on FreeBSD #730

Closed
syohex opened this issue Jan 19, 2016 · 0 comments
Closed

psutil.virtual_memory() crashes on FreeBSD #730

syohex opened this issue Jan 19, 2016 · 0 comments

Comments

@syohex
Copy link
Contributor

syohex commented Jan 19, 2016

psutil.virtual_memory() raises exception from psutil 3.4.1. There is no exception with 3.3.0.

3.4.1

% python2.7
Python 2.7.11 (default, Jan 19 2016, 15:10:11)
[GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final 208032)] on freebsd10
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> psutil.__version__
'3.4.1'
>>> psutil.virtual_memory()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/psutil/__init__.py", line 1676, in virtual_memory
    ret = _psplatform.virtual_memory()
  File "/usr/local/lib/python2.7/site-packages/psutil/_psbsd.py", line 119, in virtual_memory
    mem = cext.virtual_mem()
OSError: [Errno 12] Cannot allocate memory

3.3.0

% python2.7
Python 2.7.11 (default, Jan 19 2016, 15:10:11)
[GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final 208032)] on freebsd10
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> psutil.__version__
'3.3.0'

>>> psutil.virtual_memory()
svmem(total=1020645376L, available=819802112L, percent=19.7, used=212234240L, free=52613120L, active=35495936L, inactive=755793920L, buffers=110297088L, cached=11395072L, shared=39469056L, wired=165343232L)

My environment

  • FreeBSD 10.2-RELEASE r286666 amd64
  • Python 2.7.11

This is related to nicolargo/glances#781

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants