code: def test_global_gc_actors(shutdown_only):
      ray.init(
          num_cpus=1,
          _system_config={"debug_dump_period_milliseconds": 500},
      )
  
      try:
          gc.disable()
  
          @ray.remote(num_cpus=1)
          class A:
              def f(self):
                  return "Ok"
  
          # Try creating 3 actors. Unless python GC is triggered to break
          # reference cycles, this won't be possible.
          for i in range(3):
              a = A.remote()
              cycle = [a]
              cycle.append(cycle)
              ray.get(a.f.remote())
              print("iteration", i)
              del a
              del cycle
      finally:
          gc.enable()
  
file_path: ray/python/ray/tests/test_global_gc.py
imports: import gc
  import logging
  import weakref
  import numpy
  import pytest
  import ray
  import ray.cluster_utils
  from ray._private.internal_api import global_gc
  from ray._private.test_utils import wait_for_condition
label_desc: Use image node_id 4 for calling a global function with example usage: test_global_gc_actors(shutdown_only) and returns: str