[rllib] Disable explicit free, which is no longer needed and causes memory leaks

This commit is contained in:
Eric Liang
2020-04-16 16:06:58 -07:00
committed by GitHub
parent dbcad35022
commit 0c80efa2a3
+8
View File
@@ -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