• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 760
  • Last Modified:

What should be the correct virtual memory paging size

When I go into system/advanced/virtual memory

Paging file size for selected drive
Drive:C
Space avail 21,633 mb/system managed file/

Total Paging file size for all drives
Min 2 MB
Recommend 3825
Currently allocated 2550

Should I change this at all...

Note I have 2.5 GB of RAM
0
pbo1
Asked:
pbo1
  • 14
  • 12
  • 10
  • +6
2 Solutions
 
MiniDevoCommented:
Virtual memory settings tend to be OS specific. I would recommend looking up your flavor of Windows and seeing what Microsoft recommends as the appropriate space.
0
 
pbo1Author Commented:
What do mean by "flavor" ?
0
 
MiniDevoCommented:
Windows 2000, XP, Vista, 7, etc. As each version has a different set of requirements, the recommended virtual space will also be different.
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
EirmanCommented:
The recommended size of your paging file in Windows is normally your ram multiplied by 1.5 (2.5 x 1.5 = 3.75 Gigs)
You should set the max and min to the the same size to give yourself a static paging file.
0
 
Donald StewartNetwork AdministratorCommented:
0
 
giltjrCommented:
Well, MS has Windows tell you their recommendation when you go to configure the page file size.  For example, the recommendation for your computer is 3,825 MB.

But, it is really hard just to make a "blind" recommendation.  The size of the page file is really based on what the memory requirements are for all the programs you plan to run concurrently and if these requirements exceed how much physical RAM you have how bad of performance you are willing to put up with.

You have 2.5 GB of RAM.  This mean that  if the amount of RAM the OS and all programs you run concurrently exceed 2.5GB of RAM some of the memory they use will be written to the page file.  Every time the system needs to access a piece of memory that is written to the page file, the system needs to write something else to the page file, then read what it needs from the page file and put into RAM.

Well if all of the programs you normally run need say 8GB of RAM.  That means you will be reading/writing 5.5 GB of information between RAM and your disk drive.  This is a LOT of reading/writing and will slow your system down.

However, unless you are doing some unusual things, typically 2.5 GB of RAM will be more than enough for the typical home user.
0
 
Donald StewartNetwork AdministratorCommented:
Here's more info on page file to go along with the other link I provided

http://support.microsoft.com/kb/294418
0
 
LMiller7Commented:
The default settings were designed to create a pagefile that will be adequate for the large majority of cases. With 2.5GB of RAM this is almost certainly going to be adequate, in fact probably larger than necessary. But a larger than necessary pagefile will not encourage excessive paging or impair performance in any way.

With 2.5GB of RAM pagefile settings are rarely going to be an issue. The pagefile just isn't going to be used enough for this to matter. Do not be confused by what Task Manager might seem to be telling you. Task Manager has never shown actual pagefile usage in any version of Windows. This is really the Commit Charge.

Unless you have a very specific reason to change pagefile settings, and you understand the implications, leave these settings on default. In the large majority of cases these will be optimum or as close as to make no difference. There is an enormous amount of misinformation on the internet concerning this.
0
 
Donald StewartNetwork AdministratorCommented:
0
 
Blue-hitCommented:
The real question is: How much virtual memory do you really need? With 2.5 GB of "real" RAM Memory nearly every use case I can think of should be more than OK, so you propably won' need any virtual memory at all.

Virtual memory always means a big decrease of performance, as Hard Disk access times ar about 10times slower (ms) as the access times of RAM (ns).

Virtual emory is a drerelict from times where RAM was really expensive, if you ask me ;-)

So my recomendation is: Put virtal memory it down to Zero/deactivate it completely, use the Computer and if no software is complning about to less RAM, keep it that way.

0
 
LMiller7Commented:
The pagefile is not virtual memory and it most certainly is not a derelict from times past. The pagefile is used to hold rarely used data, freeing up RAM for more important uses, such as caching and increasing the working set of applications. Paging isn't exclusive to the pagefile but is used with many other files. The system is booted with paging, applications are launched with paging, in fact, almost all disk IO is done with paging. The lack of a pagefile, or having one that is too small, will mean that stale data must remain in RAM at all times, requiring the system to page out application code and DLL's that are more frequently accessed.

You might think that with 2.5GB of RAM you have room for everything in RAM. You don't. Task Manager does not reveal this but Performance Monitor does.

