fidget.nvim icon indicating copy to clipboard operation
fidget.nvim copied to clipboard

Memory leak when opening files due to `max_width = 0.3` change

Open emnnipal opened this issue 3 months ago • 6 comments

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

  1. In a typescript project using the vtsls LSP, create a file named required-permissions.decorator.ts.
  2. Open the file.
  3. 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.
      },
    },
  },
},

emnnipal avatar Sep 22 '25 18:09 emnnipal

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:

Image

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 avatar Sep 22 '25 19:09 lfades

@lfades what kind of language server were you using?

And do either of you have a project to reproduce this issue with?

j-hui avatar Sep 22 '25 22:09 j-hui

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.

lfades avatar Sep 22 '25 23:09 lfades

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

emnnipal avatar Sep 23 '25 05:09 emnnipal

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

roguesherlock avatar Sep 23 '25 18:09 roguesherlock

can confirm with rust-analyzer

hujianxin avatar Sep 28 '25 05:09 hujianxin