jjzjj

petabyte

全部标签

c - 为什么我们可以分配一个 1 PB (10^15) 的数组并访问最后一个元素,但不能释放它?

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

c - 为什么我们可以分配一个 1 PB (10^15) 的数组并访问最后一个元素,但不能释放它?

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