From a915814d345cf20a6681663f2e0dbbf63bf4fd72 Mon Sep 17 00:00:00 2001 From: galaunay Date: Mon, 11 Nov 2019 11:17:58 +0100 Subject: [PATCH] Avoid accumulating jedi processes Explicitly run the garbage collector after jedi calls. Apparently it is not done properly on some platforms/configs, which result in an accumultion of jedi processes eating up the ram. --- elpy/jedibackend.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/elpy/jedibackend.py b/elpy/jedibackend.py index 402bd8502..de08f1191 100644 --- a/elpy/jedibackend.py +++ b/elpy/jedibackend.py @@ -9,6 +9,7 @@ import sys import traceback import re +import gc import jedi @@ -380,3 +381,7 @@ def _debug(level, str_out): data=data) finally: jedi.set_debug_function(None) + # Explicitly call the garbage collector to avoid + # accumulating jedi processes + # (see https://github.com/jorgenschaefer/elpy/issues/1481) + gc.collect()