on master help sign in
[fix] collect garbage after searches to reduce memory footprint
commitffbee4bb8273e65bd77a22e88f332c198d562ee1 authorAdam Tauber <asciimoo@gmail.com> dateSun 31 Jul 2016, 23:39 (10 years ago) parentbf92aa3
1 file changed+4−3
searx/search.py+4−3
searx/search.py+4−3
@@ -15,14 +15,14 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
1515(C) 2013- by Adam Tauber, <asciimoo@gmail.com>
1616'''
1717
18+import gc
1819import threading
19−import searx.poolrequests as requests_lib
20+from thread import start_new_thread
2021from time import time
21−from searx import settings
22+import searx.poolrequests as requests_lib
2223from searx.engines import (
2324 categories, engines
2425)
25−from searx.languages import language_codes
2626from searx.utils import gen_useragent
2727from searx.query import Query
2828from searx.results import ResultContainer
@@ -347,6 +347,7 @@ class Search(object):
347347 return self
348348 # send all search-request
349349 threaded_requests(requests)
350+ start_new_thread(gc.collect, tuple())
350351
351352 # return results, suggestions, answers and infoboxes
352353 return self