Skip to content

Commit

Permalink
Merge pull request #2475 from freimair/memoryleak_be_gone
Browse files Browse the repository at this point in the history
Fixed memory leak in message throttle mechanism
  • Loading branch information
ManfredKarrer authored Feb 27, 2019
2 parents d68198e + 03a20a0 commit 76e406a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions p2p/src/main/java/bisq/network/p2p/network/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,10 @@ private boolean violatesThrottleLimit(NetworkEnvelope networkEnvelope) {
.collect(Collectors.toList()).toString());
}
}
// we limit to max 1000 (MSG_THROTTLE_PER_10SEC) entries
messageTimeStamps.remove(0);
}
// we limit to max 1000 (MSG_THROTTLE_PER_10SEC) entries
while(messageTimeStamps.size() > MSG_THROTTLE_PER_10_SEC)
messageTimeStamps.remove(0);

messageTimeStamps.add(new Tuple2<>(now, networkEnvelope));
return violated;
Expand Down

0 comments on commit 76e406a

Please sign in to comment.