What do you have /proc/sys/vm/overcommit_memory
set to? From the kernel documentation:
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.
Thus if you are using 1 there is no difference. If you are using 2 and no linux swap file then no process will be able to allocate 512M of (virtual) memory. The outcome isn't clear for 0.
Edit: From http://utcc.utoronto.ca/~cks/space/blog/linux/LinuxVMOvercommit this is how 0 works:
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).
So it uses swap in the calculation as well. In general I'd follow the RHEL recommendation of :
M = Amount of RAM in GB, and S = Amount of swap in GB, then
If M < 2
S = M *2
Else
S = M + 2