First pass at ray memory command for memory debugging (#7589)

This commit is contained in:
Eric Liang
2020-03-17 20:45:07 -07:00
committed by GitHub
parent e6a045df48
commit 745b9d643d
32 changed files with 794 additions and 89 deletions
+18
View File
@@ -11,6 +11,24 @@ def global_gc():
worker.core_worker.global_gc()
def memory_summary():
"""Returns a formatted string describing memory usage in the cluster."""
import grpc
from ray.core.generated import node_manager_pb2
from ray.core.generated import node_manager_pb2_grpc
# We can ask any Raylet for the global memory info.
raylet = ray.nodes()[0]
raylet_address = "{}:{}".format(raylet["NodeManagerAddress"],
ray.nodes()[0]["NodeManagerPort"])
channel = grpc.insecure_channel(raylet_address)
stub = node_manager_pb2_grpc.NodeManagerServiceStub(channel)
reply = stub.FormatGlobalMemoryInfo(
node_manager_pb2.FormatGlobalMemoryInfoRequest(), timeout=30.0)
return reply.memory_summary
def free(object_ids, local_only=False, delete_creating_tasks=False):
"""Free a list of IDs from object stores.