Wednesday, February 14, 2018

Re: Will vim copy all file content to memory when i open a file?

On Thu, Feb 15, 2018 at 12:28 AM, Tony Mechelynck
<antoine.mechelynck@gmail.com> wrote:
> On Tue, Feb 13, 2018 at 9:49 PM, Lifepillar <lifepillar@lifepillar.me> wrote:
> [...]
>> In my system (macOS and Vim 8.0.1500), if I run `vim --clean`
>> repeatedly, both maxmem and maxmemtot are set to the same huge value, which
>> changes at every run, such as 9007199253926612 or
>> 9007199253919906. I wish that were approx. half the KB of my RAM
>> but alas it is not. Are those normal values to see?
>>
>> Life.
>
> I don't think so. These settings are supposed to be expressed in
> kilobytes, so the values you give above would be on the close order of
> 9 petabytes, which seems a little too big compared to the memory size
> usually available on today's computers.
>
> Try adding the following to your vimrc:
>
> " make sure the memory sizes are set to a "reasonable" value
> " but allow an explicit setting up to 2½ times our default
> if &maxmem > 5000000
> set maxmem=2000000
> endif
> if &maxmemtot > 5000000
> set maxmem=2000000

Oops! This should be "set maxmemtot=2000000"

> endif
>
> 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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: