On 4/4/07, Yakov Lerner <[EMAIL PROTECTED]> wrote:

> Max,
>
> I recalled two more things. Is your 'hidden' option set ? If it's set,
> vim *will* grow. With 'hidden' set, vim will keep in memory much data
> about old buffers. If you want to minimize memory, first thing you'd do is
> ':set nohidden'. To check your current state, 'set hidden?'.
>
> Second important thing is :bw. Even with ':set nohidden', vim will
> remember some data for every file it ever visited. To free this data
> completely, you need to :ls!, then :bw for every unused buffer.
>
> I think these two things will decrease vim's memory footprint
> (in case you had 'set hidden').
>
> Yakov

I do have 'hidden' set, because I like to keep things around. :ls! shows that I 
currently have about 550 buffers open. I know this seems like a lot, but we do 
have a large code base!

The thing is that if I open this session then it takes up about 90Mb, which is 
fine for me. But after a few hours and modifications to only a handful of 
buffers, this has grown to 130Mb or so, which seems excessive.

Is there any way I can limit the number of 'hidden' buffers? It'd be nice if it 
had a history much like : and /, where the least recently used things fall off 
the bottom (top?). I'm sure that I could manage with only about 100 hidden 
buffers.

Failing that, do you think it could be done in script? Do something like get an 
array of all the files, check the last touched time, and then discard the 
oldest?

Also, starting up with -u NONE does indeed still exhibit the same "memory 
leakage" (or use), although it seems a bit slower.

Thanks,

Max

Reply via email to