RAM drive


A RAM drive is a block of random-access memory that a computer's software is treating as if the memory were a disk drive. 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.

Performance

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. 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, 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.
Because the storage is in RAM, it is volatile memory, which means it will be lost in the event of power loss, whether intentional or accidental. This is, in general, a weakness, 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 Atari 8-bit, Apple II series and Commodore computers, a RAM drive was also a popular application on the Atari 130XE, 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 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, 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:. 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. 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 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 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 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 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.

Dedicated hardware RAM drives

There have been RAM drives which use DRAM memory that is exclusively dedicated to function as an extremely low latency storage device. This memory is isolated from the processor and not directly accessible in the same manner as normal system memory.
In 2002, Cenatek produced the Rocket Drive, max 4GB, which had four DIMM slots for PC133 memory, with up to a maximum of four gigabytes of storage. At the time, common desktop computers used 64 to 128 megabytes of PC100 or PC133 memory. The one gigabyte PC133 modules cost approximately $1,300. A fully outfitted Rocket Drive with four GB of storage would have cost $5,600.
In 2005, Gigabyte Technology produced the i-RAM, max 4GB, which functioned essentially identically to the Rocket Drive, except upgraded to use the newer DDR memory technology, though also limited to a maximum of 4GB capacity.
For both of these devices, the dynamic RAM requires continuous power to retain data; when power is lost, the data fades away. For the Rocket Drive, there was a connector for an external power supply separate from the computer, and the option for an external battery to retain data during a power failure. The i-RAM included a small battery directly on the expansion board, for 10-16 hours of protection.
Both devices used the SATA 1.0 interface to transfer data from the dedicated RAM drive to the system. The SATA interface was a slow bottleneck that limited the maximum performance of both RAM drives, but these drives still provided exceptionally low data access latency and high sustained transfer speeds, compared to mechanical hard drives.
In 2006, Gigabyte Technology produced the GC-RAMDISK, max 8GB, which was the second generation creation for the i-RAM. It has a maximum of 8GB capacity, twice that of the i-RAM. It used the SATA-II port, again twice that of the i-RAM. One of its best selling points is that it can be used as a boot device.
In 2007, ACard Technology produced the ANS-9010 Serial ATA RAM disk, max 64GB. Quote from the tech report: The ANS-9010 "which has eight DDR2 DIMM slots and support for up to 8GB of memory per slot. The ANS-9010 also features a pair of Serial ATA ports, allowing it to function as a single drive or masquerade as a pair of drives that can easily be split into an even faster RAID 0 array."
In 2009, Acard Technology produced the ACARD ANS-9010BA 5.25'' Dynamic SSD SATA-II RAM Disk, max 64GB. It uses a single SATA-II port.
Both variants are equipped with a CompactFlash card interface located in the front panel, allowing non-volatile data being stored on the RAM drive to be copied on the CompactFlash card in case of power failure and low backup battery. Two pushbuttons located on the front panel allows the user to manually backup / restore data on the RAM drive. The CompactFlash card itself is not accessible to the user by normal means as the CF card is solely intended for RAM backup and restoration. Note that the CF card's capacity has to meet / exceed the RAM module's total capacity in order to effectively work as a reliable backup.
In 2009, DDRdrive, LLC produced the DDRDrive X1, which claims to be the fastest solid state drive in the world. The drive is a primary 4GB DDR dedicated RAM drive for regular use, which can back up to and recall from a 4GB SLC NAND drive. The intended market is for keeping and recording log files. If there is a power loss the data can be saved to an internal 4GB ssd in 60 seconds, via the use of a battery backup. Thereafter the data can be recovered back in to RAM once power is restored. A host power loss triggers the DDRdrive X1 to back up volatile data to on-board non-volatile storage.