How Windows uses physical memory

T

Thomas

I'm trying to settle a debate with someone about how Windows (32bit)
allocates memory. In short, my opponent seems to think that ALL applications
will be swapped in and out of the SAME 2 GB of *physical* memory. I suggested
that this was nonsense and instead the OS will use whatever physical memory
it has available. Thus, in theory, if you have a 4 GB system with no swap
file, you could run three applications that take 1 GB assuming that the OS is
consuming no more than 1 GB. Can I get an engineer at Microsoft to confirm
that this is how it works and if so, can I get a link that outlines that
architecture?
 
E

Earle Horton

Enter "superfetch" in your Live Search tool bar. There are and have been
different strategies for allocating physical memory.

Cheers,

Earle
 
M

Mark L. Ferguson

Windows uses all physical memory, all the time. When the 'least used' page
is overwritten, it is either paged to VM or lost( if no VM.) Same with VM,
least used is overwritten, and lost. When apps do a memalloc(), they always
write to physical memory, pushing out least used. Every page of memory, of
every app, addresses a 4 gig space. 2 gigs allocated to the app, 2 gigs to
system. How physical memory is used is not about what an app takes up, it's
what was used last.
--
Was this helpful? Then click the Ratings button. Voting helps the web
interface.
http://www.microsoft.com/wn3/locales/help/help_en-us.htm#RateAPostAsAnswer
Mark L. Ferguson
..
 
D

Darrell Gorter[MSFT]

Hello,
Use this article as a reference:
http://support.microsoft.com/kb/555223
The applications get assigned virtual address space not physical RAM
Thanks,
Darrell Gorter[MSFT]

This posting is provided "AS IS" with no warranties, and confers no rights
--------------------
| >Thread-Topic: How Windows uses physical memory
| >thread-index: Aci7pO7jbg99WKy3RMuS+ThdHEGUbQ==
| >X-WBNR-Posting-Host: 72.245.177.250
| >From: =?Utf-8?B?VGhvbWFz?= <[email protected]>
| >Subject: How Windows uses physical memory
| >Date: Wed, 21 May 2008 17:44:03 -0700
| >Lines: 9
| >Message-ID: <[email protected]>
| >MIME-Version: 1.0
| >Content-Type: text/plain;
| > charset="Utf-8"
| >Content-Transfer-Encoding: 7bit
| >X-Newsreader: Microsoft CDO for Windows 2000
| >Content-Class: urn:content-classes:message
| >Importance: normal
| >Priority: normal
| >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2992
| >Newsgroups: microsoft.public.windows.vista.general
| >Path: TK2MSFTNGHUB02.phx.gbl
| >Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.windows.vista.general:307130
| >NNTP-Posting-Host: tk2msftsbfm01.phx.gbl 10.40.244.148
| >X-Tomcat-NG: microsoft.public.windows.vista.general
| >
| >I'm trying to settle a debate with someone about how Windows (32bit)
| >allocates memory. In short, my opponent seems to think that ALL
applications
| >will be swapped in and out of the SAME 2 GB of *physical* memory. I
suggested
| >that this was nonsense and instead the OS will use whatever physical
memory
| >it has available. Thus, in theory, if you have a 4 GB system with no
swap
| >file, you could run three applications that take 1 GB assuming that the
OS is
| >consuming no more than 1 GB. Can I get an engineer at Microsoft to
confirm
| >that this is how it works and if so, can I get a link that outlines that
| >architecture?
| >
 
T

Thomas

Thank you. I had already discovered that article. Given a bit of research
through my books, I know that I'm right. The OS can use more than 2 GB of
physical memory for applications. It simply cannot have in use at any one
time more than 4 GB of memory.

BTW, propman wins Troll of the Week award. Good job buddy. Keep anchoring
the bottom of the curve. Someone has to be at the bottom and you seem to want
the position.
 
D

dennis

Thomas said:
It simply cannot have in use at any one
time more than 4 GB of memory.

