neoclide / coc-lists

Common lists for coc.nvim
264 stars 24 forks source link

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

Closed 0x450x6c closed 4 years ago

0x450x6c commented 5 years ago

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 commented 5 years ago

Please provide :CocInfo

0x450x6c commented 5 years ago

: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 commented 5 years ago

It reproduces only in large codebases

patrickpichler commented 5 years ago

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 commented 5 years ago

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

patrickpichler commented 5 years ago

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 commented 5 years ago

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 commented 4 years ago

Finally, found a reason: https://github.com/BurntSushi/ripgrep/issues/999#issuecomment-409393882


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 ...