On Tue, Feb 13, 2018 at 2:41 AM, Matt Ackeret <matt...@apple.com> wrote:
> On Sun, 11 Feb 2018, Zhigang Song wrote:
>>Will vim copy all file content to memory when I open a file?
>
> No, that's why vim is fast opening gigantic files.

However, unlike sed, Vim is not a stream editor (i.e. an editor which
processes the file in sequence from beginning to end, writing the
output at the same time). Vim edits its file(s) in whatever sequence
the user moves the cursor, writes it only for :w :x or similar, and
for that it "prefers" to hold the whole file in memory, and it will do
so as long as each buffer is small in comparison to 'maxmem' and all
buffers combined in comparison to 'maxmemtot'. On my 64-bit system,
Vim sets both these options by default to 4021798 (a little under 4
GiB which would be 4194304 KiB, and exactly half the value on the
MemTotal line of /proc/meminfo). It doesn't use all that in practice
though: my big memory-gobbler is the browser, which I have to restart
every few days to reclaim some RAM.

Best regards,
Tony.

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to