Ask questionslsp-completion-no-cache not honored
emacs -q -l lsp-start-plain.el
lsp-start-plain.el can be downloaded here.
Alternatively, it will be great if you can reproduce the issue using lsp-docker which provides the minimal configurations for
lsp-mode and ships with most of the language servers.
Tracing a memory leak that occurred while using
lsp-emacs (with Flutter projects), after Emacs reached 2.4 GB I dumped the process image and found 300000+ instances of the string
_emacsStartPoint, which brought me to
As an experiment, on a new Emacs session assigned
lsp-completion-no-cache. After working with a Flutter project for a while, the memory leak manifested itself again. Contrary to my expectations,
lsp-completion--cache contained data. Inspecting the source code I see some assignments to that variable not guarded by a check of
t and do work for a while.
lsp-completion--cache remains empty.
Answer questions kiennq
lsp-completion-no-cache here means not caching the returned completions from the server per keystroke. I.e,: we sent a new completion request on every user key typed.
lsp-completion--cache is used even in that case since on one keystroke, we may have multiple calling to
completion-at-point function, also we used that as global var to pass value around to processing in one keystroke too.
That's why the
lsp-completion--cache may contain value even if
lsp-completion-no-cache is set.
@yyoncho Do we have a method to force release memory immediately (not waiting for garbage collection) after the memory is no longer use by us?