(self)
| 963 | |
| 964 | # Deterministically release event loop and executor on the sidecar. |
| 965 | colocated_mgr.teardown.specialize(devices=cpu_devices)() |
| 966 | # Explicitly trigger GC to ensure deterministic memory release within the |
| 967 | # colocated-python sidecar container. |
| 968 | gc.collect() |
| 969 | # Run gc.collect() and log diagnostics on the sidecar. |
| 970 | _colocated_teardown.specialize(devices=cpu_devices)() |
| 971 | |
| 972 | return tpu_arrays |
| 973 |