-
-
Notifications
You must be signed in to change notification settings - Fork 293
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
Excessive CPU usge #637
Comments
I'm experiencing this as well. I believe it started after an update, so I'm going to see if I can roll back to an older version and find when it started. |
@pdilyard yeah, I believe so too. I just can't figure out what commit to rollback to. |
@magicalbanana I made an educated guess and picked |
I'm also experiencing this after updating a few hours ago. It seems to me that the python3 instances stick around after vim is closed, accumulating until you're stuck at 100% CPU usage. I have |
Unfortunately, I cannot reproduce the problem. |
Please test the latest master version. |
And please test the patch. diff --git a/autoload/deoplete/util.vim b/autoload/deoplete/util.vim
index a0d5bcc..53af8f3 100644
--- a/autoload/deoplete/util.vim
+++ b/autoload/deoplete/util.vim
@@ -217,8 +217,10 @@ function! deoplete#util#rpcnotify(event, context) abort
if deoplete#init#_check_channel()
return ''
endif
+
call s:notify(a:event, a:context)
- if has('nvim') && a:event ==# 'deoplete_on_event'
+
+ if a:event ==# 'deoplete_on_event'
\ && a:context['event'] ==# 'VimLeavePre'
while g:deoplete#_stopped_processes < g:deoplete#max_processes
sleep 50m |
If so, it is after quitting problem? |
I think it depends on your configuration or installed plugins. I have got similar issue from @wsdjeg. He has used So please test deoplete with the minimal init.vim. |
This is happening on linux too. When using vim 8, deoplete makes the following processes:
After quitting vim this process consumes excessive cpu (> 225%) and does not quit:
I have reproduced with the following minimal vimrc: set nocompatible
call plug#begin('~/.vim/plugged')
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif
call plug#end()
let g:deoplete#enable_at_startup = 1 |
It is reproduced in neovim? Please test the patch. |
Not in neovim for me. Only in vim 8.
The patch works for me, but adds a noticeable delay to vim 8 quit. There is no delay in neovim. |
OK. So please the patch instead. diff --git a/autoload/deoplete/util.vim b/autoload/deoplete/util.vim
index a0d5bcc..30e7b43 100644
--- a/autoload/deoplete/util.vim
+++ b/autoload/deoplete/util.vim
@@ -218,10 +218,10 @@ function! deoplete#util#rpcnotify(event, context) abort
return ''
endif
call s:notify(a:event, a:context)
- if has('nvim') && a:event ==# 'deoplete_on_event'
+ if a:event ==# 'deoplete_on_event'
\ && a:context['event'] ==# 'VimLeavePre'
while g:deoplete#_stopped_processes < g:deoplete#max_processes
- sleep 50m
+ sleep 10m
endwhile
endif
return '' |
By the way, if |
Yes. But it is slower implementation than before. I will implement serial completion support. |
It is the same result with |
Okay, thank you for your help and development Shougo |
@Shougo since the latest update I do not seem to have any problems anymore with CPU usage, and also no delay when closing neovim! Thank you! |
OK. I will close the issue later. |
I unfortunately still have exactly that problem (zombie Python process freezing neovim on exit; no completion) on current master with neovim on macOS (but did not yesterday before the updates); will try to find a minimal reproducible configuration. |
It is neovim? If so, it seems your configuration or plugins problem. |
Indeed, it is with neovim, and certainly a plugin interaction (I suspect it's https://github.com/lervag/vimtex/, specifically the omnifunc source). I'm currently working on the minimal vimrc. |
@clason Please see it. deoplete needs own VimLeavePre autocmd. |
No, I don't think that's quite it, because a) it worked yesterday and b) the freeze happens while nvim is running (no completion). I'll know more when I isolate the minimal configuration and get the log file. |
yup, same here, neovim and below is my plugin list, hope it helps: https://gist.github.com/zhuangya/156fd40c05c5ab99964b7d774cbcbd8b |
Oh, it seems... Please test the patch. |
OK, here's the minimal vimrc call plug#begin('~/.vim/plugged')
Plug 'lervag/vimtex'
Plug 'Shougo/deoplete.nvim'
call plug#end()
let g:tex_flavor='latex'
let g:deoplete#enable_at_startup = 1
if !exists('g:deoplete#omni#input_patterns')
let g:deoplete#omni#input_patterns = {}
endif
let g:deoplete#omni#input_patterns.tex = g:vimtex#re#deoplete The problem are the lines with the |
omni source... I know the slowness problem. |
Yes, that patch fixes it! |
@zhuangya Please create the minimal vimrc. You have installed many plugins. Like this. |
Especially, #635 (comment) |
@Shougo i thank you for you patient! |
btw, my however, since my neovim python-client is out-of-date, i upgrade them anyway,then everything back to normal. |
OK. It seems neovim package was broken. |
Just to follow up - I'm using Vim 8.0 with patches 1-1436 under Arch Linux. The supplied patch does solve the issue! |
@nsfm |
@blueyed Shougo's patch from 19 hours ago:
After applying this change, the python3 processes die when I close Vim correctly with However @Shougo if I close Vim with
Indeed if I kill multiple instances of Vim this way, the yarp.py processes continue to pile up. |
#641 gets rid of this whole waiting, please try it also. |
I have merged #641. |
Warning: I will close the issue without the minimal init.vim and the reproduction instructions.
Problems summary
Crazy CPU usage
Expected
Should not be excessive
Environment Information
c5f8165
OSX
Vim 8
:checkhealth
or:CheckHealth
result(neovim only):Provide a minimal init.vim/vimrc with less than 50 lines (Required!)
The reproduce ways from neovim/Vim starting (Required!)
Screen shot (if possible)
The text was updated successfully, but these errors were encountered: