Add tip on how to disable Ray OOM handler (#14017)

This commit is contained in:
Eric Liang
2021-02-09 21:52:22 -08:00
committed by GitHub
parent 7a6f8054d1
commit 8b7cf7cab9
+6 -3
View File
@@ -54,7 +54,9 @@ class RayOutOfMemoryError(Exception):
round(get_shared(psutil.virtual_memory()) / (1024**3), 2))
+ "currently being used by the Ray object store.\n---\n"
"--- Tip: Use the `ray memory` command to list active "
"objects in the cluster.\n---\n")
"objects in the cluster.\n"
"--- To disable OOM exceptions, set "
"RAY_DISABLE_MEMORY_MONITOR=1.\n---\n")
class MemoryMonitor:
@@ -120,8 +122,9 @@ class MemoryMonitor:
def raise_if_low_memory(self):
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
if ("RAY_DEBUG_DISABLE_MEMORY_MONITOR" in os.environ
or "RAY_DISABLE_MEMORY_MONITOR" in os.environ):
return
self.last_checked = time.time()
used_gb, total_gb = self.get_memory_usage()