1
votes

I've read that, on a 32-bit system with 4GB system memory, 2GB is allocated to user mode and 2GB allocated to kernel mode. But, If I had a system with 512 MB of memory, would it be partitioned as 256 MB to user and 256 MB to kernel address space?

3
Where did you read this? Because, on 32-bit Windows (pre-Win7), you can only use a maximum of 3GB of memory. See msdn.microsoft.com/en-us/library/aa366778(v=vs.85).aspx for more details. - David Weiser
@David: These are physical memory limitations. Virtual address space is always 4GB on a 32-bit system. - Cat Plus Plus
I was under the impression that "system memory" refers to physical RAM on the system. I say that because this is all the memory one could identify if an OS was absent. - David Weiser
Actually I referred "system memory" as physical RAM in my question but I didn't know it was virtual memory on HDD. - user32344

3 Answers

3
votes

You are confusing physical and virtual memory. 2GB is allocated to user/system, but it is virtual memory. It is even more correct to say that they are not rather allocated but they constitute an addressing space. Initially this space is not bound to physical memory at all. When application actually needs memory (first time is at start up) physical memory is allocated and some addresses from address space are mapped to it. When memory is allocated but not used long enough or PC is running out of physical memory data can be dumped in swap file, and stay there until requested. This mapping is transparent for application and it has no idea where data currently is: on chip or on HDD. So the address space is always splitted the same way.

1
votes

This is not about memory (physical or virtual), but about address space.

You can plug 16GB of physical memory into your computer and make a 100GB swapfile, but 32-bit (non-enterprise) Windows will still only see 4GB (and subtract 0.75 GB for GPU memory and such). Via PAE, it could use more, but non-enterprise versions won't do that.

On top of the actual amount of memory, there is address space, which is limited to 4GB as well. Basically it is no more and no less than the collection of "numbers" (which, in this case, are addresses) that can be represented by a 32 bit number. Since the kernel will need memory too, there is some arbitrary line drawn, which happens to be at the 2GB boundary for 32bit Windows, but can be configured differently, too.

It has nothing to do with the amount of memory on your computer (virtual or phsyical), but it is a limiting factor of how much memory you can use within a single program instance. It is not, however, a limiting factor on the memory that several programs could use.

0
votes