All of this is explained in detail in the Microsoft publication "Windows Internals", currently in the 5th edition. An older edition called "Inside Windows 2000", third edition, is a bit outdated but still mostly relevant, is available from Amazon and elsewhere quite cheaply. There is no more accurate or authoritative source of information on Windows memory management to be found anywhere. Highly recommended. It is not light reading.
0
 
Donald StewartNetwork AdministratorCommented:
lmillier7

from the link I provided above from microsoft (that you obviously didnt read)


"The paging file (Pagefile.sys) is a hidden file on your               computer's hard disk that Windows XP uses as if it were random access memory               (RAM). The paging file and physical memory make up virtual memory."
0
 
giltjrCommented:
--> Virtual emory is a drerelict from times where RAM was really expensive, if you ask me ;-)

Wrong. Virtual Memory is valid and necessary today.  Although the prices of RAM have fallen a lot, there are times where you computer will need more physical RAM that it has unless all you do is surf the web or you just spent a lot of money for RAM that you will never use.  Most people can't just go out and get 8GB of RAM for the fews times they may need it.

My main computer still only has 512MB of RAM, but it also runs Linux which is a bit more efficient when dealing with memory.

A decrease in performance is always better than not being able to do something.
0
 
Donald StewartNetwork AdministratorCommented:
0
 
LMiller7Commented:
dstewartjr

Actually I have read the article linked - several times. It is very unfortunate that Microsoft has chosen to describe the pagefile as virtual memory. That is a simplistic description meant for non-technical readers. In reality virtual memory is MUCH MUCH more than the pagefile.
0
 
Donald StewartNetwork AdministratorCommented:
Where's this so called proof?
0
 
LMiller7Commented:
Where is this so called proof?

In the Microsoft publications I have mentioned.
0
 
Donald StewartNetwork AdministratorCommented:
umm...sorry downloaded pdf version and didn't find any confirmation of your statements.

in fact the only mention on the web anywhere is from you. So I think Microsoft, Technet and Petri.co.il are more reputable.
0
 
LMiller7Commented:
Virtual memory is a system that provides a working environment to applications that is independent of the physical reality. The pagefile has a supporting role in this system - nothing more. The publications I mentioned describe in considerable detail how this system works and the role of the pagefile. You would do well to study it. I will not argue this.
0
 
Donald StewartNetwork AdministratorCommented:
Documentation is proof positive and hasn't been provided or found backing your statements.
0
 
PCBONEZCommented:
Regardless of who-what in the reenactment of the old tired argument:
Manipulating Virtual Memory size is the standard method of manipulating the pagefile size in Windows.
[Anything more is essentially modifying the OS and generally involves editing the registry.]

