Memory leak when opening files due to `max_width = 0.3` change
Hi, I encountered a memory leak related to the recent change in commit 5e0804e, where max_width was updated to 0.3.
Steps to reproduce
- In a typescript project using the
vtslsLSP, create a file namedrequired-permissions.decorator.ts. - Open the file.
- Observe excessive memory consumption, eventually leading to a memory leak.
Workaround
Manually setting max_width = 0 in the config prevents the issue:
{
"j-hui/fidget.nvim",
opts = {
notification = {
window = {
max_width = 0, -- `0` means no maximum width.
},
},
},
},
Can confirm. My laptop died due to memory usage after updating packages with Lazy. Neovim would just freeze entirely when opening a file and after closing it out in the terminal the Neovim process would continue to eat memory non-stop, it was too late by the time I realized something was wrong but after a restart and looking into what happened the reason was Neovim:
I just applied the change suggested by @emnnipal (Thank you!) and it's looking good now so it seems to be related to that commit change.
@lfades what kind of language server were you using?
And do either of you have a project to reproduce this issue with?
TypeScript and also using vtsls.
It was fine when I opened LUA and md files. I was working in a private repo when it happened but that repo was nothing unusual, just TypeScript in a monorepo.
I was able to reproduce it consistently by opening neovim, then snacks picker and then after going to one of the TS files in the project, as soon as I did that Neovim would freeze.
I'm able to replicate it even in my nvim directory by just creating a file named required-permissions.decorator.ts. I think it’s more related to a specific filename length and screen size. It doesn’t happen when I resize my terminal to a smaller width.
Also this is not just the max_width but the combination of reflow = "ellipsis" and max_width = 0.3
Updated config:
{
"j-hui/fidget.nvim",
opts = {
notification = {
view = {
reflow = "ellipsis",
},
window = {
max_width = 0.3, -- `0` means no maximum width.
},
},
},
},
To reproduce, make sure you have the vtsls lsp enabled when opening the file.
https://github.com/user-attachments/assets/c4c77e2c-0ecc-476b-a8f8-f667d1959325
I had the same issue with a typescript monorepo project using vtsls lsp. But as emnnipal said, it might be entirely related to window width.
For me personally it always happened if I opened a particular file in the monorepo. I'd get a long cramped out message and it'd freeze.
I'm currently afk but can debug a bit more if you're not able to reproduce
can confirm with rust-analyzer