You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux has a function (prlimit(2)) which allows to get/set resource limits for a
certain process.
With this you can, say, instruct a process so that it uses no more than a
certain amount of memory or opens no more than a certain number of files, see:
http://linux.die.net/man/2/prlimit There's also a proposal for inclusion of
prlimit(2) into Python 3.4, see: http://bugs.python.org/issue16595 Proposal
is to provide the same functionality in psutil by providing two new functions
behaving along these lines:
>>> p = psutil.Process(pid)
>>> p.get_rlimit(psutil.RLIMIT_NOFILE)
(1024, 4096)
>>> p.set_rlimit(psutil.RLIMIT_NOFILE, (5, 5))
>>> p.get_rlimit(psutil.RLIMIT_NOFILE)
(5, 5)
>>>
Basically this would be equivalent to resource's module getrlimit() and
setrlimit() functions but applicable to any process/pid (as opposed to current
process only): http://docs.python.org/2/library/resource.html
From g.rodola on July 24, 2013 13:56:04
Original issue: http://code.google.com/p/psutil/issues/detail?id=412
The text was updated successfully, but these errors were encountered: