mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 05:45:58 +00:00
Add simple cache eviction to LazyLogModel to limit memory usage
This commit is contained in:
parent
c749df8574
commit
4424eb686f
1 changed files with 3 additions and 0 deletions
|
@ -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 ()
|
||||
|
|
Loading…
Reference in a new issue