mirror of
https://github.com/wassname/ray.git
synced 2026-07-15 11:25:40 +08:00
Ref count objects created with ray.put (#5590)
* wip * add weakref option * tune util * test ref * doc * fix tests
This commit is contained in:
@@ -50,7 +50,7 @@ class TestMemoryLimits(unittest.TestCase):
|
||||
def testTooLargeAllocation(self):
|
||||
try:
|
||||
ray.init(num_cpus=1, driver_object_store_memory=100 * MB)
|
||||
ray.put(np.zeros(50 * MB, dtype=np.uint8))
|
||||
ray.put(np.zeros(50 * MB, dtype=np.uint8), weakref=True)
|
||||
self.assertRaises(
|
||||
OBJECT_TOO_LARGE,
|
||||
lambda: ray.put(np.zeros(200 * MB, dtype=np.uint8)))
|
||||
@@ -64,7 +64,7 @@ class TestMemoryLimits(unittest.TestCase):
|
||||
num_cpus=1,
|
||||
object_store_memory=300 * MB,
|
||||
driver_object_store_memory=driver_quota)
|
||||
z = ray.put("hi")
|
||||
z = ray.put("hi", weakref=True)
|
||||
a = LightActor._remote(object_store_memory=a_quota)
|
||||
b = GreedyActor._remote(object_store_memory=b_quota)
|
||||
for _ in range(5):
|
||||
|
||||
Reference in New Issue
Block a user