ycm-core / YouCompleteMe

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

Python2 run out of memory #1579

Closed WallanceLee closed 9 years ago

WallanceLee commented 9 years ago

Hi, everyone I am a new user to YCM, and I like this plugin.For a long time, when I input several lines of code,it will SHUTDOWN or Connection refused or Connection aborted.But I just try it. Today, I use my vim with YCM under console, and input several lines of codes. But the machine just lose control and be trapped.At the same time, the kernel output infomation like this: Python2 run out of memory, sacrifice the child process. As it is under console, I can not snapshot the screen. I am so sorry for this.YCM just lost reflection,so I cannot get any log file.I am so sorry for this. I use YCM of the latest version. The following are my related software version: vim --version VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun 30 2015 23:09:41) Included patches: 1-738 Modified by Gentoo-7.4.738 Compiled by wallance@wallance Huge version without GUI. Features included (+) or not (-): +acl +farsi +mouse_netterm +syntax +arabic +file_in_path +mouse_sgr +tag_binary +autocmd +find_in_path -mouse_sysmouse +tag_old_static -balloon_eval +float +mouse_urxvt -tag_any_white -browse +folding +mouse_xterm -tcl ++builtin_terms -footer +multi_byte +terminfo +byte_offset +fork() +multi_lang +termresponse +cindent +gettext -mzscheme +textobjects +clientserver -hangul_input +netbeans_intg +title +clipboard +iconv +path_extra -toolbar +cmdline_compl +insert_expand +perl +user_commands +cmdline_hist +jumplist +persistent_undo +vertsplit +cmdline_info +keymap +postscript +virtualedit +comments +langmap +printer +visual +conceal +libcall +profile +visualextra +cryptv +linebreak +python/dyn +viminfo +cscope +lispindent +python3/dyn +vreplace +cursorbind +listcmds +quickfix +wildignore +cursorshape +localmap +reltime +wildmenu +dialog_con +lua +rightleft +windows +diff +menu -ruby +writebackup +digraphs +mksession +scrollbind +X11 -dnd +modify_fname +signs +xfontset -ebcdic +mouse +smartindent -xim +emacs_tags -mouseshape -sniff +xsmp_interact +eval +mouse_dec +startuptime +xterm_clipboard +ex_extra +mouse_gpm +statusline -xterm_save +extra_search -mouse_jsbterm -sun_workshop -xpm system vimrc file: "/etc/vim/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" fall-back for $VIM: "/usr/share/vim" Compilation: x86_64-pc-linux-gnu-gcc -c -I. -Iproto -DHAVE_CONFIG_H -march=native -O2 -pipe -fomit-frame-pointer -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: x86_64-pc-linux-gnu-gcc -Wl,-E -Wl,-O1 -Wl,--as-needed -o vim -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -lncurses -lelf -lnsl -lacl -lattr -lgpm -ldl -L/usr/lib -llua -Wl,-E -Wl,-O1 -Wl,--as-needed -L/usr/lib64/perl5/5.20.2/x86_64-linux/CORE -lperl -lnsl -lnm -ldl -lm -lcrypt -lutil -lc Python 2.7.10 I guess whether there is some memory leak. Hope the information above can help you solve my problem. Thanks. Yours sincerely

WallanceLee commented 9 years ago

I have a test code.

#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>

int main()
{
using namespace boost::numeric::ublas;
matrix<double> m(3,3);
for (unsigned i = 0; i < m.size1(); ++ i)
for (unsigned j = 0; j < m.size2(); ++ j)
m(i,j) = i * 3 + j;
std::cout<<m<<std::endl;
}

Whenever I input codes above, it lose reflection, and Python2 run out of memory. Please recommend the software version like llvm,clang,python2. I just want to use this plugin for happier life. Thank you.

WallanceLee commented 9 years ago

boost/numeric/ublas/matrix.hpp boost/numeric/ublas/io.hpp those are headers of codes above

Valloric commented 9 years ago

Those boost headers are very heavy with templates etc so they probably expand to a ton of C++ code. This combined with your machine having a low amount of RAM (a guess) results in the server running out of memory.

There's not much we can do about this. Libclang needs more RAM than your machine has to build an AST of your code. "Get more RAM" is not a very satisfying answer, but I don't have a better one, sorry.