Solved

Virtual memory and 'real' memory

Posted on 2010-08-30
8
411 Views
Last Modified: 2013-11-10
Hi Experts

I am learning about memory in the context of Windows 2003/2008 servers and was hoping for some confirmation on my understanding and further questions I had.

I've been reading up heavily on the various sites, esp http://support.microsoft.com/kb/2267427, butI do know it's easy to misunderstand, hence my question.

So - here are my points, would be grateful if people could correct me if I am mistaken:

1. Applications always reference virtual memory addresses when using memory. It is the hardware that translates this to the real addresses used by physical memory (RAM)

2.  A 32bit application will always reference a maximum of 4GB virtual memory addresses

3. Within the default Windows x32 architecture, I'm still not sure what is defined as a "private use of a process" as opposed to shared (as per excerpt below):

"In the default Windows configuration, 2 GB of this virtual address space is designated for private use of every process, and the other 2 GB is shared between all processes and the operating system"

4.  The link states that "Physical Address Extension (PAE) is a feature of the Intel 32-bit architecture that expands the physical memory (RAM) address to 36 bits. (For more information, see Microsoft Knowledge Base article 268363, Intel Physical Addressing Extensions (PAE) in Windows 2000 (http://support.microsoft.com/default.aspx?scid=kb;en-us;268363) ).  PAE does not change the size of the virtual address space, which remains at 4 GB. It changes only the actual RAM that can be addressed by the processor".  I see that a Windows 2003 Enterprise server can support 32GB RAM (presumably with the PAE switch), but not sure how this works if the virtual address space will always remain at 4GB?

5. The link then says that "RAM is a limited resource, whereas virtual memory is, for most practical purposes, unlimited.". But I thought it previously said yhat the virtual address space was limited to 4GB??

6.  If I wanted to measure how much memory was *needed* by an application (as opposed to used), would Memory, Commited Bytes be a good counter to use?

Any help appreciated!
0
Comment
Question by:kam_uk
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 63

Accepted Solution

by:
SysExpert earned 125 total points
ID: 33561298
well your information in general is correct.

5) Virtual memory is usually slower and should only be used when physical RAM runs out. 32 bit systems are limited to 4 GB, but that is a lot for just overflow.

6) A good start, but you should look at peak committed if you want the max used.

I hope this helps !
0
 

Assisted Solution

by:ptpeterson
ptpeterson earned 125 total points
ID: 33561416
1. Applications always reference virtual memory addresses when using memory. It is the hardware that translates this to the real addresses used by physical memory (RAM).

This is mostly true, because even if you have an overabundance of RAM, the OS will still favor applications to utilize virtual memory.

2.  A 32bit application will always reference a maximum of 4GB virtual memory addresses

This actually comes down to the OS itself.  If you want more than 4GB, you would have to get a 64-bit OS.

3. Within the default Windows x32 architecture, I'm still not sure what is defined as a "private use of a process" as opposed to shared (as per excerpt below):

"In the default Windows configuration, 2 GB of this virtual address space is designated for private use of every process, and the other 2 GB is shared between all processes and the operating system"

32-bit is actually referenced as x86.  Private use is just that, singularly given to one application.  Shared memory is utilized by more than one process.

4.  The link states that "Physical Address Extension (PAE) is a feature of the Intel 32-bit architecture that expands the physical memory (RAM) address to 36 bits. (For more information, see Microsoft Knowledge Base article 268363, Intel Physical Addressing Extensions (PAE) in Windows 2000 (http://support.microsoft.com/default.aspx?scid=kb;en-us;268363) ).  PAE does not change the size of the virtual address space, which remains at 4 GB. It changes only the actual RAM that can be addressed by the processor".  I see that a Windows 2003 Enterprise server can support 32GB RAM (presumably with the PAE switch), but not sure how this works if the virtual address space will always remain at 4GB?

Anything that supports higher than 4GB of RAM is probably going to be 64-bit.  Put it this way, if you are running a server, you should have enough RAM in it to not even have to consider a paging file.

5. The link then says that "RAM is a limited resource, whereas virtual memory is, for most practical purposes, unlimited.". But I thought it previously said yhat the virtual address space was limited to 4GB??

They refer to it as "unlimited" because it utilizes storage space from your disk drive.  That 4GB limit is only refering to 32-bit OS.  If you are running a server, you should consider running 64-bit.

6.  If I wanted to measure how much memory was *needed* by an application (as opposed to used), would Memory, Commited Bytes be a good counter to use?

This will depend on 1) the manufacturer's specifications and 2) anticipated load on the server
0
 
LVL 3

Author Comment

by:kam_uk
ID: 33562168
Thanks both.

