code: def test_actor_task_refs(ray_start_regular):
      address = ray_start_regular["address"]
  
      @ray.remote
      class Actor:
          def __init__(self):
              self.refs = []
  
          def f(self, x):
              from ray._private.internal_api import memory_summary
  
              self.refs.append(x)
              return memory_summary(address)
  
      def make_actor():
          return Actor.remote()
  
      actor = make_actor()
      x_id = actor.f.remote(np.zeros(100000))
      info = ray.get(x_id)
      print(info)
      # Note, the actor will always hold a handle to the actor itself.
      assert num_objects(info) == 5, info
      # Actor handle, task argument id, task return id.
      assert count(info, ACTOR_TASK_CALL_OBJ) == 3, info
      assert count(info, DRIVER_PID) == 3, info
      assert count(info, WORKER_PID) == 2, info
      assert count(info, LOCAL_REF) == 1, info
      assert count(info, PINNED_IN_MEMORY) == 1, info
      assert count(info, USED_BY_PENDING_TASK) == 1, info
      assert count(info, ACTOR_HANDLE) == 2, info
      assert count(info, DESER_ACTOR_TASK_ARG) == 1, info
      del x_id
  
      # These should accumulate in the actor.
      for _ in range(5):
          ray.get(actor.f.remote([ray.put(np.zeros(100000))]))
      info = memory_summary(address)
      print(info)
      assert count(info, DESER_ACTOR_TASK_ARG) == 5, info
      assert count(info, ACTOR_TASK_CALL_OBJ) == 1, info
  
      # Cleanup.
      del actor
      time.sleep(1)
      info = memory_summary(address)
      assert num_objects(info) == 0, info
  
file_path: ray/python/ray/tests/test_memstat.py
imports: import os
  import time
  import numpy
  import pytest
  import ray
  from ray._private.internal_api import memory_summary
  from ray._private.test_utils import Semaphore, wait_for_condition
  from ray.cluster_utils import Cluster, cluster_not_supported
label_desc: Use image node_id 6 for calling a global function with example usage: test_actor_task_refs(ray_start_regular) and returns: Actor, memory_summary