On 16/12/2015 23:13, Tony Mechelynck wrote:
In a running Vim (be it Huge gvim GUI, or Huge vim in console, or Tiny
"vi" Vim in console) I observe the following:
:verbose set maxmem? maxmemtot? maxmempattern?
   maxmem=4022316
   maxmemtot=4022316
   maxmempattern=1000

I suppose that the "4G" values (on this 64-bit system with 8G
installed and about 65% used), which are about twice the maximum
mentioned in the help, correspond to the vague couple of sentences "On
64 bit machines higher values might work.  But hey, do you really need
more than 2 Gbyte for text editing?" under 'maxmemtot' only (and yes,
I'm compiling my own gvim and vi for linux-x86_64).

From Christian's remark above I assume that the values compiled-in
will be _increased_ if possible during startup, to reach half the
installed memory size (1G on his 2G virtual machine, 4G in a 64-bit
Vim on my 8G machine). The values obtained above on my system don't
depend on whether or not SeaMonkey (which uses 3.7 GiB all by its
ownself, but I have more than 300 open tabs) is running or not at the
time of Vim startup.

Hmmm, I can't find HAVE_AVAIL_MEM in the config files (in the auto/
subdir of my shadowdir). The only HAVE_A* that I can find is
HAVE_ATTRIBUTE_UNUSED. I assume that Linux compile always behaves as
if HAVE_AVAIL_MEM were defined.

No, on unix HAVE_TOTAL_MEM is defined which can set the maxmem options based on detected available memory reported by the OS, not just total physical memory. The HAVE_AVAIL_MEM is primarily used to limit memory allocations if it thinks there wont be any memory to allocate. On systems like Amiga and MSDOS this makes sense, but on pre-emptive OSes this is not the case, hence the removal on Windows.

The logic in this area is confusing being a combination of PP defines, conditional logic, and platform specific default values. I'll look some more into it to make the defaults on Windows more sensible and if the code can be simplified.

TTFN

Mike
--
If Satan ever loses his hair, there'll be hell toupee.

--
--
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui