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

[grep] Multiple ripgrep instances running in the background #63

Closed
0x450x6c opened this issue Oct 25, 2019 · 8 comments
Closed

[grep] Multiple ripgrep instances running in the background #63

0x450x6c opened this issue Oct 25, 2019 · 8 comments

Comments

@0x450x6c
Copy link

Hi, thanks for great library!

When I start typing something for grep, there are multiple ripgrep instances running in the background.

For example:
When I type "test", the following ripgrep instances are running in the background:
2019-10-25-090429_873x55_scrot

@chemzqm
Copy link
Member

chemzqm commented Oct 25, 2019

Please provide :CocInfo

@0x450x6c
Copy link
Author

:CocInfo (tested by linux source)


## versions

vim version: NVIM v0.5.0-94-ge93342629
node version: v12.10.0
coc.nvim version: 0.0.74
term: xterm-256color
platform: linux

## Messages[coc.nvim] lbdbq required for coc-lbdbq

## Output channel: prettier


## Output channel: snippets


## Output channel: git
Looking for git in: git
> git rev-parse --show-toplevel
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
> git ls-files -- README
> git --no-pager show :README
resolved root: /tmp/linux
> git ls-files -- README
> git --no-pager show :README
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git ls-files -- README
> git --no-pager show :README
resolved root: /tmp/linux
resolved root: /tmp/linux
> git ls-files -- README
> git --no-pager show :README
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
> git ls-files -- virt/Makefile
> git --no-pager show :virt/Makefile
resolved root: /tmp/linux
resolved root: /tmp/linux
> git ls-files -- README
> git --no-pager show :README
resolved root: /tmp/linux
resolved root: /tmp/linux
> git ls-files -- README
> git --no-pager show :README
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git ls-files -- README
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
> git --no-pager show :README
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git ls-files -- README
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
> git --no-pager show :README
resolved root: /tmp/linux
resolved root: /tmp/linux
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git ls-files -- README
> git --no-pager show :README
resolved root: /tmp/linux
resolved root: /tmp/linux
> git ls-files -- README
> git --no-pager show :README
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard
resolved root: /tmp/linux
resolved root: /tmp/linux
> git symbolic-ref --short HEAD
> git diff --name-status
> git diff --staged --name-status
> git ls-files --others --exclude-standard


## Output channel: highlight
[Info  - 9:33:11 AM] Highlight server running in node v12.10.0


## Output channel: XML Language Server

@0x450x6c
Copy link
Author

It reproduces only in large codebases

@patrickpichler
Copy link

You can reproduce this when checking out coc-java, install all yarn dependencies and search with CocList grep for settings.url. This basically killed my PC. It used up all of my ram + swap.

@chemzqm
Copy link
Member

chemzqm commented Oct 29, 2019

@patrickpichler I don't have any issue with that, please provide more information about your environment.

@patrickpichler
Copy link

patrickpichler commented Oct 29, 2019

I'm running VoidLinux
Node: v10.16.0
RipGrep: 11.0.2
NVIM: v0.4.2
Coc.nvim: v0.0.74
Coc-lists: 1.3.4

@patrickpichler
Copy link

I use the grep list in interactive mode. My guess is that on huge projects the ripgrep process takes longer to finish (and takes up insane amounts of ram). That would explain the multiple ripgrep instances.

@0x450x6c
Copy link
Author

0x450x6c commented Nov 25, 2019

Finally, found a reason: BurntSushi/ripgrep#999 (comment)


The issue can be reproduced by following command inside node_modules:

# timeout is important, otherwise system will freeze for long time
/usr/bin/time -v timeout 2 rg --vimgrep --color always --colors 'path:fg:white' -P . > /dev/null

...
Maximum resident set size (kbytes): 15112424
...


My current workaround is using --max-columns 120 (with that option, the multiple instances are still exist, but system doesn't freeze):

/usr/bin/time -v rg --vimgrep --color always --colors 'path:fg:white' -P --no-ignore -M 120 --max-columns-preview . > /dev/null

...
User time (seconds): 129.35 # (was launched without timeout)
...
Maximum resident set size (kbytes): 2094608
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants