windows xp virtual memory

back in the day, i remember hearing that if you put the virtual memory of winXP on a seperate hard drive ( so the system disk is on IDE1, and the disk with the virtual memory is on IDE2 ) then you will see a performance increase.
i have tried this and it did seem to work. however as the drive aged i think it made things worse - or maybe the disk just needed formatting - but anyhow, it got me thinking. what if you could make windows virtual memory only exist in the actual memory?
so in any flavor of windows, is there a way to force virtual memory to just run in actual memory and NOT on the hard drive?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can completely remove the page file but there are some applications that do not like it.  It may be better to just make a very small pagefile.

How much RAM do you have in your machine?  

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dave BaldwinFixer of ProblemsCommented:
Then it wouldn't be 'virtual'.  The purpose of 'virtual' memory is to swap out sections of RAM (real) memory that are not being currently used to make room for something that is needed.  It makes 512MB of RAM act (slowly) like 2GB of RAM.
JeffBeallAuthor Commented:
i get the whole "virtual" thing. but it seems to me to be an out dated concept left over from the days when ram wasn't cheap and before 64bit addressing came around and windows couldn't address a huge amount of ram.
i must admit that windows 7, to me, seems to handle memory very well.
i just always look for ways to increase speed.
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

Dr. KlahnPrincipal Software EngineerCommented:
lamaslany is correct.  Virtual memory can be set to zero, but this does not result in a system that operates quickly, properly, and entirely in available RAM.  Instead, it causes many applications to fault with unusual errors.  Virtual memory is used for numerous things besides paging applications that are too big for available memory.  I tried this configuration about three years back, and within two days I rejected it as unusable.
Dave BaldwinFixer of ProblemsCommented:
Linux and Windows including Windows 7 don't think it's outdated.  When you give programmers more memory, they make larger programs.  In the operation of a computer, there are layers of memory.  Disk is usually the largest and slowest and the CPU registers are the smallest and fastest.  In between, there are two layers of cache and your main RAM memory.  Though different methods are used for the different layers, it's still similar concepts where you swap in the data you need right now to the next higher level.  All of that is done to speed up the computer.
Virtual memory helps the OS manage real ram more efficiently, and it doesn't matter whether it's Linux or Windows (although each os uses it differently), in the end it's better for the OS no matter how much physical ram you have installed. You are best off leaving it on. Also, you might even want to enable it on the system drive (usually C:) so that windows gets a full dump file in the case it crashes, otherwise you just get a mini dump file which does not help in most of the cases of troubleshooting the root cause.
Putting the pagefile in RAM is a BAD idea.
The pagefile is not virtual memory, although much user level Microsoft documentation implies that it is. Virtual memory is broad topic and the pagefile is only a small part of it.

The pagefile is used as a place to offload rarely used data, thus leaving more RAM available for more important purposes. If the pagefile is in RAM this will mean moving data from one place in RAM to another place in RAM. In many cases there will be exact duplicates of data in two places in RAM. I call that wasteful and a serious waste of precious RAM.

Paging isn't exclusive to the pagefile. Paging involves executable files, DLL's, cached data files, etc., and this form of paging does not use the pagefile at all. Of all paging only about 10% will involve the pagefile. Placing the pagefile in RAM will do nothing for the other forms of paging, and thanks to the RAM lost to the pagefile, there be more of it.

Many people misinterpret the Task Manager display and see a large amount of "Available" memory and consider this free and unused memory. Not so. Most of this will actually be in use. In a modern OS having memory that is both in use and available is not a contradiction.

However much RAM you have you will better served by letting the system manage it as it wants to. It really does know best.

People who promote putting the pagefile in RAM are doing it out of ignorance of how the pagefile is used.

There is much more that could be said about this but I will stop now.
JeffBeallAuthor Commented:
i like these questions when i learn new things.
given what has been said though. it really did seem like a boost in performance when i put the page file or "virtual memory" on a drive other than the system drive. i'm not sure why that would be.
Ok, so to answer your question specifically, I'd advise against disabling virtual memory. It becomes more of a nuisance than anything else because programs can complain or not even run properly and there is not much of a noticable difference when disabling it. As far as putting the page file on a drive other than the system drive, it would be fine, you just need to consider if in the event the computer crashes on you, how important it would be to determine the root cause of the crash because of the fact that you cannot get a full memory dump when there is no page file setup on the system drive.
Arman KhodabandeIT Manager and ConsultantCommented:
I remember that I used the suggestion to disable the virtual memory once.
But I constantly got the "low virtual memory" pop-up message.
I had a lot of Ram and wanted to force windows to use it but windows rejected the high speed Ram and wanted to use slow pagefile !
I was forced to re-enable that stupid pagefile !
Having 3 Gigabytes of ram and not using it to speed-up things!
Arman KhodabandeIT Manager and ConsultantCommented:
You mention that as the disk gets older it is getting slower. Have you defragmented your disk at all? Has your pagefile become fragmented? Is it the only file on the second disk or do you use it for other files?