All 32-bit Windows [in fact all 32-bit OS's] have a maximum Memory-Map size of 4GB.
- That is a function of how many numbers [addresses] can be created with 32-bits available.
-
That means if you have 32-bit OS and you set Virtual Memory higher than 4GB the system can't address it [find it] anyway so you wasted your time.
-
The next great old argument will be that you can use PAE to raise that by a remapping routine. - "Wrong Guess, Minus 5." - Microsoft specifically addresses this in a number of documents. - Using PAE will not give Virtual memory more addresses to use. It only affects Physical Memory re-mapping.
- And on PAE: PAE will give you a performance hit. The re-mapping adds another step in processing the Data through the RAM which effectively makes the RAM considerably slower.

In Windows [all version since since Windows 95 I think and I know since Windows 98] the standard accepted method to optimize over-all performance is to set Virtual Memory to 1.5 times the amount of Physical RAM in the system - BUT in 32-bit Windows setting it to over 4GB is pointless.

In 64-bit Windows the size of the Address-Map is huge and as they don't yet make motherboards [available to consumers at least] that can support that much RAM, you can basically set Virtual Memory to 1.5 times your Physical RAM no matter how much RAM you have.

NOTE: Microsoft sets artificial limits for RAM in their Operating Systems for marketing purposes. [Thanks Microsoft!]
- Just because the OS is 64-bit does NOT mean you have unlimited RAM capacity.

Please see chart:
.
RAM-Windows-Limits-.jpg
0
 
PCBONEZCommented:
2.5Gb x 1.5 = 3.75Gb
-
Setting the Min and Max Virtual Memory size to the same number and restricting it to one drive in the system generally results in the best over-all system performance.
This has also been a standard practice with Windows OS's ~15 years now.
[There are people that will argue that works but it's because they've never tried it or they implemented it incorrectly.]
.
0
 
Donald StewartNetwork AdministratorCommented:
I agree with pcbonez, as these were all mentioned in the links I provided above
0
 
TedInAKCommented:
Is your XP disk at least SP1?  IIRC, it must be at least SP1 in order to use SATA drives.
0
 
PCBONEZCommented:
Are you in the wrong thread TedInAk?
0
 
TedInAKCommented:
Ya...stupid EE messed up (couldn't have been my fault :-P).  Weird, I was reading a Q via the Expert Zone Beta interface and typed that answer immediately after reading it (no distractions, reading other Q's, etc.).
0
 
giltjrCommented:
O.K., I guess a lot of you have you only experience with MS OS's and beleive everything that MS writes.

Virtual Memory is the concept of allow ALL tasks/process (not THREADS) to beleive that they have the full amount of memory the OS supports for its use.  So if you have a OS with 32-bit addressing, you have a 4GB address space and virtual memory  means that every task/process thinks it has 4GB of memory to use, that is address 0-4095MB.  Now 32-bit Windows are special and by default reserves 2GB of this for the system and lets the application use 2GB unless you use /3GB switch.  Using this switch increases the amount of memory that the application can use use to up to 3GB.  Using the /USERVA can alter how much can be used by the user program.  No other OS that I am aware of has this type of split between system and user.

As part of virtual memory the operating system will map virtual memory address to physical RAM address.  Typically only the OS has the ability to directly access physical memory.  

The paging file is one piece of what a OS needs to HELP support the concept of virtual memory, it in and of its self is NOT virtual memory, but just part of what is needed.  Since every task/process thinks it has 4GB of memory, you could have many tasks using LOTS of memory.  More memory than you have physically.  This is where the paging file comes into play.  If there is not enough physical memory to satisfy the needs of all task/processes, the OS will make copies of pieces of memory (call pages) to the page file and then use that page of RAM for some other task/process.  When a page that is in the page file is needed, the OS will move it back to RAM.


There is a BIG difference between addressing limits, physical memory limits of a system, and virtual memory limits.  A 64-bit OS can address a LOT of memory, but not all computers that support 64-bit OS can physical hold or address the same amount of memory.

32-bit Windows OS's can and does support more that 4GB in paging files.  However, it does NOT support a single page file being larger than 4GB, but you can have multiple 4GB page files.

Now, for those of you that only beleive what MS writes, well they actually have a more accurate description here:

     http://support.microsoft.com/kb/555223

Which is a summary of:

    http://members.shaw.ca/bsanders/WindowsGeneralWeb/RAMVirtualMemoryPageFileEtc.htm


Now as for the answer to the original question, I refer to Eirman's post and my 1st post.
0
 
Donald StewartNetwork AdministratorCommented:
Giltjr,

And ....

http://support.microsoft.com/kb/314482
How to configure paging files for optimization and recovery in Windows XP


(my first post in this thread) has no merit ???

I think not.

0
 
PCBONEZCommented:
As predicted the idgets show up.

A least we -have- experience with MS OS's.
0
 
Donald StewartNetwork AdministratorCommented:
I hope you're not referring to me, we'll have to see what the mods think of your unprofessional name calling. What makes you think you're better than anyone else?
0
 
PCBONEZCommented:
No, I wasn't referring to you at that point.
That was in response to the other 'name calling' directed at you and I.
- But now it seems appropriate to include you in the idget category.
I'm not sure why you'd wannabe. I don't think they give out tee shirts for that.
0
 
Donald StewartNetwork AdministratorCommented:
Ok, Just checking : ^ ) must have been the timing.....


Dont need any more dust rags btw.....LOL
0
 
Donald StewartNetwork AdministratorCommented:
Oh, and thanks for having my back.... I had yours too
0
 
giltjrCommented:
Did you read the links I provided?  Once again, a paging file in and of itself is not virtual memory.  It is used to help support virtual memory.

Think of it this way, if you setup Windows without a page file, do you still have virtual memory?  Yes, why because virtual memory is a concept to make a process/task think it has the ability to access all memory addressable by the OS.  Thus the statement:

"The key point here is that Virtual Memory is always in use, even when the memory required by all running processes does not exceed the amount of RAM installed on the system."

This is in links from my prior post.

The problem with "virtual memory" is that there are two ways you could look at it.

1) The concept that a single process has the ability to access all memory addressable by the OS.

2) The concept of allowing more memory used than physically available.

In some instances of MS descriptions they lead you to beleive that there is only one "virtual memory" concept and try to blend both of the above concepts.  Thus the reason they use the term "virtual memory" on the paging file allocation window.  However, the normal meaning of virtual memory is #1.

