From 6ca3460090dfe09b2d184f21f5c48f7fdb272d6f Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Wed, 22 Nov 2017 14:49:18 +0100 Subject: [PATCH] Put garbage collection into the cleaner thread - this maybe addresses #1079 --- src/class_singleCleaner.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/class_singleCleaner.py b/src/class_singleCleaner.py index f3125806..e89dd1b1 100644 --- a/src/class_singleCleaner.py +++ b/src/class_singleCleaner.py @@ -1,7 +1,7 @@ +import gc import threading import shared import time -import sys import os import tr#anslate @@ -14,7 +14,6 @@ from network.dandelion import Dandelion from debug import logger import knownnodes import queues -import protocol import state """ @@ -46,6 +45,7 @@ class singleCleaner(threading.Thread, StoppableThread): self.initStop() def run(self): + gc.disable() timeWeLastClearedInventoryAndPubkeysTables = 0 try: shared.maximumLengthOfTimeToBotherResendingMessages = (float(BMConfigParser().get('bitmessagesettings', 'stopresendingafterxdays')) * 24 * 60 * 60) + (float(BMConfigParser().get('bitmessagesettings', 'stopresendingafterxmonths')) * (60 * 60 * 24 *365)/12) @@ -148,6 +148,8 @@ class singleCleaner(threading.Thread, StoppableThread): pass # TODO: cleanup pending upload / download + gc.collect() + if state.shutdown == 0: self.stop.wait(singleCleaner.cycleLength)