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

[FreeBSD] Cannot allocate memory #2032

Closed
avkarenow opened this issue Dec 11, 2021 · 3 comments
Closed

[FreeBSD] Cannot allocate memory #2032

avkarenow opened this issue Dec 11, 2021 · 3 comments

Comments

@avkarenow
Copy link

avkarenow commented Dec 11, 2021

Summary

  • OS: FreeBSD 12.2/13.0
  • Architecture: amd64
  • Psutil version: 5.8.0
  • Python version: 3.8.12
  • Type: core

Description

Hello,

From time to time while I'm running code like for proc in psutil.process_iter(): ... I got: Cannot allocate memory (originated from sysctl)
It happens on many FreeBSD 12.2 and 13.0 installations with 128-196 GB of RAM. Code is running as root with ulimit:

cpu time               (seconds, -t)  unlimited
file size           (512-blocks, -f)  unlimited
data seg size           (kbytes, -d)  33554432
stack size              (kbytes, -s)  524288
core file size      (512-blocks, -c)  unlimited
max memory size         (kbytes, -m)  unlimited
locked memory           (kbytes, -l)  unlimited
max user processes              (-u)  34318
open files                      (-n)  942921
virtual mem size        (kbytes, -v)  unlimited
swap limit              (kbytes, -w)  unlimited
socket buffer size       (bytes, -b)  unlimited
pseudo-terminals                (-p)  unlimited
kqueues                         (-k)  unlimited
umtx shared locks               (-o)  unlimited
Traceback:
    for proc in psutil.process_iter():
  File "/usr/local/lib/python3.8/site-packages/psutil/__init__.py", line 1425, in process_iter
    a = set(pids())
  File "/usr/local/lib/python3.8/site-packages/psutil/__init__.py", line 1365, in pids
    ret = sorted(_psplatform.pids())
  File "/usr/local/lib/python3.8/site-packages/psutil/_psbsd.py", line 513, in pids
    ret = cext.pids()
OSError: [Errno 12] Cannot allocate memory (originated from sysctl)
@peterjeremy
Copy link

This looks to be the same as #2093

@avkarenow
Copy link
Author

I was testing last commit version (04e7aa6) but the problem with cannot allocate memory still appears.

@avkarenow
Copy link
Author

The issue seems to be fixed by c7c7bbc and works now without problems.

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