From 4424eb686f9574c0db639ad708dd3d82db8356af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Stadler?= Date: Mon, 3 Dec 2007 15:24:20 +0200 Subject: [PATCH] Add simple cache eviction to LazyLogModel to limit memory usage --- debug-viewer/GstDebugViewer/GUI.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debug-viewer/GstDebugViewer/GUI.py b/debug-viewer/GstDebugViewer/GUI.py index 87a9a0cd0b..b7c5adf192 100755 --- a/debug-viewer/GstDebugViewer/GUI.py +++ b/debug-viewer/GstDebugViewer/GUI.py @@ -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 ()