Hardware & Infrastructure
03:11 PM
Fred Langa
Fred Langa

Langa Letter: Speed And Security Via A RAM Drive

While it's not a panacea, judicious use of a RAM drive can make your PC faster and safer, Fred Langa says.

"Running Programs In RAM?"
Win2K and XP do a pretty good job of keeping actively used and needed data in normal system RAM; and the more RAM you give these systems, the more code and data they'll be able to keep there, ready for near-instant access. But when you assign system RAM to a RAM disk, that RAM is no longer available for general system use.

As the system tries to cope with the lowered amount of RAM, it may have to rely more on the pagefile/swapfile of the virtual memory system on the hard drive, which operates much, much more slowly than RAM. (Anything the operating system can't fit in RAM, it writes to the virtual memory pagefile/swapfile on the hard drive.)

Thus, adding a RAM disk may speed up disk-intensive file operations, but may actually slow down your system overall because there'll be less RAM available for running your programs. This goes to the heart of Charles Preston's question: "...how to load and run programs in...RAM." Given sufficient RAM, Win2K and XP will actually do just that on their own, running the program in system RAM as much as possible.

So, if (like Charles) your interest is making sure your programs run in RAM as much as possible, a RAM drive is not--repeat, not--the answer. Instead, add more RAM to the system as a whole. (For a fuller discussion of how Windows uses RAM, "memory optimizers," and how much RAM is enough, see this item as well as this one.

But if speeding up disk/file operations is your goal, than a RAM drive may help a lot, provided you have enough RAM to start with so you won't be short-changing the system as a whole. That's what we'll look at next.

RAM Tradeoffs
The more RAM you have, the more you can assign to a RAM disk without incurring overall performance losses from extra swapfile activity. Or, to put this the other way, the less RAM you have to start with, the smaller a RAM disk you'll be able to support without affecting performance.

If your system is toward the lower end of the recommended RAM amounts for your version of Windows (e.g. 128 Mbytes for XP), then you should either avoid RAM disk use altogether, or use only very small RAM disks--a few megs at most. Anything more, and you may start to cut into the RAM requirements of the system as a whole.

On the other hand, if you have abundant RAM, you can create more sizeable RAM disks without affecting performance. For example, a system with 512 Mbytes of RAM might be able to support a 256-Mbyte RAM disk without significantly affecting pagefile/swapfile activity. A system with 2 Gbytes of RAM might easily afford a 1 Gbyte or perhaps even a 1.5-Gbyte RAM disk without any pagefile/swapfile performance issue.

Unfortunately, there's no hard and fast rule for exactly how much system RAM you can assign to a RAM disk without affecting overall performance: It depends on the exact mix of software you'll be running. Fortunately, most RAM disk software makes it relatively easy to experiment with different-sized RAM disks, so you can find a size that works for your own unique situation. (We'll provide a list of RAM disk vendors later.)

Small RAM Disk Use: Data Sorts
If your system can only handle a smaller RAM disk, you still may find it quite useful: For example, if you need to perform an intense series of sorts or other file-intensive operations on, say, a 10-Mbyte spreadsheet or database, you'd probably see a significant speed increase by copying the spreadsheet or database into a modest 12- or 15-Mbyte RAM disk, and working on the files there. When you're done, copy the files back to the original location on the hard drive, and you're done.

Medium RAM Disk Use: Browser Temp Files
Things get even more interesting with larger RAM drives. For example, with a moderately sized RAM disk, you might be able to place your browser's history, cookies, or other temp files to a RAM disk (in Internet Explorer, you'd use the Tools/Internet Options/Settings/Move Folder tool). This not only speeds access to these files, but also can increase security: When you shut down the PC (and thus kill the RAM drive) everything stored in that drive goes away, leaving no trace. This approach could obviate the need for cookie-cleaners or other kinds of browser cleanup tools because all these files, if stored in a RAM drive, would be wiped out automatically at shutdown.

For a specfic example of how this can work, Winsoft's RAM disk (free limited-use version; $35 for full use) ships with two small batch files that you install via the Microsoft Management Console (MMC) included with Win2K and XP. The first batch file is meant to run automatically at startup. It enables the RAM disk, formats it, and copies whatever files you want seeded into the RAM disk from a folder on your hard drive. (e.g., something like "C:\Ramdisk_files") The second file runs at shutdown. It clones the RAM disk's contents to the permanent folder (e.g., "C:\Ramdisk_files"). In this way, the starting, stopping, and basic file management of the RAM disk can be quite automatic.

With a little judicious editing, you could adapt these files for browser-file management via a RAM disk. For example, start by cleaning out all unwanted cookies, temp files, etc., from your browser's normal temp file locations; but leave useful cookies such as those containing passwords, logins, etc. Copy this cleaned, known-good, known-safe Temp folder tree to a storage folder; continuing with the previous example, you might place the Temp files in a folder called C:\Ramdisk_files. The Winsoft startup batch file example would then start the RAM disk at boot-time, format the disk, and copy the cleaned, perfect browser Temp files from C:\Ramdisk_files to the RAM disk. You'd then surf normally.

At shutdown, instead of preserving the RAM disk contents via the second Winsoft batch file, you'd simply let the RAM disk files vanish at power down, wiping out all new cookies and other remnants from your online activities. At the next restart, the RAM disk would be recreated afresh, using only the pristine, known-good Temp files and folders. This way, your browser files would never accumulate all the garbage that normally accrues with surfing activity.

If that seems too convoluted, Cenatek's RAMDisk (free for 30 uses; $49 thereafter) is somewhat slicker, with much more configurable operation, a more-complete GUI, and even some semiautomatic customizations, such as helping you to capture your browser's Temp files. What's more, it uses a form of disk imaging to back up and restore the contents of the RAM disk automatically to prevent loss at shutdown; and can even automatically image the RAM disk as you work.

2 of 3
Comment  | 
Print  | 
More Insights
Register for InformationWeek Newsletters
White Papers
Current Issue
InformationWeek Tech Digest August 03, 2015
The networking industry agrees that software-defined networking is the way of the future. So where are all the deployments? We take a look at where SDN is being deployed and what's getting in the way of deployments.
Twitter Feed
InformationWeek Radio
Sponsored Live Streaming Video
Everything You've Been Told About Mobility Is Wrong
Attend this video symposium with Sean Wisdom, Global Director of Mobility Solutions, and learn about how you can harness powerful new products to mobilize your business potential.