mirror of
https://github.com/vale981/ray
synced 2025-03-05 10:01:43 -05:00
parent
9c2b8c8501
commit
8e666ca1e9
2 changed files with 4 additions and 6 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -214,3 +214,6 @@ test_state.json
|
|||
|
||||
# workflow storage
|
||||
workflow_data/
|
||||
|
||||
# vscode java extention generated
|
||||
.factorypath
|
||||
|
|
|
@ -127,12 +127,7 @@ class MemoryMonitor:
|
|||
def get_memory_usage(self):
|
||||
psutil_mem = psutil.virtual_memory()
|
||||
total_gb = psutil_mem.total / (1024**3)
|
||||
used_gb = total_gb - psutil_mem.available / (1024**3)
|
||||
|
||||
# Linux, BSD has cached memory, which should
|
||||
# also be considered as unused memory
|
||||
if hasattr(psutil_mem, "cached"):
|
||||
used_gb -= psutil_mem.cached / (1024**3)
|
||||
used_gb = psutil_mem.used / (1024**3)
|
||||
|
||||
if self.cgroup_memory_limit_gb < total_gb:
|
||||
total_gb = self.cgroup_memory_limit_gb
|
||||
|
|
Loading…
Add table
Reference in a new issue