mirror of
https://github.com/wassname/ray.git
synced 2026-07-07 00:20:24 +08:00
15 lines
355 B
Python
15 lines
355 B
Python
# This code reproduces a memory leak we had in the past
|
|
|
|
import os
|
|
import numpy as np
|
|
import ray
|
|
|
|
ray.services.start_ray_local(num_workers=1)
|
|
|
|
d = {"w": np.zeros(1000000)}
|
|
|
|
obj_capsule, contained_objrefs = ray.lib.serialize_object(ray.worker.global_worker.handle, d)
|
|
|
|
while True:
|
|
ray.lib.deserialize_object(ray.worker.global_worker.handle, obj_capsule)
|