Add internal_api.global_gc() method, which triggers gc.collect() on all workers (#7327)

This commit is contained in:
Eric Liang
2020-02-26 14:09:29 -08:00
committed by GitHub
parent bcecf8b46b
commit b310661338
18 changed files with 218 additions and 8 deletions
+8 -1
View File
@@ -1,7 +1,14 @@
import ray.worker
from ray import profiling
__all__ = ["free"]
__all__ = ["free", "global_gc"]
def global_gc():
"""Trigger gc.collect() on all workers in the cluster."""
worker = ray.worker.get_global_worker()
worker.core_worker.global_gc()
def free(object_ids, local_only=False, delete_creating_tasks=False):