lalitmetkar / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

bug report: feedkeys() leaks memory when invoked from a CursorHoldI autocommand #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I believe this can be trivially demonstrated by doing:

    :autocmd CursorHoldI * silent execute 'call feedkeys("\<C-r>\<Esc>", "n")'

hitting "i", and watching memory usage instantly skyrocket.  Various other 
permutations also trigger the leak though.  The speed of the leak will 
obviously vary with 'updatetime'; for the most immediate effect, set it to a 
very low value.  Oddly, feedkeys() in a CursorHold autocommand (i.e. in normal 
mode, not insert mode) does not leak.

Among other plugins, Conque <https://code.google.com/p/conque/> does this.  
It's a hack, obviously, but until Vim gets real support for some kind of async 
events, it's one of the more portable techniques; notably, it works without 
+clientserver so it can be used in vim in a PTY rather than a GUI.

I am not including a bugreport.txt because this seems to affect all versions of 
Vim 7.3 that I tried it with, so it does not seem runtime or plugin dependent.

Thanks for your consideration, and thanks for Vim,

-glyph

Original issue reported on code.google.com by Glyph.Lefkowitz on 29 Nov 2011 at 7:44

GoogleCodeExporter commented 9 years ago
I cannot reproduce the problem.

I tried with the current version 7.3.389 and using valgrind I could not see any 
memory leak.

What version of Vim are you using?  If it's older, please update first.

Original comment by brammool...@gmail.com on 30 Dec 2011 at 1:34

GoogleCodeExporter commented 9 years ago
I also tried to reproduce it but I could not.
I used a low value (2) for 'updatetime'.  
Memory usage of Vim remained constant (no leak).
I'm using Vim-7.3.470 on Linux x86.

Can you reproduce this using 'vim -u NONE' with minimal settings?

Original comment by dominiqu...@gmail.com on 7 Mar 2012 at 11:07

GoogleCodeExporter commented 9 years ago
Clausing as invalid, because it is unreproducable and no response for 2 years. 
If you can reproduce the issue starting from vim -u NONE -N, feel free to open 
a new bug report.

Original comment by chrisbr...@googlemail.com on 4 Oct 2014 at 11:47