mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 19:42:26 +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:
|
if line_offset in self.line_cache:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if len (self.line_cache) > 10000:
|
||||||
|
self.line_cache.clear ()
|
||||||
|
|
||||||
if line_offset == 0:
|
if line_offset == 0:
|
||||||
self.__fileobj.seek (0)
|
self.__fileobj.seek (0)
|
||||||
line = self.__fileobj.readline ()
|
line = self.__fileobj.readline ()
|
||||||
|
|
Loading…
Reference in a new issue