What to put on RAMDisk on Windows?

8

1

I got a lot of RAM installed in my PC recently and I looked into this RAMDisk thing.

There are two things I've found from my investigation:

  1. You should not mess with Windows native pagefile/memory settings. Memory handling system of Windows and its services are perfected by multiple years of testing in real scenarios. SuperFetch and Windows memory model apparently make moving specific files and folders to RAMDisk unreasonable since mapped files are not immediately flushed from memory and SuperFetch does a good job of predicting user's actions.
  2. However, developers of 3rd party programs like browsers and utilities spent considerably less time worrying about performance, thus in edge cases, like having an abundance of memory, these program work in a less than optimal ways.

If I am correct, RAMDisk may be useful to store some programs' temporary cache: the files that can be automatically regenerated without much trouble. Browsers love to cache data to disk to avoid downloading it from internet, what else can be put on RAMDisk?

boomie

Posted 2012-01-03T22:22:42.807

Reputation: 121

Just about anything.

I'm a developer and use a 1-2GB RAM disk for holding the working copy of code bases I work on. The time taken to build a typical app is reduced by about a factor of 10 compared to conventional HD and even SSD. Highly recommended if you've got the spare RAM. – 5arx – 2012-09-18T16:05:59.020

Answers

5

"What to put on RAMDisk on Windows?" A: Nothing.

A RAMdisk is a foolish use of RAM.*

Windows, esp in Vista and later, will do a perfectly good job of using "extra" RAM for file and page cache. It does this completely automatically. And if a process suddenly turns out to need that some of that RAM-that-once-was-"extra", the OS can take it back from these caches just about instantly (only marginally slower than when it uses "free" RAM) and let the process that needs it, use it. It will do so intelligently, first repurposing low-priority cache that hasn't been accessed in a long time.

Whereas... When you lock RAM away in a RAMdisk the OS then can't ever use it for actual "live" contents (i.e. to resolve page faults), not in any amount of time. That's bad.

Practically all claims that "the OS isn't managing my RAM well" are due to misinformation about how virtual memory works and what it does, and misinterpretations of various displays. (Granted, Microsoft has not helped much here.)

(* The only exception I'll agree to is if you're running e.g. 32-bit Windows clients, which just won't look at more than about 3 GB of RAM. A RAMdisk product that makes use of RAM the OS flatly can't or won't use doesn't take anything away from the OS. A better long-term answer is of course to go to an OS that will use of all of your RAM.)

Jamie Hanrahan

Posted 2012-01-03T22:22:42.807

Reputation: 19 777

1This is not a very good answer. There are numerous scenarios where a Ramdisk is a great use of RAM. – None – 2016-06-26T18:28:54.123

1On a primitive OS that truly leaves the "available" RAM unused, perhaps. On a modern OS? No, there aren't, for all the reasons I described... especially since SSDs have become large and cheap. – Jamie Hanrahan – 2016-06-26T19:00:18.620

Okay here's a scenario for you: I'm running a virtualized, encrypted Windows 7 from a linux live usb. Both linux and win running USB 2.0, since that's all this computer has. It works but the drives are so slow it constantly locks up ... except if I put the programs on a RamDisk. I have plenty of RAM to do so, and like this it's perfectly usable. So you're saying a Ramdisk is useless, this setup would not work without one. Of course if I had the latest super computer, there would be other solutions, but we're talking real life here and RAMdisks are an excellent tool for certain things. – None – 2016-06-26T20:10:03.450

"Hey, swimming with a brick in each hand is tough! Oh wait, I know - I'll use an innertube to help me float!" Uh, ok... but dropping the bricks would be much more effective. – Jamie Hanrahan – 2016-06-26T23:37:28.617

2funny but sometimes you have no choice but to swim with a brick in each hand. There are also many other scenarios requiring the high performance of a RAMDisk. Last time I checked RAM was still thousands of times faster than the best SSD out there. If you had said "In most cases, A Ramdisk is not useful to increase performance on a modern machine with an SSD" instead of a categorical "RAMDisk is a foolish use of RAM" I would agree with you. – None – 2016-06-27T08:06:07.557

Ignorant. Automating the use of RAM vs disk can never be fully done, because it's undecidable, just like all but the most trivial problems in computer science. There will always be scenarios that neccessitate the manual use of a RAM-disk. – Alex – 2017-03-26T21:31:15.710

1If it's undecidable by algorithms then it's also undecidable by humans. – Jamie Hanrahan – 2017-03-31T07:17:45.447

2But there is one perfectly valid use: Short-lived temporary files, for example when using tools that only work on files, not streams. – Daniel B – 2018-06-22T13:59:42.300

1

Basically, anything that you need speed for, that you will use often. Its a way of increasing your apparent ram.

More info here: http://www.techrepublic.com/blog/window-on-windows/how-do-i-use-a-ram-disk-to-help-speed-up-disk-intensive-applications/3430

Xavierjazz

Posted 2012-01-03T22:22:42.807

Reputation: 7 993

1I use a set of utilities often, but RAMDisk is volatile and will delete all files on it after reboot. Most utilities store their preferences in their folder in some sort of .ini file, so I would need: 1) a way to copy necessary files to RAMdisk automatically during system start, and 2) some mechanism to flush data from RAMDisk to HDD. This is the sort of troubles I don't like so I specifically want fuss-free speedup. Thus, the stuff that would be kept on disk should be regeneratable. – boomie – 2012-01-03T22:54:14.363

Covers it all so far. Paging will not work in most of the ramdisks, they come to late in the system. Even if RD could be paging, it would serve a small and useless purpose. On a really stable system a person mightuse Ramdisk to "work with files", then transfer them out when done. Putting windows Own temps in them is very fast, But installs that break out into temps then reboot to install fail, making a mess. :-( Browser caches (clearable:-) work wonders in them. Some browsers now use large ram caches for speed, some still get an advantage. Apps still have to be put ON it, so it is a toss-up – Psycogeek – 2012-01-04T07:29:22.863