summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2016-07-31 23:39:58 +0200
committerAdam Tauber <asciimoo@gmail.com>2016-07-31 23:39:58 +0200
commitffbee4bb8273e65bd77a22e88f332c198d562ee1 (patch)
treee94d26df20e3956ba865dbd6915d69ee0a1be920 /searx
parentbf92aa3fdd7e6343b1aca55515a94b4de1c5ce30 (diff)
downloadsearxng-ffbee4bb8273e65bd77a22e88f332c198d562ee1.tar.gz
searxng-ffbee4bb8273e65bd77a22e88f332c198d562ee1.zip
[fix] collect garbage after searches to reduce memory footprint
Diffstat (limited to 'searx')
-rw-r--r--searx/search.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/searx/search.py b/searx/search.py
index 8b8ed4762..6de07d2b5 100644
--- a/searx/search.py
+++ b/searx/search.py
@@ -15,14 +15,14 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
(C) 2013- by Adam Tauber, <asciimoo@gmail.com>
'''
+import gc
import threading
-import searx.poolrequests as requests_lib
+from thread import start_new_thread
from time import time
-from searx import settings
+import searx.poolrequests as requests_lib
from searx.engines import (
categories, engines
)
-from searx.languages import language_codes
from searx.utils import gen_useragent
from searx.query import Query
from searx.results import ResultContainer
@@ -347,6 +347,7 @@ class Search(object):
return self
# send all search-request
threaded_requests(requests)
+ start_new_thread(gc.collect, tuple())
# return results, suggestions, answers and infoboxes
return self