mirror of
https://github.com/wassname/ray.git
synced 2026-07-01 04:16:42 +08:00
[rllib] Disable explicit free, which is no longer needed and causes memory leaks
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user