linux OS gives u access to Physical memory*2 memory space;
to illustrate this just run following code in your linux OS.
now try this code, just little changes i already have made.
i hope u have understood how does linux gives u access to physical memory more than u really have.
in memory2.c instead of allocating size in MB, I have allocated size in terms of GB.
run the code to understand how does it actually works.