ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.44k stars 2.81k forks source link

Ram usage, speed and stderr errors with python code #1627

Closed Paul92 closed 9 years ago

Paul92 commented 9 years ago

I don't know whether the problems I'm experiencing are related or not. Currently, I am editing 2 files, one of 3k lines of code, one of 2.5k lines of code and I have 2 or 3 smallers one opened as well (under 100 lines of code). All I am doing is to add some functions, not that many to justify an increase in ram usage from few tens of megabytes, maybe just over 100MB to over 1.5GB in about 2 hours.

A server restart (:YcmRestartServer) brings the ram usage back to tens of megabytes. I noticed that the ram usage is a debated issue, but in my case I don't have that much code and I'm not including other libs during editing.

Also, besides some speed issues (the cursor move quite slow sometimes), the completion does not really work after the dot. The stderr log is full of errors like: http://pastebin.com/1xUwhLjB.

Is there a way to fix this?

P.S. This happens in python 2. I have not tested other languages yet.

vheon commented 9 years ago

So we're talking about python files?

Paul92 commented 9 years ago

Yes. python2

vheon commented 9 years ago

I think that since jedi needs to parse all that code and generate the AST hence that ram is needed.

Also, besides some speed issues (the cursor move quite slow sometimes),

can you try without syntax highlight? just to be sure that the problem isn't vim itself.

he completion does not really work after the dot

meaning that it failed or that it propose some wrong candidates?

Paul92 commented 9 years ago

I know about jedi and the AST matter, but I don't understand why the ram usage increases drastically over time, even if I don't make significant code additions/file openings.

About the speed issue, it seems syntastic error highlighting is the problem.

However, the completion still does not work, reporting errors like the one from the pastebin above in the stderr file.

vheon commented 9 years ago

The error you're seeing on code completion is jedi that cannot handle some part of the code apparently, so I suggest you to open a bug upstream.

I know about jedi and the AST matter, but I don't understand why the ram usage increases drastically over time, even if I don't make significant code additions/file openings.

Again I think that jedi needs lots of ram for parsing you're code so I don't think we can do much about it. To exclude YCM entirely you could try to use jedi with vim-jedi and see if you get the same amount of ram. For now I'm going to close this as it seems that is not a YCM bug. If you find out otherwise please, read CONTRIBUTING.md and report back; we'll reopen the issue then.