Open sh-cau opened 2 months ago
My suspicion is that, as with VS Code, Nvim does not share an instance of the language server between separate Nvim windows. Because of this, each window is instantiating a new instance of the language server, which is then starting its own MATLAB process.
We are aware of this higher-than-expected memory cost for running the language server, and are investigating options for reducing this in the future.
As we continue to look into this, it would be helpful to understand more about your workflow so we can ensure it is captured in our future solution. Can you give some more context about why you are using multiple Nvim windows instead of just one? Is this a Nvim limitation (only one repository per window), or is it more efficient for you?
I suspected as much. Yes, indeed, I am working with multiple (MATLAB) repos and each repo has its own tmux window but mainly for organization purposes, i.e., to keep the buffer list local to that particular repo, e.g., when I use :bufdo %s/old/new/g
I don't mess up other repos.
Describe the bug When I open any buffer that is a Matlab file, the LSP server starts and has ~2GB of memory on each tmux window. Since I use many windows for different repos simultaneously in one tmux session, my RAM tends to overflow if I am not careful. Also the language server process does not end when I just close the terminal containing the tmux session. If I close the windows individually, the corresponding processes also stop.
To Reproduce Steps to reproduce the behavior:
Ctrl-b + c
, go to that window, repeat 1.+2.btop
ortop
and filter formatlab
process.Expected behavior I would expect the LSP to be more lightweight and not use up so much RAM?! According to the screenshot, an entire MATLAB instance is started to run the language server?!
Screenshots
Useful Information
nvim
v0.10.1matlab_ls
in combination with mason, mason-lspconfig and nvim-lspconfig