Unfortunately the link that you provide is attempting to describe virtual memory as #2, which is not what is normally meant by 'virtual memory.'
0
 
PCBONEZCommented:
Read it 50? 80? 100? times in the past.
-
Unless you are going to offer instructions on how to change the page-file size in Windows without using or affecting the Virtual Memory settings your point is useless trivia.
.
0
 
Donald StewartNetwork AdministratorCommented:
LMAO, ROFLOL


Eirman answered the question with the most common answer to this question at hand.

All the rest of the arguing here has been fun, but gotta run.
0
 
giltjrCommented:
I'm not.  I saw there was a discussion on "virtual memory" and have added some links that describe what it is and a few comments to help educate, which is one of the purposes here at EE.  At least I thought that education along with helping answer questions was the purpose here.

I have already posted my answer to the question, which in my opinion is correct, but was the 2nd correct answer, the 1st correct answer was from Eirman and he posted it 14 minutes after the question.  Unless more information is provided by pbo1, Eirman's answer should be accept as the correct answer.   If pbo1 would like, other posts can be accepted as assists.

I can't help if MS uses the wrong terms (IMHO) or leads people down the wrong road.

I am here to help and to learn.

Most of your comments in your first post on are right on, most people do not understand PAE at all, but you did describe it correctly.  Most people don't understand the /3GB switch either, I seen people actual say that this allows your system to have more than 2GB of RAM.

However you comment "BUT in 32-bit Windows setting it to over 4GB is pointless." when talking about vitual memory is a bit misleading or completely wrong.  

A single page file can not be larger than 4GB.  So if you meant that you can't create a single page file larger than 4GB, you are correct and I don't beleive you can define a page file larger than 4GB at all.

However, you can allocate multiple 4GB page files (for best performance on separate physical drives of coure).  So by the definition of "virtual memory" when setting up page files you can have more than 4GB of "virtual memory" and Windows will use it.  There is no 4GB limit for this.  The 4GB limit is for the virtual memory for an address space of a task/process and for physical memory.   There is no 4GB limit for the combined total of all page files, just a per page file limit.  You can have four page files of 4GB each, which would give you 16GB+RAM of "virtual memory."
0
 
PCBONEZCommented:
I don't mind learning.

That's why I asked for instructions on how to change the page-file size in Windows without using or affecting the Virtual Memory settings.
0
 
