Fixed memory leak in message throttle mechanism

This commit is contained in:
Florian Reimair 2019-02-27 16:08:33 +01:00
parent b6bf22b77d
commit 03a20a05f7
No known key found for this signature in database
GPG Key ID: 7EA8CA324B6E5633

View File

@ -378,9 +378,10 @@ public class Connection implements MessageListener {
.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;