From 0c80efa2a37f482494fbffbe9e81f61586b03ecb Mon Sep 17 00:00:00 2001 From: Eric Liang Date: Thu, 16 Apr 2020 16:06:58 -0700 Subject: [PATCH] [rllib] Disable explicit free, which is no longer needed and causes memory leaks --- rllib/utils/memory.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rllib/utils/memory.py b/rllib/utils/memory.py index 0c04bb15d..89ab4ae6b 100644 --- a/rllib/utils/memory.py +++ b/rllib/utils/memory.py @@ -1,5 +1,6 @@ import numpy as np import time +import os import ray @@ -8,6 +9,10 @@ MAX_FREE_QUEUE_SIZE = 100 _last_free_time = 0.0 _to_free = [] +# TODO(ekl) remove this feature entirely. It's here for now just in case we +# need to turn it on for debugging. +RLLIB_DEBUG_EXPLICIT_FREE = bool(os.environ.get("RLLIB_DEBUG_EXPLICIT_FREE")) + def ray_get_and_free(object_ids): """Call ray.get and then queue the object ids for deletion. @@ -23,6 +28,9 @@ def ray_get_and_free(object_ids): The result of ray.get(object_ids). """ + if not RLLIB_DEBUG_EXPLICIT_FREE: + return ray.get(object_ids) + global _last_free_time global _to_free