众所周知:http://linux.die.net/man/3/mallocBydefault,Linuxfollowsanoptimisticmemoryallocationstrategy.Thismeansthatwhenmalloc()returnsnon-NULLthereisnoguaranteethatthememoryreallyisavailable.Incaseitturnsoutthatthesystemisoutofmemory,oneormoreprocesseswillbekilledbytheOOMkiller.并且我们可以使用malloc(petabyt