[fix] collect garbage after searches to reduce memory footprint

This commit is contained in:
Adam Tauber 2016-07-31 23:39:58 +02:00
parent bf92aa3fdd
commit ffbee4bb82
1 changed files with 4 additions and 3 deletions

View File

@ -15,14 +15,14 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
(C) 2013- by Adam Tauber, <asciimoo@gmail.com> (C) 2013- by Adam Tauber, <asciimoo@gmail.com>
''' '''
import gc
import threading import threading
import searx.poolrequests as requests_lib from thread import start_new_thread
from time import time from time import time
from searx import settings import searx.poolrequests as requests_lib
from searx.engines import ( from searx.engines import (
categories, engines categories, engines
) )
from searx.languages import language_codes
from searx.utils import gen_useragent from searx.utils import gen_useragent
from searx.query import Query from searx.query import Query
from searx.results import ResultContainer from searx.results import ResultContainer
@ -347,6 +347,7 @@ class Search(object):
return self return self
# send all search-request # send all search-request
threaded_requests(requests) threaded_requests(requests)
start_new_thread(gc.collect, tuple())
# return results, suggestions, answers and infoboxes # return results, suggestions, answers and infoboxes
return self return self