High memory usage in Nvim with mason, mason-lspconfig, nvim-lspconfig
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 28/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- neovim, typescript
- Domain
- devtools
Research direction
Start by reproducing the report with the provided Neovim, tmux, Ubuntu, and MATLAB configuration, then inspect how matlab_ls is launched and stopped. Confirm whether each tmux window creates a separate MATLAB process and whether closing the terminal leaves it running. Done means memory usage and process cleanup match the expected behavior.
Written by the indexing model from the issue text.
Description
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:
- Start tmux
- Open nvim and edit a matlab file
- Open a new window
Ctrl-b + c, go to that window, repeat 1.+2. - Open
btoportopand filter formatlabprocess.
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
- OS Version: Ubuntu 20.04 with
nvimv0.10.1 - Language Server Client:
matlab_lsin combination with mason, mason-lspconfig and nvim-lspconfig - Client Version: commit hash eb1aab2e85dcf461e070b3d34e85aff15fcb9ada
- Node version: v18.0.0
- (relevant) Lazy Nvim LSP config:
return {
{
'williamboman/mason.nvim',
config = function()
require('mason').setup({})
end
},
{
'williamboman/mason-lspconfig.nvim', -- bridges Mason with nvim-lspconfig
config = function()
require('mason-lspconfig').setup({
ensure_installed = {
'matlab_ls',
'bashls',
'lua_ls',
'clangd',
'ltex',
'marksman',
'gitlab_ci_ls',
'yamlls',
},
})
end
},
{
'neovim/nvim-lspconfig',
dependencies = { 'hrsh7th/cmp-nvim-lsp'},
config = function()
local lspconfig = require('lspconfig')
local capabilities = require('cmp_nvim_lsp').default_capabilities()
lspconfig.matlab_ls.setup({
capabilities = capabilities,
filetypes = { "matlab" },
settings = {
matlab = {
installPath = "/home/sh/programs/MATLAB/R2023a/", -- also tried not setting this
telemetry = false,
},
},
single_file_support = true, -- also tried false
})
lspconfig.bashls.setup({
capabilities = capabilities,
filetypes = { "sh", "zsh", "bash" },
settings = {
bashls = {
lint = {
enable = true,
diagnostics = true,
use = { "shellcheck" },
},
},
},
})
lspconfig.lua_ls.setup({
capabilities = capabilities,
settings = {
Lua = {
diagnostics = {
globals = { 'vim' } -- avoids warnings that vim is not found
}
}
}
})
local function quickfix() vim.lsp.buf.code_action({ apply = true }) end
local map = require('utils').map
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(args)
-- mappings
end
})
end
},
}
Additional context
- Dominant language
- TypeScript
- Stars
- 125
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mathworks/MATLAB-language-server
-
documentation enhancement
Difficulty 1/5 1-3 hours Newbie friendliness 62/100
mathworks/MATLAB-language-server#27 · 10 comments ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
mathworks/MATLAB-language-server#82 · 1 reaction ·
-
Add progress handler Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
mathworks/MATLAB-language-server#81 · 4 comments ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
mathworks/MATLAB-language-server#79 · 7 comments ·
-
`--matlabLaunchCommandArgs` does not accept value starting with "-" (Not enough arguments following) Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
mathworks/MATLAB-language-server#78 · 8 comments ·
All issues in mathworks/MATLAB-language-server
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·