Am 08.02.2012, 04:40 Uhr, schrieb Jose Armando Garcia <[email protected]>:
Special? What do you mean by special? Most OS use Virtual Memory so sure they can say here is a page and yet not have that page backed by physical memory. To my knowledge, they can only do this if the allocated memory points to an unmapped page. I doubt this is the case in non-trivial programs.
Yes, special. Like, say, you fork a process on Unix. Instead of copying all the uses memory, the processes share the same pages in read-only, copy-on-write mode. As soon as one of the processes writes to a memory page it is duplicated. The same is true for the 'zero page'. Just that there is one for the whole system and it can have a zillion references to it: http://en.wikipedia.org/wiki/Copy-on-write <- Look for calloc So the page can even be mapped and read without increasing the memory footprint, as I understand it.
