Log saver keeps time based buckets of log events as the events are read from Kafka. There is a limit to the number of buckets kept in memory at any given time. However to maintain sorted order of log messages, any old messages fetched from Kafka are still added to in-memory buckets. We have seen cases where the time difference in adjacent log messages in Kafka is more than 10-20 seconds. This leads to more time based buckets than expected, and can lead to log saver going out of memory. To prevent this we can have a hard limit on the number of messages log saver will keep in memory.