Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvim_buf_add_highlight() Causes High Memory Usage #229

Open
yuukibarns opened this issue Nov 20, 2024 · 3 comments
Open

nvim_buf_add_highlight() Causes High Memory Usage #229

yuukibarns opened this issue Nov 20, 2024 · 3 comments

Comments

@yuukibarns
Copy link

After a long chat, about 300 lines, I found the memory usage of Neovim increased significantly from 40MB to 1.2GB. System monitor shows a consistent memory increase at the rate of 4MB/s when gp.nvim is writing response to the buffer and after the chat ends, the memory usage won't decrease but still the highest level.
#228 fixes this.

@yuukibarns
Copy link
Author

However, there is still a 5MB increase in memory after the commit. If further
banned gp.nvim from writing to the buffer, the increase disappeared.
Why such a smiple nvim_buf_set_lines() can cause relatively big memory usage increase?

@dreamtrail
Copy link

gp.nvim will continuously redraw the lines for streaming responses, which can be very slow for lengthy outputs. You may just disable the streaming feature , as it is a distraction anyway.

@yuukibarns
Copy link
Author

But I do want the streaming feature, for I can stop halfway if the agent does not get the point.

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

No branches or pull requests

2 participants