Skip to content

Fix watcher leak in picker#51

Closed
Tebro wants to merge 1 commit into
dmtrKovalenko:mainfrom
Tebro:fix/memory_leak
Closed

Fix watcher leak in picker#51
Tebro wants to merge 1 commit into
dmtrKovalenko:mainfrom
Tebro:fix/memory_leak

Conversation

@Tebro
Copy link
Copy Markdown

@Tebro Tebro commented Aug 4, 2025

Closes #49

@Tebro Tebro force-pushed the fix/memory_leak branch from 394c59b to 02435d0 Compare August 4, 2025 11:20
Comment thread lua/fff/picker_ui.lua
if buf and vim.api.nvim_buf_is_valid(buf) then vim.api.nvim_buf_delete(buf, { force = true }) end
end

main.stop_background_monitor()
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an option to do because we have to keep the sync running in the background, we should clean it up when the neovim is requested to exit but I've been sure that it should already be cleaned up let me research this a little bit

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the problem is that it seems to spawn multiple of these processes (one on each use of the finder). And they never die until the editor is closed.

I do however now wonder if this actual is a valid fix, cause now I have an instance taking 4GB of memory again.

This is a bit hard to verify if a fix is working or not.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they spawning once per neovim session (at least they should be) I will try to wrap my head around this more deeply can you share the platform info

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am on Linux, kernel 6.15.8, alacritty terminal, Neovim v0.11.3

@dmtrKovalenko
Copy link
Copy Markdown
Owner

I debugged it a little bit more and apperently I misread the docs of notify rs and missed the idea that they spawn their own debouncer thread which led to the hanging threads by debouncer. After this PR everything should be good #56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Potential memory leak

2 participants