I want my Windows to run as fast as possible. If I have 12GB RAM in Windows 7 64bit, quad core CPU, and all apps fit in memory, will the swap file ever be used for anything? The question is about if it's a good idea to put the swap file in a RAM disk.

Would a RAM disk help in any way or will Windows intelligently use all the available memory for all its work?

I am also thinking of putting the temp folder on a RAM disk. I know the RAM disk is volatile memory and I don't care about its content if it gets lost.

link|improve this question

55% accept rate
The title made me laugh a bit, but actually your if [..] all apps fit in memory, will the swap file ever be used for anything is quite a good question! – Arjan Jun 5 '10 at 17:12
feedback

8 Answers

I agree that putting the swap file on a ramdisk doesn't make sense for a 64-bit OS. However, if one has 32-bit WinXP, then Windows can only "see" the first 3.5GB of RAM. If one has more RAM, say, 9GB, the RAM above 3.5GB is completely wasted by WinXP. However, using a program such as SuperSpeed RamDisk Plus, one can use the memory above 3.5GB as a ramdisk - and putting the swap file up there makes a tremendous amount of sense (again, on 32-bit XP, not 64-bit Win7).

Separately, putting temp files in a ramdisk almost always makes sense, performance-wise, unless the anticipated size puts too big a dent in the RAM available to the OS.

link|improve this answer
feedback

Yes, paging files are used even if one has lots of RAM; but the simple existence of a paging file is not by itself a factor affecting system performance. Putting a paging file on a RAM disc is daft, moreover. The point to a paging file, after all, is to be a place for holding (transient) page data when those data are not currently in RAM. RAM discs are in RAM …

Placing temporary files on a RAM disc is a wholly different kettle of fish, of course.

link|improve this answer
1  
That post doesn't explain why the OS needs to page out anything if the system has tons of ram and can hold EVERYTHING. The whole point of paging is to make room for more important processes but if memory can hold transient and new and old and seldom used and anything in memory why not keep everything in ram? As for dumps, I don't care about them. I can't read or understand them so they might as well get deleted and don't bother saving them, unless I send them to MS for analysis. – Tony_Henrich Oct 13 '10 at 16:41
The other article it refers to also have the usual strawman: "some" programs "may" fail, without ever specifying which programs that actually are, or how they may fail. – RolKau Dec 1 '10 at 22:33
@Tony, crash dumps are difficult for a normal person to read and interpret, but if you install Microsoft's debugging tools, they can be quite informative in figuring out why a BSOD occurred. If your computer never crashes, then of course it's irrelevant, but I've found crash dumps extremely helpful in troubleshooting crashed computers in the past, so don't dismiss them entirely. – nhinkle Dec 20 '10 at 4:15
feedback

I would not say ridiculous; for neither 32 or 64 bits systems.

To start with the obvious, 32 bits windows (the majority of running systems) simply ignore anything above 4GB. Ramdisks being able to use PAE and 36 bits memory addressing, they are to my knowledge the only way of making high memory areas useful in 32 bits systems.

Question is : how do we make use of a lightning fast / more secure virtual hard disk ? Temp files come to mind and are pretty trivial to setup, as long as you know how to assign a fixed drive letter in Windows. Same with browsers cache. The interest for these is quadruple :

  • Fastest access/retrieve
  • True deletion
  • Suppresses most of useless wear on expensive SSD memory.
  • Less disk fragmentation..

As for the swap file, it seems obvious that 32 bits systems have a lot to gain with putting them in unclaimed RAM. One could think of a memory hungry program, using up to 3 GB on itself (with the 3GB switch in boot.ini) that will most likely cause a lot of swapping. Two of the same bonuses still apply: true deletion and wear on SSD. Fragmentation is less of an issue with swap files.

There is more : it is quite common for poorly written programs to use virtual memory, no matter how much physical memory available, causing useless disk access. This holds true for both 32 AND 64 bits programs. I even came across programs that will just fail to launch in the absence of a swap file.

Bottom line, while it makes sense no matter what to have a ramdisk below 4GB and save useless disk access for temp folder and programs caching, it seems much preferable to install more than 4 GB, memory price being what it is, in both 32 (with PAE enabled hardware) AND 64 bits systems and move the swap file there.

One should note that A LOT of professional computer users still can't go 64 bits for hardware support reasons.

What would be ridiculous, to use the same strong language as above, would be to just dismiss the idea and rely not only on Microsoft's virtual memory handling (which is praised and rightly so) but also on application programmers who range from the assembly coding guru to the high level language idiot that will bring the nicest-most-stable-PC to its knees just through bad memory handling. I've seen such code in mainstream programs, productivity applications, I kid you not !

