While I am working with nvim, I get occasion periods of 100% cpu stems mostly from the Python subprocess of nvim (some other times it is node). It happens when I do nothing in vim.

I tried to do profiling of vim functions, but nothing came up.

Apperently, the python plugins are: coc-python, leaderF, vim-netranger, ycm(disabled prob), vimspector. They are ordered by likelihood from the most likely to the least.

Is there a good way to debug this?

  • 2
    you may have answers if you disclose which python plugins you are using
    – Mass
    Jun 5 '20 at 0:29
  • I will examine more carefully the open files and ports in activity monitor.
    – eyal karni
    Jun 5 '20 at 0:42
  • @eyalkarni please edit your question to include these information, it's easier to spot than in the comments
    – statox
    Jun 5 '20 at 10:20
  • Are there autocommands setup on CursorHold?
    – D. Ben Knoble
    Jun 5 '20 at 12:35
  • coc_nvim , gitgutter , ALEEvents, auto_save , gitgutter, airline_ale
    – eyal karni
    Jun 5 '20 at 20:09

You could use that vimspector you have installed (in another instance of vim) to attach to the python process and get a stack trace.

Debugpy supports attach-by-PID so you do something like this:

python -m debugpy --listen localhost:5678 --pid <pid of the spinning process>

Then use vimspector to attach to it, using the simple remote-attach config.

You should then be able to see what it's doing; from the stack trace you could at least identify the errant plugin and report to the maintainer. I hope it's not one of mine ;)

Of course, you could also use pdb or something :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.