neovim/treesitter and html with long lines causes runaway memory alloc #5387
Unanswered
cskeeters
asked this question in
Ideas and Issue Triage
Replies: 2 comments 2 replies
-
Can't confirm this. I have neovim 10.3 with lazy, treesitter/html and a few other plugins. Loading neovim with no files at idle ghostty used 225M with VSIZE of 2.2G, perfectly normal. Loading up your file, the figures hardly change, whether |
Beta Was this translation helpful? Give feedback.
1 reply
-
I'm using neovim 0.10.3 also.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was trying out embedded base64-encoded image data in html and ghostty became really slow. I noticed in Activity Monitor that ghostty will run up to 4GB of allocated memory when this occurs so I think there is some sort of run away memory allocation going on.
iTerm2, no problem.
nvim --clean
in ghostty, no problem, so I disabled everything and then started enabling stuff until it broke. Turns out it only needs Tree-sitter with the html parser downloaded andhighlight{enable = true}
. It also only occurs when vim opens an html file with a line longer than around 2100 characters. If the file has more than around 1053 characters, vim doesn't display the text correctly, but there is no memory run.I think these two files are all you need to reproduce the error.
NOTE: I deleted a bunch of the image data to see where the problem would start so it's likely not valid base64 or SVG.
Neovim config (
init.lua
):memory-alloc-run.html
Beta Was this translation helpful? Give feedback.
All reactions