My main system has a 8GB ramdisk on XP/32 and this has proved useful. It's quite trivial to setup and I must say the only program that gave me a hard time is google chrome whose installation/update strategy is hard on the tweaker.

You can think of a lot of useful use for ramdisks apart from these ; in my case, audio samples to retrieve from disk on live applications : put them there at bootup time (painfully slow) and get lightning fast access to multiGB libraries. But this is way off topic :)

This is my own experience. I wish people would not destroy the value of useful information by the use of unnecessary strong language. Ridiculous was a bad choice of word in this context, to say the least.

link|improve this answer
feedback

Putting the pagefile on a ramdisk is a ridiculous idea. You have to understand that only a fraction of total paging will involve the pagefile. Most paging will be with executable and other mapped files, and a pagefile in RAM will do nothing to improve this performance. And thanks to the reduced system ram available there will be more of this paging. The result is that pagefile access will be faster but overall paging levels will be higher with a reduction in performance.

link|improve this answer
feedback

Windows will continue to use the swap file, which (much to my confusion, since I have an identical setup) didn't make any sense to me. However, after disabling the paging file, I saw no real performance improvements. I've since gone back to using a page file, since windows uses it for things other than virtual memory (I think it also writes crash dumps to it, when you bluescreen) which I need. I've also blown through my 12GB of RAM several times, and was thankful I had the wiggle room.

In short, Windows will still use the page file, but you shouldn't notice it as a performance hit.

As for temp files, moving those to a ram disk should increase their access speeds, though make sure that you won't need anything in there to persist through a reboot/crash and that the ramdisk driver loads and creates the ramdisk before any applications or the system needs to use the temp folder.

link|improve this answer
I think mini dumps are saved in some special folder under Windows. I am not sure about full dumps but maybe they get saved in the page file. But I don't mind putting a page file in any non root drive. I just hope Windows is efficient enough to use available ram as much as possible and use page file only when absolutely necessary. – Tony_Henrich Oct 13 '10 at 16:45
@Tony: They get saved in the page file until you reboot, at which time they get saved to the Minidump folder under %SYSTEMROOT%. – Hello71 Oct 15 '10 at 1:18
feedback

It is actually not a bad idea in my opinion.

Logically, people misunderstand "page file" or more correctly "swap file" as RAM. It is true that the swap file holds similar data as RAM holds. But Windows does not use this like RAM. As you see today in the growing multitasking world we live in, Windows was designed back in the day to handle the limited amount of RAM by constantly writing between swap file and RAM.

The swap file is always used by Windows since the performance gain is more noticeable on older slower computers with few programs running. As you open a window, the program gets swapped into RAM, as you are working in it.

Let's say you're writing a letter in Word. If you have just started that program with many programs\windows in the background, it tends to be slow, but then runs smoother after a few seconds. Then, when you switch to Internet Explorer, it runs slow, then gets faster because it was in page file and then swapped to RAM, while all background processes get loaded into the page file.

Now let's introduce the RAM disk to Windows. Put the swap file on the ramdisk instead of the HDD and you have improved the ability for Windows to multitask, since RAM is faster than the HDD/hard drive. However this won't help on an older system unless you buy a physical RAM drives – and you may have to set the pagefile again in Windows as without power it will be deleted.

Pagefiles get very pointless for newer PCs with 8, 16, 32, 64 Gigs of RAM.

link|improve this answer
1  
The question is still why would Windows swap out anything if there's plenty of memory to hold everything. it's not like memory 'gets tired' from holding the apps and needs a break. – Tony_Henrich Oct 13 '10 at 16:48
feedback

I've got W7 32bit with 6GB RAM, obviosuly it addresses 3.2GB only wasting the remaining 2.8GB.

I found that Dataram's RamDisk (freeware) can address those >4GB via PAE so I set it to create an E: drive of 2048MB (0.8GB have gone somewhere...). In there, I've put the PageFile — or better 50% PageFile and 50% ReadyBoost.

I have noted important improvements on random seek file and this was supported by Perfomance Monitor figures.

Anyone else tried similar configuration or a better idea on how to use >4GB wasted RAM?

link|improve this answer
feedback

I doubt you would see much difference moving your pagefile to ramdisk. If you wanted to force windows to use ram you could turn off the paging file.

However I noticed a large difference moving my IE temp files to a ramdisk and setting my TEMP and TMP enviromental variables to point to the ramdisk.

I also run Google chrome with the flag "-user-data-dir="R:\ChromeTEMP" so it stores temp files on the ramdisk. This will cause it to forget your settings. But since I use the sync feature it didn't effect me much. After the initial sync everything was back to normal. And skyrim loading screens are shorter after linking to copies of some files on my ramdisk.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.