From 0d3687a10dcd82b3d08509c9f48b7ff642443b9b Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Thu, 13 Feb 2020 15:21:44 -0800 Subject: [PATCH] No warning for docker memory > system memory (#7151) --- python/ray/utils.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/python/ray/utils.py b/python/ray/utils.py index ae5cf92a1..174430e46 100644 --- a/python/ray/utils.py +++ b/python/ray/utils.py @@ -402,8 +402,8 @@ def get_system_memory(): psutil_memory_in_bytes = psutil.virtual_memory().total if docker_limit is not None: - if docker_limit > psutil_memory_in_bytes: - logger.warn("Container memory is larger than system memory.") + # We take the min because the cgroup limit is very large if we aren't + # in Docker. return min(docker_limit, psutil_memory_in_bytes) return psutil_memory_in_bytes @@ -427,9 +427,8 @@ def get_used_memory(): psutil_memory_in_bytes = psutil.virtual_memory().used if docker_usage is not None: - if docker_usage > psutil_memory_in_bytes: - logger.warn("Container is reporting more memory usage than the" - "system.") + # We take the min because the cgroup limit is very large if we aren't + # in Docker. return min(docker_usage, psutil_memory_in_bytes) return psutil_memory_in_bytes