mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 18:11:38 +08:00
Including psutil & setproctitle (#7031)
This commit is contained in:
@@ -3,10 +3,9 @@ import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
try:
|
||||
import psutil
|
||||
except ImportError:
|
||||
psutil = None
|
||||
# Import ray before psutil will make sure we use psutil's bundled version
|
||||
import ray # noqa F401
|
||||
import psutil # noqa E402
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -105,9 +104,6 @@ class MemoryMonitor:
|
||||
self.worker_name = worker_name
|
||||
|
||||
def raise_if_low_memory(self):
|
||||
if psutil is None:
|
||||
return # nothing we can do
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user