Add simple cache eviction to LazyLogModel to limit memory usage

This commit is contained in:
René Stadler 2007-12-03 15:24:20 +02:00 committed by Stefan Sauer
parent c749df8574
commit 4424eb686f

View file

@ -343,6 +343,9 @@ class LazyLogModel (LogModelBase):
if line_offset in self.line_cache:
return
if len (self.line_cache) > 10000:
self.line_cache.clear ()
if line_offset == 0:
self.__fileobj.seek (0)
line = self.__fileobj.readline ()