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()