code: def test_gc_diagnosis_rss_win():
      diag = GCDiagnosis(info_over_rss_win=10e6)
  
      def make_refcycle(nbytes):
          l = [b"x" * nbytes]
          l.append(l)
          return
  
      with enable_gc_diagnosis_and_log(diag) as sio:
          make_refcycle(100 * 1024)
          gc.collect()
          # Too small, nothing printed
          assert not sio.getvalue()
  
          # NOTE: need to allocate a very large value to make sure RSS
          # really shrinks (depending on the system memory allocator,
          # "small" memory deallocations may keep the memory in the pool)
          make_refcycle(200 * 1024 * 1024)
          gc.collect()
          lines = sio.getvalue().splitlines()
          assert len(lines) == 1
          # Several MB released, and at least 1 reference cycles
          assert re.match(
              r"full garbage collection released [\d\.]+ MB "
              r"from [1-9]\d* reference cycles",
              lines[0],
          )
  
file_path: distributed/distributed/tests/test_utils_perf.py
imports: from __future__ import annotations
  import contextlib
  import gc
  import itertools
  import random
  import re
  import pytest
  from distributed.metrics import thread_time
  from distributed.utils_perf import FractionalTimer, GCDiagnosis, disable_gc_diagnosis
  from distributed.utils_test import captured_logger, run_for
label_desc: Use image node_id 4 for calling a global function with example usage: test_gc_diagnosis_rss_win() without return types