Two Types of Memory
All computers have two primary types of memory and understandably, many people get the two confused. RAM, which is an acronym that stands for Random Access Memory is very fast memory and is composed of integrated circuit chips mounted on snap-in memory modules. RAM is volatile, that is, its contents are lost when power is removed from the computer.
Disk drives are slower, but provide for the long-term storage needs of the computer. They are not volatile and the data stored on them is retained even when power is removed. Data is stored permanently as magnetic tracks on the disk, in a manner similar to the way in which data is recorded on the magnetic strips of your credit cards.
Disk space is also less expensive per bit than RAM, so large amounts of disk storage cost significantly less than the same amounts of RAM.
Random Access Memory (RAM)
RAM is fast; it is much faster than a hard drive. RAM can be fast because it is all electronic and contains no moving mechanical parts. RAM needs to be very fast in order to keep up with the high speed demands of the CPU, or processor which is the brains of the computer. Especially today, when many computers have multiple core processors and run at very high speeds, it is difficult for even the fastest memory to keep up.
The primary function of RAM is to provide fast memory as a storage location for the processor(s) from which they can access both program code and the data operated on by those programs. With multi-tasking operating systems such as Linux, many different programs and their data may reside in RAM at one time. As programs complete and are closed by the users or automatically when they complete their designed tasks, they may be deleted from RAM in order to make room for other programs and their data. In addition, all of the contents of RAM are always lost forever when the computer is turned off or when a power failure occurs.
If you have ever lost the contents or some changes you have made to a word processing document as the result of a power failure, then you have experienced the volatility of RAM. The changes you made had been stored in RAM but not yet written to the hard drive.
Most computers have anywhere from a few hundred Megabytes (MB) of RAM to a few Gigabytes (GB). This is not enough space in which to store the entire operating system and all of the programs and data that are needed by today’s users. Many people, especially teenagers, store many GigaBytes of music and videos on their computers so some place is needed to store that much data even when the power is turned off.
Disk drives are used for long term storage of programs and very large amounts of data. When the computer is powered on, the operating system and its data, as well as any programs launched by the user and their data are loaded into RAM from their long-term storage locations on the hard drive. Modifed data is then recorded back onto the hard drive for long-term storage. The disk drive retains the data stored on it even when the power is off.
Disk drives are much slower than RAM because they contain moving mechanical parts; as disk that spins and heads that move across the disk to read and write the data stored on the disk.
Today’s disk drives can store from around 80GB of data to as much as 2 Terabytes (TB) of data or more. Disk capacities are expanding constantly so expect both the minimum and maximum capacities to increase over time.
Files are stored on disk drives. This is where the file managers we discuss in this section of the DataBook for Linux Users locates and manages files.
A file is a collection of related data. This may be as simple a list of employees and their telephone numbers or a single word processing document or spreadsheet. Files can also be executable programs, pictures and graphics, multimedia presentations and much more.