Search code examples
memorywindows-xpvirtual32-bit

Virtual memory size


I have virtual memory size set to 756 MB on windows xp. but when reading on msdn it says virtual memory for each process on 32 bit OS is 4 GB by default. how it is different from the size of virtual memory that i set?

**Memory**      **range**                    **Usage**
Low 2GB (0x00000000 through 0x7FFFFFFF)  Used by the process.
High 2GB (0x80000000 through 0xFFFFFFFF)    Used by the system.

also, how is the range is same for each process?


Solution

  • Your page file is set to 756 Mb. The page file is like extra RAM, but backed by the disk.

    Virtual Memory, however, is different, and kind of complex.

    Every process gets an address space of 4 Gb. This is the range of a 32-bit pointer, so that' works out nicely. Half of that is reserved for the Kernel (Operating System), and is the same in every process. The other half is for the process itself, and is unique to that process.

    The operating system allocates "pages" to the private portion of memory as the process asks for it. The pages get a slot in the process's address space which has nothing at all to do with where they are in physical RAM. In fact, they may not even be in RAM if they're not currently being used. The operating system will "swap" pages out to the page file if it wants some physical RAM for something else.

    An important thing to remember is that address 0x10000 in your process is totally different from 0x10000 in another process.

    Fortunately, the operating system juggles all this around so you don't have to.