Para que você tem /proc/sys/vm/overcommit_memory
definido? Da documentação do kernel:
0 - Heuristic overcommit handling. Obvious overcommits of
address space are refused. Used for a typical system. It
ensures a seriously wild allocation fails while allowing
overcommit to reduce swap usage. root is allowed to
allocate slightly more memory in this mode. This is the
default.
1 - Always overcommit. Appropriate for some scientific
applications.
2 - Don't overcommit. The total address space commit
for the system is not permitted to exceed swap + a
configurable percentage (default is 50) of physical RAM.
Depending on the percentage you use, in most situations
this means a process will not be killed while accessing
pages but will receive errors on memory allocation as
appropriate.
Assim, se você estiver usando 1, não há diferença. Se você estiver usando 2 e nenhum arquivo de troca do Linux, nenhum processo será capaz de alocar 512M de memória (virtual). O resultado não está claro para 0.
Editar: De link é assim que 0 funciona:
Heuristic overcommit attempts to work out how much memory the system
could give you if it reclaimed all the memory it could and no other
process used more RAM than it currently is; if you are asking for more
than this, your allocation is refused. In specific, the theoretical
'free memory' number is calculated by adding up free swap space, free
RAM (less 1/32nd if you are not root), and all space used by the
unified buffer cache and kernel data that is labeled as reclaimable
(less some reserved pages).
Por isso, também usa swap no cálculo. Em geral, eu seguiria a recomendação do RHEL de:
M = Amount of RAM in GB, and S = Amount of swap in GB, then
If M < 2
S = M *2
Else
S = M + 2