ARCHIVED: What is the difference between memory and disk storage?
Memory and disk storage both refer to internal storage space in a computer. Each is used for a different purpose.
The term "memory" usually means RAM (Random Access Memory); RAM is hardware that allows the computer to efficiently perform more than one task at a time (i.e., multi-task).
The terms "disk space" and "storage" usually refer to hard drive storage. Hard drive storage is typically used for long-term storage of various types of files. Higher capacity hard drives can store larger amounts and sizes of files, such as videos, music, pictures, and documents.
"Virtual memory" is hard disk space that has been designated to act like RAM. It assists the computer with multi-tasking when there is not a sufficient amount of RAM for the tasks.
Computers also contain a small amount of ROM (Read-Only Memory) containing permanent or semi-permanent (firmware) instructions for checking hardware and starting up the computer. On a PC, this is called the BIOS.
Buffer and Block
file manager : confirms file use info; finds physical location of file on disk; makes sure required sector in buffer;
I/O buffer: holds sectors of data; often doesn't get written back to disk until the buffer is needed for other uses (that way if more stuff done to the same sector, it doesn't have to be loaded again)
I/O processor: may be simple chip or complex CPU;
Block: smallest amount of data that can be read from or written to secondary storage at one time. Often generalized to mean any chunk of data that can be treated as a unit (for reading, writing, organizing). We will distinguish between disk blocks (physical) and program defined blocks (logical).
- can't always ensure that logical and physical blocks match (often don't even want to).
- should make sure they compliment each other
- logical blocks should not be split between physical blocks
- it's often more efficient to waste a little physical space in order to achieve a better match
eg. logical blocks = 10 bytes; physical blocks = 32 bytes; so fit 3/p.b. (waste 2 bytes per physical block)
Blocking: the process of grouping several components into one bloc
Second storage device
hard drives (a prime example of secondary storage) are the go-to solution for nearly all data kept on today's computers.
A CPU cache is a cache used by the central processing unit (CPU) of a computer to reduce the average time to access data from the main memory. The cache is a smaller, faster memory which stores copies of the data from frequently used main memory locations. Most CPUs have different independent caches, including instruction and data caches, where the data cache is usually organized as a hierarchy of more cache levels (L1, L2, etc.).