From 5443b5769f119cb474cdb1af21c31a1bd48bac52 Mon Sep 17 00:00:00 2001 From: Thomas Oettli Date: Mon, 9 Mar 2020 18:10:35 +0100 Subject: [PATCH] Optimize memory consumption --- uvscand/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/uvscand/__init__.py b/uvscand/__init__.py index 3332d94..30d0342 100644 --- a/uvscand/__init__.py +++ b/uvscand/__init__.py @@ -117,6 +117,7 @@ class AIO(asyncio.Protocol): with open(tmpfile, "wb") as f: self.tmpfile = tmpfile f.write(self.data) + self.data = bytearray() AIO.queue.put_nowait((AIO.config["uvscan_path"], tmpfile, self.process_uvscan_result)) self.logger.info("{} queued uvscan of {}, queue size is {}".format(self.peer, tmpfile, AIO.queue.qsize())) break