neovim/treesitter and html with long lines causes runaway memory alloc #5387
Replies: 4 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.
-
I'm using neovim 0.10.3 also.
|
Beta Was this translation helpful? Give feedback.
-
Just tested ghostty 1.1.0 (9283) and it failed too with the same symptoms. |
Beta Was this translation helpful? Give feedback.
-
I'm afraid I still can't reproduce this issue @cskeeters. Sounds like this might be something tied to your setup. I've tried a few Linux distros, and my daily driver is Arch. Maybe this is specific to the Mac version of Ghostty, can someone else with a Mac chime in? |
Beta Was this translation helpful? Give feedback.
-
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