Regarding:

"2.  A 32bit application will always reference a maximum of 4GB virtual memory addresses

This actually comes down to the OS itself.  If you want more than 4GB, you would have to get a 64-bit OS"

So what decided how much virtual memory addresses an application can reference? The app itself or the OS?

If the former, then I guess there is no need to run a 32 bit app on a 64 bit server

If the latter, then I guess there are benefits!

And secondly, can one actually class an app as 32 bit or 64 bit? Is that within the app's code to state how much memory to reference?
0
 
LVL 63

Expert Comment

by:SysExpert
ID: 33562475
Well there are apps that are compiled for 32 bit x86 or 64 bit, with a larger memory model, so it does make a difference.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Expert Comment

by:ptpeterson
ID: 33562586
"So what decided how much virtual memory addresses an application can reference? The app itself or the OS?"

Well, technically, both.  The app, depending on how it is programmed (although limited to a maximum of 2^32 ~ 4GB), and the OS, which if it is 32-bit will be limited to 4GB maximum of RAM, but can have an almost unlimited supply of VMEM, but usually uses 1.5x whatever your current amount of RAM is. So, for example, if you have 4GB of RAM, the system will allocate up to 6GB of HD space for the paging file.  My current PC at home has 6GB of RAM, and because of that, I don't even use a paging file.

 Some (well, actually most) developers do not develop 64-bit applications as of yet, because many do not feel the need for the extra development it would require, especially since most applications have yet to find the need to go that route.  The most RAM I've seen one application use (and it was a game) was about 300 ~ 400MB. The reason why there is rarely any 64-bit development is because there really is no need, for now.

Generally, if an app is 32-bit, it will be classified as x86, whereas a 64-bit will be classified as x64.  Checking the system requirements with the manufacturer / developer is always a good idea.  I'm not a software developer, so, I'm not sure if I could answer that question completely.
0
 
LVL 3

Author Comment

by:kam_uk
ID: 33562930
Thanks both...so would I be correct in thinking:

1. Virtual memory is actually unlimited

2. 32bit apps can reference only 4GB virtual memory however

3. If running a 32bit app on a 32bit OS, it's possible for the app to use all 4GB virtual memory, and for the OS to start paging to provide extra memory for other functions? Would that be correct?

4. Ultimately, bearing in mind that the OS needs virtual memory as well, can a 32bit app on a 32bit machine ever really use all the 4GB virtual memory it is capable of referencing?
0
 
LVL 10

Assisted Solution

by:LMiller7
LMiller7 earned 125 total points
ID: 33563959
1. The virtual address space of any individual process is limited to 2GB. But since you can have a large and indeterminate number of processes we can say that virtual memory is almost unlimited.

2. Each process has a 4GB address space. With a 32 bit bus it can address no more.

3. Only the bottom 2GB is really available for direct use of the process. The upper 2GB is for system use only. Any attempt by an application to access this space would cause an exception and termination of the process. For performance reasons the 2GB system area must be present in all process address spaces. This area is used for such things as system interrupts and system code called by the application.

4. As mentioned, only the bottom 2GB is usable.

Also remember that physical and virtual address spaces are not related in any way. In many cases they will be the same size but that is more coincidence than anything else.

0
 
LVL 1

Assisted Solution

by:happyfunjoy
happyfunjoy earned 125 total points
ID: 33566028
1. Yes.  The OS translates between the addresses used by the process and where the data physically is, either L1 or L2 cache, or RAM, or disk cache, or disk file.

2.  No, Windows 32bit apps are limited to 2GB of heap allocation.  The other 2GB are for the OS to manage the process itself and are not available or addressable by the process. For example, the exe file will be loaded into this space.   Attempts to allocate more than 2GB of memory by the process will fail despite PAE extensions.

3. Private memory is allocated by the process, such as a variable for example.

4.  Each 32bit process can use 2GB, but you can have many such processes with PAE.  For example, you could have 10 processes each using 2GB of data.

5.  Each process can use only 2GB of space for its heap, regardless of where the memory actually is (disk or RAM or probably both).  Since you can have many processes, lots of virtual memory can still end up being used, much more than 2GB due to PAE.

6.  This number would be constantly changing, as inactive memory is swapped to disk in favor of memory that was more recently used. Commited bytes will show you what you're looking for.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Hyper-convergence systems have taken the IT world by storm and have quickly started to change our point of view of how the data center should and could be architected. In this article, I’ll explain the benefits of employing a hyper-converged system …
Moving your enterprise fax infrastructure from in-house fax machines and servers to the cloud makes sense — from both an efficiency and productivity standpoint. But does migrating to a cloud fax solution mean you will no longer be able to send or re…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now