Why is putting Page File on a RAM disk a bad idea?

Started by Eric

Eric

Why is putting Page File on a RAM disk a bad idea?   18 November 2019, 10:47

I am currently trialling SoftPerfect RAM Disk and, amongst other things, I tried to put page file on it. But each time I attempt this, it fails. Everything else in the RAM Disk app works perfectly well.

I did a bit of researching about page files and read in numerous places that it is a very bad idea to move pagefile.sys to RAM disks. I get that. But I wonder why? Can anyone explain please?
SoftPerfect Support forum - Ann avatar image
Ann

Why putting Page File on a RAM disk is a bad idea   18 November 2019, 12:35

As you have already read, placing a page file on a RAM disk or any other virtual storage device that uses RAM is indeed a bad idea; it is also irrational and counterproductive. And here is why...

Page file (aka swap file, paging file or pagefile) is a reserved portion of a hard disk that serves as an extension of physical memory (RAM). When the system runs out of RAM, it moves less-used RAM contents to pagefile.sys file on the hard disk. The page file is also used for memory dumps, which are system state information records created in case of a crash.

The total amount of memory that can be allocated to all processes in your system is limited by the sum of the size of RAM installed in your computer and the size of your page file.

For example, if you have 4 GB RAM and 2 GB page file, the maximum memory the system can offer would be 6 GB. If you try to run a program that needs 8 GB, it will get out of memory and throw an error. The only two ways to deal with this situation are either to install more RAM, or to increase the size of your page file.

Now imagine you put your page file on a RAM disk, i.e. in the physical RAM. Even if you made the RAM disk just big enough to fit the page file and nothing else, this essentially leaves you with 2 GB page file and 2 GB of remaining RAM. By doing this, not only you robbed yourself of a half of available RAM, you also left yourself no option to extend the page file.

Then, if your system needs 3 GB of RAM, it will be forced to use the page file (even though you physically have enough RAM for that), thus going through unnecessary paging operations. And, if at some point you do need to extend the page file, not only will you be limited by your RAM size, you will also be trying to extend the RAM by storing the extension on the very RAM you are trying to extend. Basically, you get a snake eating its own tail situation.

General advice:
  • If you have plenty of RAM and don't use memory dumps, disable page file altogether. Caveat: there are some programs, such as Adobe, that don't want to work without a page file. In this case, set the minimally allowed page file on the hard disk.
  • If you don't have a lot of memory and your system ends up needing a page file, place it on a hard disk. If you have two physical disks installed, put the page file on the non-system disk for better performance.
  • If your computer has an SSD, don't use a dynamic size page file to avoid unnecessary disk wear. If it has both SSD and HDD, place the page file on the HDD.

As to our RAM Disk, it does not support storing page files. Hopefully this explanation helps to understand why smile
Thank you! It is all very clear now ok, yes, thumb up
This is not a bad idea if you have enough RAM.
The idea that Windows10 uses the pagefile only for RAM is incorrect. It's also incorrect to assume that windows will swap stuff to that file only when RAM becomes unavailable. All you have to do is research current articles on why disabling the paging file (even if you have tons of RAM) is a bad idea.

If you put a paging file on a RAM drive, it makes the read/write faster and saves SSD's (assuming you had the paging file on an SSD). I have plenty of RAM on my system, but I've never seen it use more than 12GB at a shot. Setting up a decent sized RAM-drive, using it for both temp files and the paging file, should give a slight performance increase. Sure, you've allocated some of that RAM and now your system has less to use, but in this case does it matter?

Let's get a little crazy here. Suppose you have 128GB of RAM in your system. That should be WAY more than you need. So, you create a 64GB RAM disk and toss a decent sized paging file on there along with temp folders. Your system now shows 64GB of RAM and a 64GB hard-drive. Even if for some reason the system uses all 64GB of RAM and is forced to use the Paging file, what difference would it make from a RAM stand-point. It doesn't matter if the system uses the paging file on the RAM drive or the RAM itself, it all runs at the same speed.

If your running 16GB of RAM or less, you wouldn't be able to create a space large enough to hold a paging file at a good size. Too small and your system will crash. I would suggest that you need at least 32GB of RAM but 64GB would probably be best. A 32GB RAM drive should be enough for a paging file and temp folders. Generally, your system shouldn't really need more than 32GB to run giving you plenty of overhead for a RAMdrive.

The idea of putting a pagefile onto a RAM drive has always seemed smart to me on systems with plenty of RAM. In the past many systems had 8GB to start which was usually a recommended minimum for many of Microsoft's earlier operating systems. Eventually people added more RAM so the paging file would be used less and for a while, more RAM would do plenty to speed up a system. Processing power is so high these days that much of what sits in RAM is processed and the RAM never really fills up. I think Windows 10 will run on 8GB of RAM.

I would suggest that creating a decent sized RAM drive for a paging file is actually a good idea, contrary to older wisdom. Technology has changed significantly enough to make this a viable option.
SoftPerfect Support forum - Ann avatar image
Ann

Re: Why putting Page File on a RAM disk is a bad idea   13 November 2020, 09:28

Drew, if you have plenty of RAM and if putting page file on the RAM disk works well for you, then, by all means, you are welcome to do it.

Hardware and operating systems are evolving and changing, there is no question about that. However, not everyone has as much RAM as you do, and different users have different OS, different hardware and use different software combinations. In addition, the system stability and reliability is much more important for most users than the speed gain. So there isn't one piece of advice that fits all. My earlier explanations were for the user who consistently encountered problems when he placed his page file on a RAM disk. The aim was to explain why this was failing, and why it is not a good idea to persist in doing so in such cases.
Joshua Eaton

Re: Why is putting Page File on a RAM disk a bad idea?   06 June 2021, 10:28

Eric,

Ann and Drew are both technically correct. The biggest factor is the amount of total RAM you have in your system. I made the decision to run a RAM drive a few days ago on my workstation. I have 64GB of ram and seldom seen it go above 20GB unless I'm doing something really crazy and it's never gone over 30GB.

Thanks for my workload and yours will be different. I made the decision to use 32GB as a RAM drive for my page file along with windows temp files. I also use it as my "working" drive as it's much faster than even my NVME raid. I also have a UPS backup so if the power goes down, I can save my work without issues.

It does make it easier to keep the trash out of your system as well. Some people can get a lot of trash files floating around their system taking up space and slowing things down. This is a great way to purge everything when you do a reboot. I only reboot once or twice a month so it does not make much of a difference for me.
Shadowares

Re: Why is putting Page File on a RAM disk a bad idea?   14 July 2021, 15:42

I'm about to try this very idea as I have 128gb of RAM in my ryzen 5950x system. I figure this is a great way to keep as you mentioned junk out of the system, and security as temp folder contents will get wiped. Do you let the pagefile rebuild on restarts, or is that something you'd set to be persistent as in let it save a img to the drive and reload when system restarts?

Reply to this topic

Sometimes you can find a solution faster if you try the forum search, have a look at the knowledge base, or check the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • Write in English. If possible, check your spelling and grammar.

Author:

Email:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

 **      **  **     **  **     **  **     **  ******** 
 **  **  **  ***   ***  ***   ***  **     **  **       
 **  **  **  **** ****  **** ****  **     **  **       
 **  **  **  ** *** **  ** *** **  *********  ******   
 **  **  **  **     **  **     **  **     **  **       
 **  **  **  **     **  **     **  **     **  **       
  ***  ***   **     **  **     **  **     **  ******** 

Message: