Memory Management in Win NT/2000

A

Abhishek

Hello,
I would like to understand the fundamental of Virtual Memory
Management in Windows 2000.
My question is does the Windows 2000 starts using Virtual Memory right from
the word go..?
For example lets say I have 200 MB of free physical memory, and I want to
execute a program which requires
a total of 10 MB of memory. Though what I know is that Windows NT/2000
allocates 4 GB of address space
to the process, but what I am not sure is whether out of 10 MB requirement
of the process, how much of the
actual physical memory is allocated to the process. Assuming there is no
other user process running on the system and
all the physical memory can be used. Now in this case whether Windows
NT/2000 would keep only a portion of the
10 MB in physical memory and rest on disk(Virtual Memory) or whether it
would put all the 10 MB in memory so that
the process has minimum page faults and thus improve performance.
I hope I was able to explain my doubt,

Thanks in advance,
Abhishek.
 
J

Jim Nugent

Abhishek said:
Hello,
I would like to understand the fundamental of Virtual Memory
Management in Windows 2000.
My question is does the Windows 2000 starts using Virtual Memory right from
the word go..?
For example lets say I have 200 MB of free physical memory, and I want to
execute a program which requires
a total of 10 MB of memory. Though what I know is that Windows NT/2000
allocates 4 GB of address space
to the process, but what I am not sure is whether out of 10 MB requirement
of the process, how much of the
actual physical memory is allocated to the process. Assuming there is no
other user process running on the system and
all the physical memory can be used. Now in this case whether Windows
NT/2000 would keep only a portion of the
10 MB in physical memory and rest on disk(Virtual Memory) or whether it
would put all the 10 MB in memory so that
the process has minimum page faults and thus improve performance.
I hope I was able to explain my doubt,

It will try to load the whole program. This is in contrast to, say, AT&T
Unix where it would create the necessary control structures, and then "fault
the pages in" as they are referenced. Since the code is "pure" it can use
the executable for this purpose and never has to write code to the page file
because it never gets "dirty." It can throw pages way and get them later
from the executable.

I don't know if Windows is this smart, or is willing to sacrifice the
performance.
 
D

Dan Lovinger [MSFT]

Windows has a demand paged memory model, like other modern OS.

Application launch has some pretty sophisticated tracing employed to track
pages faulted in in the first ~10 seconds, which are then gang-loaded in
parallel on subsequent launches. This results is some fairly dramatic
speedups. This cuts across all DLLs/resources the image touches ...

http://msdn.microsoft.com/library/d..._0eecebea-e58b-4c95-8520-9b1dc2bc6196.xml.asp

(with apologies for wording like "demands and pages")

The Windows Internals book goes into a lot more detail about the memory and
cache managers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top