This article needs additional citations for verification. (June 2009) (Learn how and when to remove this template message)
A RAM drive (also called a RAM disk) is a block of random-access memory (primary storage or volatile memory) that a computer's software is treating as if the memory were a disk drive (secondary storage). It is sometimes referred to as a virtual RAM drive or software RAM drive to distinguish it from a hardware RAM drive that uses separate hardware containing RAM, which is a type of battery-backed solid-state drive.
The performance of a RAM drive is in general orders of magnitude faster than other forms of storage media, such as an SSD, hard drive, tape drive, or optical drive. This performance gain is due to multiple factors, including access time, maximum throughput, and type of file system.
File access time is greatly reduced since a RAM drive is solid state (no mechanical parts). A physical hard drive or optical media, such as CD-ROM, DVD, and Blu-ray must move a head or optical eye into position and tape drives must wind or rewind to a particular position on the media before reading or writing can occur. RAM drives can access data with only the memory address of a given file, with no movement, alignment or positioning necessary.
Second, the maximum throughput of a RAM drive is limited by the speed of the RAM, the data bus, and the CPU of the computer. Other forms of storage media are further limited by the speed of the storage bus, such as IDE (PATA), SATA, USB or Firewire. Compounding this limitation is the speed of the actual mechanics of the drive motors, heads, or eyes.
Third, the file system in use, such as NTFS, HFS, UFS, ext2, etc., uses extra accesses, reads and writes to the drive, which although small, can add up quickly, especially in the event of many small files vs. few larger files (temporary internet folders, web caches, etc.).
Because the storage is in RAM, it is volatile memory, which means it will be lost in the event of power loss, whether intentional (computer reboot or shutdown) or accidental (power failure or system crash). This is, in general, a weakness (the data must periodically be backed up to a persistent-storage medium to avoid loss), but is sometimes desirable: for example, when working with a decrypted copy of an encrypted file.
In many cases, the data stored on the RAM drive is created from data permanently stored elsewhere, for faster access, and is re-created on the RAM drive when the system reboots.
Apart from the risk of data loss, the major limitation of RAM drives is their limited capacity, which is constrained by the amount of RAM within the machine. Multi-terabyte-capacity persistent storage has become commoditized as of 2012, whereas RAM is still measured in gigabytes.
RAM drives use the normal RAM in main memory as if it were a partition on a hard drive rather than actually accessing the data bus normally used for secondary storage. Though RAM drives can often be supported directly from the operating system via special mechanisms in the operating system kernel, it is possible to also create and manage a RAM drive by an application. Usually no battery backup is needed due to the temporary nature of the information stored in the RAM drive, but an uninterrupted power supply can keep the entire system running during a power outage, if necessary.
Some RAM drives use a compressed file system such as cramfs to allow compressed data to be accessed on the fly, without decompressing it first. This is convenient because RAM drives are often small due to the higher price per byte than conventional hard drive storage.
History and operating system specifics
The first software RAM drive for microcomputers was invented and written by Jerry Karlin in the UK in 1979/80. The software, known as the Silicon Disk System was further developed into a commercial product and marketed by JK Systems Research which became Microcosm Research Ltd when the company was joined by Peter Cheesewright of Microcosm Ltd. The idea was to enable the early microcomputers to use more RAM than the CPU could directly address. Making bank-switched RAM behave like a disk drive was much faster than the disk drives - especially in those days before hard drives were readily available on such machines.
The Silicon Disk was launched in 1980, initially for the CP/M operating system and later for MS-DOS. Due to the limitations in memory addressing on Apple II series and Commodore computers, a RAM drive was also a popular application on Commodore 64 and Commodore 128 systems with RAM Expansion Units and on Apple II series computers with more than 64kB of RAM. Apple Computer supported a software RAM drive natively in ProDOS: on systems with 128kB or more of RAM, ProDOS would automatically allocate a RAM drive named /RAM.
IBM added a RAM drive named VDISK.SYS to PC DOS (version 3.0) in August 1984, which was the first DOS component to use extended memory. VDISK.SYS was not available in Microsoft's MS-DOS as it, unlike most components of early versions of PC DOS, was written by IBM. Microsoft included the similar program RAMDRIVE.SYS in MS-DOS 3.2 (released in 1986), which could also use expanded memory. It was discontinued in Windows 7. DR-DOS and the DR family of multi-user operating systems also came with a RAM disk named VDISK.SYS. In Multiuser DOS, the RAM disk defaults to the drive letter M: (for memory drive). AmigaOS has had a built in RAM drive since the release of version 1.1 in 1985 and still has it in AmigaOS 4.1 (2010). Apple Computer added the functionality to the Apple Macintosh with System 7's Memory control panel in 1991, and kept the feature through the life of Mac OS 9. Mac OS X users can use the hdid, newfs (or newfs hfs) and mount utilities to create, format and mount a RAM drive.
A RAM drive innovation introduced in 1986 but made generally available in 1987 by Perry Kivolowitz for AmigaOS was the ability of the RAM drive to survive most crashes and reboots. Called the ASDG Recoverable Ram Disk, the device survived reboots by allocating memory dynamically in the reverse order of default memory allocation (a feature supported by the underlying OS) so as to reduce memory fragmentation. A "super-block" was written with a unique signature which could be located in memory upon reboot. The super-block, and all other RRD disk "blocks" maintained check sums to enable the invalidation of the disk if corruption was detected. At first, the ASDG RRD was locked to ASDG memory boards and used as a selling feature. Later, the ASDG RRD was made available as shareware carrying a suggested donation of 10 dollars. The shareware version appeared on Fred Fish Disks 58 and 241. AmigaOS itself would gain a Recoverable Ram Disk (called "RAD") in version 1.3.
Many Unix and Unix-like systems provide some form of RAM drive functionality, such as /dev/ram on Linux, or md(4) on FreeBSD. RAM drives are particularly useful in high-performance, low-resource applications for which Unix-like operating systems are sometimes configured. There are also a few specialized "ultra-lightweight" Linux distributions which are designed to boot from removable media and stored in a ramdisk for the entire session.
- Cache (computing), an area to store transient copies of data being written to, or repeatedly read from, a slower device
- List of RAM drive software
- LOADALL, undocumented machine instructions purportedly used by Microsoft's RAMDRIVE.SYS
- Kind, Tobias. "RAMDISK Benchmarks" (PDF). University of California. Retrieved 2011-04-22.
- Duncan, Ray (1988). The MS-DOS Encyclopedia. Microsoft Press. pp. 907–909, 948–951. ISBN 1-55615-049-0.
- Perry S. Kivolowitz (January 26, 1987). "Overhead And Implementation Notes of ASDG RRD". Newsgroup: comp.sys.amiga. Archived from the original on December 3, 2013.
- Perry S. Kivolowitz (January 21, 1987). "ASDG Recoverable Ram Disk News". Newsgroup: comp.sys.amiga. Retrieved 2014-09-23.
- "README for disk 58".
- "README for disk 241".
- "Workbench Nostalgia: The history of the AmigaOS Graphic User Interface (GUI): Release 1.3".
- FreeBSD Kernel Interfaces Manual –
- Unix shell command line to create a RAM disk on Mac OS X
- Sample code from microsoft to create RAM disk
- Benchmark of some Windows RAM Disks
- An extensive test report of several Windows RAM Disks