-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
rg takes up all memory (>10GB) #1553
Comments
This is, coincidentally, probably a duplicate of #1550 There are cases where ripgrep may use a lot of memory. They are documented in the man page. Please consult those to see if they match your use case. But unfortunately, this ticket is not actionable. Without a reproduction, there is really nothing I can do, sorry. If you can come up with a reproduction, then I'm happy to re-open. |
(You're also using an old version of ripgrep, which is generally not supported. Although I don't expect upgrading to fix your problem.) |
Just wondering: The case if there are circular dependencies in symlinks is handled correctly though, right? It would not loop forever and always get deeper and deeper. |
Yes. ripgrep has symlink loop detection. If you want to debug this yourself, you could try removing |
Latest master might work for you now that #1554 is merged |
Thanks! |
What version of ripgrep are you using?
ripgrep 11.0.1 (rev 973de50)
-SIMD -AVX (compiled)
+SIMD -AVX (runtime)
How did you install ripgrep?
Via VSCode, Version: 1.44.0
Commit: 2aae1f26c72891c399f860409176fe435a154b13
Date: 2020-04-08T08:23:56.137Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 17.7.0
What operating system are you using ripgrep on?
Linux (via the VSCode SSH extension, where VSCode itself runs on Mac).
Describe your bug.
The
rg
process takes a lot of memory (>10GB) when searching through a very big directory (several 100GB, also slow NFS, also having a couple of symlinks, which also might be circular).In the extreme case, it crashes the whole system.
What are the steps to reproduce the behavior?
Have a very big directory (several 100GB, also slow NFS, also having a couple of symlinks, which also might be circular).
VSCode (via, via, via) starts it like this:
rg --files --hidden --case-sensitive -g **/*.ipynb -g !**/.git -g !**/.svn -g !**/.hg -g !**/CVS -g !**/.DS_Store -g !**/__pycache__ -g !**/*.pyc --no-ignore --follow --no-config --no-ignore-global
What is the actual behavior?
It starts the search. However, I can see that the memory just increases, and the process never manages to finish.
See
ps axu
on the Linux SSH server, and search for therg
process by VSCode:The
cwd
of that process is a VSCode setup, which is the very big project directory. Many of the files are behind some symlinks, but I partly want to follow symlinks. (I'm not sure how to selectively disable to not follow some of the symlinks.)I think the issue is that the directory is just very big.
I happened already multiple times that the Linux server became unresponsive because all memory was occupied, and luckily the Linux OOM killer killed
rg
and the system recovered a while later. This is what I see indmesg -T
:What is the expected behavior?
It should never happen (crashing my whole system because OOM), even if the user opens a immensely huge directory (or let's say an infinite big virtual FUSE directory).
The text was updated successfully, but these errors were encountered: