Speed up task submissions a bit (#5992)

This commit is contained in:
Eric Liang
2019-10-25 00:10:37 -07:00
committed by GitHub
parent 6f27d881bd
commit 4edae7ea2b
4 changed files with 20 additions and 6 deletions
+4 -4
View File
@@ -109,13 +109,13 @@ class MemoryMonitor(object):
self.worker_name = worker_name
def raise_if_low_memory(self):
if not psutil:
if psutil is None:
return # nothing we can do
if "RAY_DEBUG_DISABLE_MEMORY_MONITOR" in os.environ:
return # escape hatch, not intended for user use
if time.time() - self.last_checked > self.check_interval:
if "RAY_DEBUG_DISABLE_MEMORY_MONITOR" in os.environ:
return # escape hatch, not intended for user use
self.last_checked = time.time()
total_gb = psutil.virtual_memory().total / (1024**3)
used_gb = total_gb - psutil.virtual_memory().available / (1024**3)