-
-
Notifications
You must be signed in to change notification settings - Fork 855
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
Out of memory error in previewer #647
Comments
This seems super weird. What does "big" file mean? 10k lines, 100k, 1m. |
|
I ran into another issue, where neovim just freezes. Happens when hovering over a huge file https://github.com/tjdevries/tree-sitter-lua/blob/master/src/parser.c Neovim isn't even able to open this file because treesitter takes too long to parse it. That annoying and i am currently thinking of some sort of chunk loading (still async) that might help with this issue and read in the next chunk on scrolling or something like this. Might be hard to do for the I am currently in the middle of exams and need to prepare for a project next semester so this could take a month. I am sorry |
yes, chunk loading is a fix for the big files, it will not help for the core dump/ out of memory that happen each 2 hours when NeoVim crash, i still think there is a memory leak, i have try to find it, but i am not use to this codebase. |
Thanks for the kind words :) Yes we leak one buffer in some occasions. But the Leaking is addressed here: #664 but will not close this issue :) |
ok, that make sense, because i found that if you type text to filter the list and then delete some of the text and then type it again, you can build up memory used by 10/20 Mb per time until you get around 1 Gb and then nvim crash, and that sound like the some thing. |
Trying to switch from fzf to telescope and ran into the same problem. |
I didn't have time to fix it but you can either switch to bat previewers. They are still valid or you try one of the configurations i posted here:
|
@Conni2461 Thank you. I will try suggested configs. |
I can reproduce with a huge repo and Lazy plugins: ---- telescope ----
{
'nvim-telescope/telescope.nvim',
dependencies = { { 'nvim-lua/popup.nvim', lazy = false }, { 'nvim-lua/plenary.nvim', lazy = false } },
}, --<l>tb/ff/gf/rg/th/pr/(deactivated)z
{ 'natecraddock/telescope-zf-native.nvim', lazy = false }, -- simpler algorithm for matching
-- { "nvim-telescope/telescope-fzf-native.nvim", build = "make", lazy = false }, -- 1.65x speed of fzf
-- Telescope gh issues author=windwp label=bug search=miscompilation
{ 'nvim-telescope/telescope-github.nvim' }, --Telescope gh issues|pull_request|gist|run and extension: telescope.load_extension 'zf-native' If look at the memory consumption with htop, I can see that residual memory remains around 538MB and virtual around 1295 (with clangd). A second search to increase it to 4212MB residual and 4407MB virtual. A third search with abababababab, then delete. Now its up to 3681MB residual and 3729MB virtual. Only typing sequence abababa leads to 4987M residual 5046MB virtual (waiting for a while to let the allocator kick in). Without telescope I see no memory change. Does luajit have a leak detector or what can I run to track this down? The memory is shown to me for APPENDUM: Some things to poke:
|
I can reproduce this with git_files, live_grep and any other picker with meaningful buffer sizes by merely typing some words with the LLVM repo. With and without any external picker. Related are #2370, #2482, #2489, #1379, #1049, #943. Possibly related are also performance issues like #1981. This code should show the offending memory usage, ideally in llvm repo with a picker of sufficient size, if the inserted cli words can be scripted (taken from https://stackoverflow.com/a/44748634): local time_start = os.time()
--------------------------------------
-- Your script is here
-- For example, just spend 5 seconds in CPU busy loop
repeat until os.clock() > 5
-- or call some external file containing your original script:
-- dofile("path/to/your_original_script.lua")
--------------------------------------
local mem_KBytes = collectgarbage("count") -- memory currently occupied by Lua
local CPU_seconds = os.clock() -- CPU time consumed
local runtime_seconds = os.time() - time_start -- "wall clock" time elapsed
print(mem_KBytes, CPU_seconds, runtime_seconds)
-- Output to stdout: 24.0205078125 5.000009 5 |
I have a similar issue too. It seems like |
I think this is this problem BurntSushi/ripgrep#2505 |
This seems to fix it for me:
|
it not only fixed, but made it 1000% faster |
Try live_grep in llvm or linux repo on empty string, wait 15-20s, then delete word, continue search with another word or press Esc. |
Closing this issue as it's pretty stale plus there's been other related issues and fixes since. |
Please do not tell me that you think closing stale issues is a good practice. Either the bug did not reproduce or one is unable to reproduce it due to insufficient instructions. As I understand it, you are closing it, because the explicitly mentioned reproducible is solved. If this is the case, consider rephrasing the issue to make it explicit.
I listed them in #647 (comment) and good practice is something like "This use case is solved. Related issues persist in XYZ." |
No this issue is not stale, this is not our practice here (it seems like i have to do a little bit more training). Issues are only stale, if they are opening, someone/i go like: "hey i cant reproduce this can you give me more information like ......" and then after 3 months there is still no response, then there is a good chance that i close it as stale, but this is not the case here. This issue is stale from our perspective, because i havent made any progress. I dont know which "fixes since" are referenced here |
sorry was a little too eager. |
Description
get a out of memory error when i move over the files in file window with preview on
if i add {previewer = false} to the function ex. oldfiles, it just works so it most be in the preview window that do not get unload files.
it happen with any size files, but with big files it only take 2-3 files.
Expected Behavior
Nvim do not dies
Actual Behavior
Nvim dies with out of memory error
Details
Reproduce
Environment
Build type: RelWithDebInfo
LuaJIT 2.0.5
Compilation: /usr/bin/cc -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/name/.cache/yay/neovim-nightly-git/src/build/config -I/home/name/.cache/yay/neovim-nightly-git/src/neovim-nightly-git/src -I/usr/include -I/home/name/.cache/yay/neovim-nightly-git/src/build/src/nvim/auto -I/home/name/.cache/yay/neovim-nightly-git/src/build/include
Compiled by name@manjaro
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
Run :checkhealth for more info
Configuration
The text was updated successfully, but these errors were encountered: