Skip to content

Commit

Permalink
[rllib] Copy plasma memory before adding data to replay buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
ericl authored Apr 29, 2020
1 parent 17f0d50 commit ae54e0d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rllib/optimizers/async_replay_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ def get_host(self):
return os.uname()[1]

def add_batch(self, batch):
# Make a copy so the replay buffer doesn't pin plasma memory.
batch = batch.copy()
# Handle everything as if multiagent
if isinstance(batch, SampleBatch):
batch = MultiAgentBatch({DEFAULT_POLICY_ID: batch}, batch.count)
Expand Down

0 comments on commit ae54e0d

Please sign in to comment.