mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 20:07:41 +08:00
Fix estimate_available_memory() in utils.py (#6302)
This commit is contained in:
@@ -452,16 +452,6 @@ def estimate_available_memory():
|
||||
overestimate if psutil is not installed.
|
||||
"""
|
||||
|
||||
# check cgroup memory first
|
||||
try:
|
||||
with open("/sys/fs/cgroup/memory/memory.usage_in_bytes", "rb") as f:
|
||||
cgroup_memory_usage = int(f.read())
|
||||
except IOError:
|
||||
cgroup_memory_usage = None
|
||||
|
||||
if cgroup_memory_usage is not None:
|
||||
return get_system_memory() - cgroup_memory_usage
|
||||
|
||||
# Use psutil if it is available.
|
||||
try:
|
||||
import psutil
|
||||
|
||||
Reference in New Issue
Block a user