I always set my minimum and maximum pagefile size to be the same so it creates a single contiguous pagefile.
David Johnson, CD, MVPOwnerCommented:
^^ same here ^^  If you have a LOT of memory and I'm not just talking 8G of ram or don't run many memory intensive operations at once you can improve things but you will never get rid of the pagefile.
Putting it on a SSD will speed things up but a ramdisk will actually slow things down. And yes putting the pagefile on a separate spindle does improve things as long as that drive is mainly a storage drive and not accessed a lot. If you have 3G or more you might want to stop windows from offloading its dll's and to keep them in memory (memory is faster than a hard disk).. at the moment I have 2.507G cached ram, and 2.454 available of my total 8G of Ram. (69% of physical memory) and the only thing other than perfmon is my sidebar gadgets accessing the pagefile.
If you have a lot of RAM add the /3G switch to your boot.ini though I'm not sure it would help much in Windows 7 and only works with 32-bit operating systems:

To answer your question about the performance difference - if you put your swap file on a separate physical hard drive then your disk I/O on your first drive is greatly reduced as you are now using the combined capabilities (I/O) of both drives at the same time.  However, this would only be truly effective with IDE drives.  SAS or the older SCSI drives use an asynchronous read/write that isn't nearly as limited as IDE.

If you *really* want to get efficient I'd recommend going with a Solid State Drive (SSD) instead.  No moving parts - makes them wicked fast and actually generates quite a bit less heat.  I see ve3ofa mentions this as well.

Read the article on /3G - it's good at explaining the purpose and use of the swap file.
The article mentioning the /3GB switch above is correct but so many people misinterpret it. It has nothing to do with how much RAM you have or how it will be used. It also has nothing to do with the pagefile.

By default the 4GB virtual address space is split 2GB system - 2 GB per process. This is independent of RAM size. The switch changes this to 2 GB system - 3 GB per process. Only processes that explicitly indicate this will benefit and most are not. It also has some negative implications.

Do not use the switch unless you have applications that either require or will significantly benefit from it. Otherwise it will likely impair performance.

With or without the switch, RAM allocation between the system and applications is dynamically controlled by the memory manager. It has always been this way on the NT platform.
Arman KhodabandeIT Manager and ConsultantCommented:
By now I learned that:
1) Pagefile can not be disabled completely.
2) Putting pagefile on Ram is not a good idea. (Is it possible at all? how? ! ! !)
3) Defragmenting the pagefile has a great effect on performance. (I knew it already and do it regularly)
4) Putting pagefile on separate HDD or SSD will improve performance greatly.

Now let's get back to the authors question and ask a related question! (I ask for permission of the author!)
Why you say that putting a pagefile in another drive will increase performance?
I remember that once I used a software (I think it was "Tweak XP") and it shrunk my system drive and made a separate drive and put pagefile in it. The software said that after rebooting you'll see a performance increase. I had it for a while and never saw an increase (But may also decrease)!
What's the trick behind this?
JeffBeallAuthor Commented:
kpax77, i don't mind you asking questions in my question. i believe in the Exchange part of this website. we all benefit by the questions people ask.
as far as the performance benefit. i think i saw benefits. however it was on older IDE computers. i have not tried this with SATA. and like WireDWolf mentioned, maybe it wouldn't work with SATA.
since it is releated to IDE which is going away, this could be a dated question, however, i am learning things about memory handling, so i guess it's still good to ask.
Arman KhodabandeIT Manager and ConsultantCommented:
Thanks JeffBeall.

But I think being on IDE or SATA doesn't matter if you're using separate partition (not separate hard disk).
And knowing that SATA is more efficient than IDE, we can conclude that putting pagefile on separate SATA HDD will increase performance unless there is an issue that WireDWolf knows it only.
David Johnson, CD, MVPOwnerCommented:
Actually with IDE drives running the pagefile on a separate spindle on a different controller gives the most increase instead of a slave drive where the system disk is on the master.  The biggest item is on a separate spindle (physical drive vs logical drive)
Under some situations it may be beneficial to place the pagefile on a separate physical drive, not separation partition. But this will only be significant if the pagefile is a bottleneck and it usually isn't.

Most attempts at optimizing the pagefile are wasted effort.
JeffBeallAuthor Commented:
wow! what a great response! thanks for all the comments.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows XP

From novice to tech pro — start learning today.