It actually can do that also. If you get a Windows that supports more
than 32 bit in PAE mode, a bunch of applications can take up way more
than 4GB of physical ram in total
 
P

propman

Thomas said:
Thank you. I had already discovered that article. Given a bit of research
through my books, I know that I'm right. The OS can use more than 2 GB of
physical memory for applications. It simply cannot have in use at any one
time more than 4 GB of memory.

BTW, propman wins Troll of the Week award. Good job buddy. Keep anchoring
the bottom of the curve. Someone has to be at the bottom and you seem to want
the position.

Now go look up the meaning of troll pertaining to it's relevance in
newsgroups.....'cause obviously you have no clue.

The of sending those url's along was to point out the subject was
something you could have easily found out by doing your homework
yourself before posting an inquiry here.....which you did and by your
own words, found the information before you saw the any replies.
Therefore you have just admitted to wasting the valuable time and
efforts of anyone who tried to help you.....buddy boy.

Don't bother replying.......

<plonk>
 
T

Tim Slattery

Thomas said:
Thank you. I had already discovered that article. Given a bit of research
through my books, I know that I'm right. The OS can use more than 2 GB of
physical memory for applications. It simply cannot have in use at any one
time more than 4 GB of memory.

A 32-bit system only has 4GB of address space, so it can't possibly
use more than 4GB of physical RAM. Because that address space also has
to be used for video RAM, BIOS, and a few other things, it can't
access a full 4GB of physical RAM. See
http://members.cox.net/slatteryt/RAM.html

The 2GB thing is that each virtual memory space is divided evenly
between the OS and the application, each gets 2GB of virtual memory.
Some pages of that VM will be on disk and various places in physical
RAM at any time, the OS has to keep track of where each piece is.

All addressable RAM is used to keep pages of the various VM spaces.
 
T

Tim Slattery

dennis said:
It actually can do that also. If you get a Windows that supports more
than 32 bit in PAE mode, a bunch of applications can take up way more
than 4GB of physical ram in total

Only Windows Server systems use PAE. No version of XP or Vista
supports it.
 
D

dennis

Tim said:
Only Windows Server systems use PAE. No version of XP or Vista
supports it.

That depends on your definition of PAE. Both XP and Vista are capable of
changing the CPU into PAE mode, because that is needed to have support
for DEP. The memory manager just chooses to use no more than 32 bits in
the page table for addressing memory.
 
D

dennis

Tim said:
A 32-bit system only has 4GB of address space, so it can't possibly
use more than 4GB of physical RAM.

And we can agree that this address space (the physical one) is expanded
when you enter PAE mode? XP and Vista just don't take advantage of it
 
T

Tim Slattery

dennis said:
That depends on your definition of PAE. Both XP and Vista are capable of
changing the CPU into PAE mode, because that is needed to have support
for DEP. The memory manager just chooses to use no more than 32 bits in
the page table for addressing memory.

Agreed. No version of 32-bit XP or Vista has more than a 4GB address
space.
 
T

Tim Slattery

Thomas said:
Here is another link I found:
http://msdn.microsoft.com/en-us/library/ms810616.aspx

Is it not true that with the PAE switch that an application like SQL Server
could address upto 3 GB of virtual space? Does that switch work on XP/Vista?

There's a /3GB switch in boot.ini. When it's set, each virtual memory
space will be divided so that the application gets 3GB and the OS gets
only 1GB. *Very* few apps need that (I guess SQL Server is one, but
I'd really expect to see that on a server OS anyway), and using it can
squeeze the OS, so it should be used only when needed.
 
D

dennis

Thomas said:
Here is another link I found:
http://msdn.microsoft.com/en-us/library/ms810616.aspx

Is it not true that with the PAE switch that an application like SQL Server
could address upto 3 GB of virtual space? Does that switch work on XP/Vista?

Many apps can use 3GB. What is special about a few of them, like sql
server, is the use of the AWE API. When using that, they can access a
lot more than 3GB, by using a sliding "window". If the window is 1GB in
size, and you move it around 8 times, you can access 8GB in total.
 

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