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

CPU 100% #58

Closed
wention opened this issue Sep 17, 2016 · 13 comments
Closed

CPU 100% #58

wention opened this issue Sep 17, 2016 · 13 comments

Comments

@wention
Copy link

wention commented Sep 17, 2016

Problems summary

CPU up to 100% about two min

Expected

Environment Information

  • OS:ubuntu 15.04
  • Neovim version: 0.1.6-dev

Provide a minimal init.vim with less than 50 lines (Required!)

" Your minimal init.vim
        " for python
        call dein#add('zchee/deoplete-jedi', {
                        \ 'depends': 'deoplete.nvim',
                        \ 'on_event': 'InsertEnter',
                        \ 'on_ft': 'python',
                        \ })

The reproduce ways from neovim starting (Required!)

  1. nvim get-pip.py
  2. and type " import "

Screen shot (if possible)

image
image

Upload the log file

THE LOG IS TOO LARGE.
PLEASE!! rename it with log_5970.tar.xz first.

log_5970.zip

WISH HELP TO YOU!

@Shougo
Copy link
Collaborator

Shougo commented Sep 17, 2016

What is get-pip.py?

@wention
Copy link
Author

wention commented Sep 17, 2016

@Shougo a script help to install pip

@Shougo
Copy link
Collaborator

Shougo commented Sep 17, 2016

https://bootstrap.pypa.io/get-pip.py

It is 1.5MB. Too huge.
deoplete-jedi should skip the analysis.

@hackaugusto
Copy link
Contributor

I'm having the same issue with a small or empty file:

  • start nvim -u init.vim t.py nvim_before_insert
  • enter insert mode and insert a new line nvim_after_insert

For some reason the python3 will spawn subprocesses and the python2 will use 100% of the cpu. neovim interface will block at this point and it won't be usable.

init.vim:

" plugins
let s:plugins_base_dir=$HOME . "/.config/nvim/plugins"
let s:dein_dir=s:plugins_base_dir . "/repos/github.com/Shougo/dein.vim"

" use the system-wide python and the python-neovim package
let g:python_host_prog='/usr/bin/python2'
let g:python3_host_prog='/usr/bin/python3'

exe "set runtimepath+=" . s:dein_dir
set completeopt+=noinsert

if dein#load_state(s:plugins_base_dir)
  call dein#begin(s:plugins_base_dir)

  call dein#add(s:dein_dir)

  " completion
  call dein#add('Shougo/deoplete.nvim')
  call dein#add('zchee/deoplete-jedi')

  call dein#end()
  call dein#save_state()
endif

call deoplete#enable()

let g:jedi#completions_enabled = 0
let g:jedi#use_tabs_not_buffers = 1
let g:jedi#goto_command = 'gd'
let g:jedi#goto_assignments_command = 'ga'
let g:jedi#goto_definitions_command = ''
let g:jedi#usages_command = ''
let g:jedi#rename_command = '<leader>r'
let g:jedi#rename_command = ''
let g:jedi#show_call_signatures = 1
let g:jedi#show_call_signatures_delay = 100
let g:jedi#smart_auto_mappings = 0

versions:

> nvim --version
NVIM 0.1.7
Build type: Release
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -Wconversion -O2 -DNDEBUG -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -D_GNU_SOURCE -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.1.7/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include
Compiled by builduser
Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui
For differences from Vim, see :help vim-differences
   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"
> /usr/bin/python3 --version
Python 3.6.0
> /usr/bin/python2 --version
Python 2.7.13
dein.vim: 728f8296f0973c18f6184c0631a6091469c55430
deoplete.vim: 7a9865ae3db5ebed3c5b96f48ed3d769a99c72cf
deoplete-jedi: a4dd511535a6fe06717a7bd2d680b9b87ade595d

@Shougo
Copy link
Collaborator

Shougo commented Feb 28, 2017

@hackaugusto deoplete and deoplete-jedi does not spawn Python2 interface.
I think other plugins use it.
You should check your init.vim.

@hackaugusto
Copy link
Contributor

Humm, it could be this issue: davidhalter/jedi-vim#687

I thought the command vim -u init.vim was sufficient for executing a vim from a new configuration, sorry about that.

@blueyed
Copy link
Collaborator

blueyed commented Mar 1, 2017

For Jedi: davidhalter/jedi#878

@Shougo
Copy link
Collaborator

Shougo commented Mar 1, 2017

Humm, it could be this issue: davidhalter/jedi-vim#687

So, it is not deoplete-jedi problem.

@blueyed
Copy link
Collaborator

blueyed commented Mar 2, 2017

I had bisected it in Jedi, and it is probably a newer issue then the reported one.

I think deoplete-jedi should abort after some timeout to prevent this and report an error with traceback. /cc @tweekmonster

@tweekmonster
Copy link
Collaborator

@blueyed It's logged in #112 but not reported to Vim's message area. I couldn't get that to work for some reason without killing Neovim's python host.

@zhou13
Copy link
Contributor

zhou13 commented May 19, 2017

@tweekmonster I don't think adding a timeout is a good solution for this problem: it will just stop completion for this file totally and have side effect #124. It is better just stopping the completion totally when the input file is too large.

@Shougo
Copy link
Collaborator

Shougo commented May 27, 2017

I have added limit option in deoplete.
Please use it.

@Shougo Shougo closed this as completed May 27, 2017
@blueyed
Copy link
Collaborator

blueyed commented May 27, 2017

For reference: Shougo/deoplete.nvim@04de49e

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

No branches or pull requests

6 participants