PCBONEZCommented:
giltjr
You argument comes up about twice a month [which is why I think it's so funny]  and it has a couple of fatal flaws.

1- In Windows there is no practical way for the user to adjust the page-file size except by adjusting Virtual Memory so from a practical standpoint they are the same thing.
That is why MS Docs for the most part use the terms interchangeably.
2- Yes, spreading the page-file across several drives will improve performance but the assumption you made from that about that giving you more address-maps for Virtual Memory / Page-file is wrong.
Unlike Linux, in Windows your get ONE address-map for Virtual Memory/ Page-file. If you spread the page-file across multiple drives then that ONE address-map is spread across multiple drives. You don't get a new map for each drive. If your total across the drives is >4GB in 32-bit Windows then that portion of Virtual Memory over 4GB is not addressable and can't be used.

If you re-read the docs that YOU linked to you will see what I'm talking about.

So: In 32-bit Windows setting Virtual Memory to over 4GB -IS- pointless.
.
0
 
PCBONEZCommented:
I should also note that Windows does not 'load balance' or 'strip' the Virtual Memory space.
It uses the fastest drive until the allotted space on that drive is used up, then it moves to the next fastest drive.
-
You are better off performance wise using one large page-file on the fastest physical drive.
[You do need at least small page file on the C drive to avoid problems with certain software but the bulk of it can be on any other physical drive.]
0
 
giltjrCommented:
PCBONEZ:

--> So: In 32-bit Windows setting Virtual Memory to over 4GB -IS- pointless.

Wrong, Wrong, and Wrong.  If that were true, then you could NEVER have more than 4GB of memory in use at a single time.  You can and I HAVE.  In fact I did find I was wrong, you can have a page file that is larger than 4GB:

     http://support.microsoft.com/kb/237740

states that if you enable PAE you can make the page file larger than 4GB.  Now, if you can't have more that 4 GB of "virtual memory" on a 32-bit system, then why could you ever create a page that is larger than 4 GB.  In fact it would mean that if you had 4GB of RAM that you could not have any page file.  In fact it would mean that the largest page file you could have on a system is the result of 4-x where x is the amount of RAM you have.

What is limited to 4GB in a 32-bit OS is physical ram (execpt in special cases of course with PAE) and the virtual address space of a single task/process. Might you be getting virtual address space confused with virtual memory?  

If not can you point out where it states that virtual memory is limited to 4GB?

I can have 3 or more processes using using all 2GB (or 3GB if using /3GB switch) of the private area within the virtual address space.  Last time I checked 2*3 = 6GB of virtual memory in use and I have done this.  Meaning I have had more than 4GB of total "memory" in use on a 32-bit OS.

If you want test this get something like Wireshark (http://www.wireshark.org).  Make sure that your "virutal memory" is larger than 4GB, meaning that RAM+PageFile > 4GB.  Then do a couple of packet captures for a long time.  500MB of data should be enough.
Now open up multiple instances of Wireshark and open the 500MB packet capture.  Keep doing this until you get the "low/out of virtual memory" message. Look at task manager and see how much "virtual memory" you are using.

If your system is doing a lot of paging and you can't add RAM (either because your system is maxed or you just can't afford it) then you are better off spreading out the page files across multiple spindles and multiple interfaces whenever possible.  You are spreading out the I/O.  However, yes, having a small page file on C: drive is a good thing to do in case of problems with other phyical drives.  Now, for the normal desktop setup a single page will typically satisfy the system needs.file is best.

I have been dealing with virtual memory and paging systems for 25+ years, way before MS ever "discover" it.
0
 
PCBONEZCommented:
NOPE!
Go read it again.
.
0
 
PCBONEZCommented:
MS is not Linux.
That's why you are lost.
.
0
 
PCBONEZCommented:
Already discussed the disadvantages of PAE.
PAE re-maps 32-bit into 36-bit and the time the remapping event takes results in a performance hit on a standard PC.
You'd have to be an idiot to use it except on a server.
.
0
 
giltjrCommented:
I know that MS is not Linux, and Linux is not even 20 years old yet.  I use systems that were developed in the 60's.

So please educate me, show me the exact place where is says you can not have more that 4GB of paging files on a Window on a 32-bit Window OS.  Please, because I can't find it. Again, the only reference to 4GB limits I can find are for physical memory and for a single address space.  So please show me where it says you can't have multiple 4GB page files.

I never recommended using PAE. What I pointed out was and KB written by MS that you can create a page file larger than 4GB by using PAE.
0
 
giltjrCommented:
Please read:

     http://support.microsoft.com/kb/254649

and search on the string "Maximum paging file size".  There will be a chart showing the maximum size of a paging file, the maximum number of page files a system can have, and the total paging file system size.

You will see for all MS OS's you can have up to 16 paging files on a single system.  On x86 based systems (that is 32-bit systems) the max size of each page file is 4GB for non-PAE mode and 16TB for PAE mode.  Total system paging file size is 64GB for non-PAE mode and 256TB for PAE mode.  

Therefor, if you have a system with 4GB of  RAM and you allocate 64GB worth of page files, in MS terms, you will have 68GB of virtual memory.  Way more than the 4GB you claim.  In PAE mode, you would have 256TB+4GB, way, way bigger than 4GBs.  

Now, I am in no way recommending doing this, it would be a performance nightmare if you had any system that attempted to use way more memory that it has physically. This is just to show the technical limitations of MS's 32-bit OS's is more than 4GB of "virtual memory."

I honestly think you are getting MS term for virtual memory mixed up with virtual address space.
0
 
pbo1Author Commented:
Thanks for everyones contributions.  This is the beauty of forum..many opinions.  I need to read thru them in a little more detail to see if I have further questions.
0
 
giltjrCommented:
The biggest thing is what do you do with this computer.  What programs do you normally run?  If its just a normal everyday computer surfing the web and doing e-mail, maybe some light word processing, then the recommendation that Windows gives is fine.

Now, if you do J2EE application development and do all your testing on this computer, then you may need a larger swap file, or more RAM.
0
 
pbo1Author Commented:
Very difficult to grade, but both of your arguments and information provided me with a well rounded knowledgebase.  If people disagree perhaps an admin can allocate points.
0
 
giltjrCommented:
Thanks for the points and I am sure that PCBONEZ appreciates them also, but the 1st correct answer based on your question was provide by Eirman and he does deserve the points.
0

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

  • 14
  • 12
  • 10
  • +6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now