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

Unite causes vim to freeze with 100% cpu usage #798

Closed
jakubgs opened this issue Dec 16, 2014 · 8 comments
Closed

Unite causes vim to freeze with 100% cpu usage #798

jakubgs opened this issue Dec 16, 2014 · 8 comments

Comments

@jakubgs
Copy link

jakubgs commented Dec 16, 2014

Hi,

I'm using vim 7.4.488 on Debian Jessie with newest Unite and vimproc.vim(for file_rec/async). I've managed to reproduce this problem without vimproc.vim so I don't think it's relevant.

At (seemingly)random times vim will freeze, and when looked up in htop it's using 100% or close to 100% cpu:

gvim_100_cpu

The freezes sometimes happen when actively using Unite, but sometimes not.

I've tried tracking down this problem by using :profile commands but nothing shows up. Execution times logged using :profile seem to not include the long freezes(several seconds, more than a minute, sometimes endless).

Here's a profile.log from a freeze that lasted about more than 3 minutes:

https://gist.githubusercontent.com/PonderingGrower/4689817e5bcfbf52895c/raw/7ab81ae22d774cffd9551274bc19a02c59c7b618/profile.log

In order to reproduce it I've spent a bit of time doing searches with unite. To be exact using this:

nnoremap <c-i>     :execute('Unite buffer file_mru file_rec/async:'.g:projectroot)<CR>

I have tried disabling plugins one by one and I've narrowed down this issue to Unite, but I do not know what to do next to identify what exactly is causing it.

I will be happy to follow any debugging steps you might suggest.

@Shougo
Copy link
Owner

Shougo commented Dec 16, 2014

I think it is same problem. You can test GC patch.

#701

@Shougo
Copy link
Owner

Shougo commented Dec 16, 2014

You can see that Vim uses 2GB memory in the screen shot.
So, Vim's GC worked. But current Vim's GC routine has problem.

@Shougo
Copy link
Owner

Shougo commented Dec 16, 2014

It is vim_dev thread.

https://groups.google.com/forum/#!searchin/vim_dev/GC/vim_dev/DBYOdHQWvqY/1WH04_dwETIJ

You can request to include the patch in the thread.

@jakubgs
Copy link
Author

jakubgs commented Dec 16, 2014

Thanks! I did a lot of googling but I did not find that patch.

I'll try apllying it and see if it helps.

And thanks a lot for creating Unite. It's amazing!

@luishdez
Copy link

I encounter the same problem and I did a fork with the patch applied here: https://github.com/luishdez/vim. I use "OS X" and I did brew edit vim and change to the zip and sha1 , and re-install with brew. May be this will help you.

@jakubgs
Copy link
Author

jakubgs commented Dec 17, 2014

I use Debian so what I did was:

$ sudo apt-get source vim-gtk
$ tar zxvf vim-gtk-XYZXYZXYZ.tar.gz
$ cd vim-gtk-XYZXYZXYZ
$ curl -o gb_patch.diff https://gist.githubusercontent.com/mattn/0c58a7398c63ab4c3066/raw/2e1ff4e5368e32ff1017e86b563148c106838778/gistfile1.diff
$ path -p1 < gb_patch.diff
$ cd src
$ # ./configure needs to be run with sudo or it won't find gtk2 libraries
$ sudo ./configure --with-features=huge --enable-gui=gtk2 --with-x --enable-fontset
$ make
$ sudo checkinstall

checkinstall will create a deb package and install it for you, which is better than cluttering up your root with make install. Wrote this down for anyone that might google this searching for a solution.

I haven't used it that much yesterday but I haven't experienced even one freeze, so I think it's fixed. We'll see today but it looks good. THANKS!

@Shougo Shougo closed this as completed Dec 17, 2014
@Shougo
Copy link
Owner

Shougo commented Feb 3, 2015

@jakubgs
Copy link
Author

jakubgs commented Feb 4, 2015

That's awesome to hear! I won't have to keep building my own deb package.

Thansk Shougo, you are the man!

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

No branches or pull requests

3 participants