mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 16:46:43 +08:00
[rllib] Add copy() in async samples optimizer to fix memory leak (#3938)
Fixes #3884.
This commit is contained in:
@@ -167,7 +167,8 @@ class AsyncSamplesOptimizer(PolicyOptimizer):
|
||||
for b in self.batch_buffer) >= self.train_batch_size:
|
||||
train_batch = self.batch_buffer[0].concat_samples(
|
||||
self.batch_buffer)
|
||||
self.learner.inqueue.put(train_batch)
|
||||
# defensive copy against plasma ref count bugs, see #3884
|
||||
self.learner.inqueue.put(train_batch.copy())
|
||||
self.batch_buffer = []
|
||||
|
||||
# If the batch was replayed, skip the update below.
|
||||
|
||||
Reference in New Issue
Block a user