Skip to content

Commit

Permalink
[rllib] Add copy() in async samples optimizer to fix memory leak (#3938)
Browse files Browse the repository at this point in the history
Fixes #3884.
  • Loading branch information
ericl authored and richardliaw committed Feb 4, 2019
1 parent 8323419 commit 7ef830b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/ray/rllib/optimizers/async_samples_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ def _step(self):
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.
Expand Down

0 comments on commit 7ef830b

Please sign in to comment.