Levels of Memory in Operating System

Memory hierarchy of a computer system it handles differences in speed. “Hierarchy” is a great way to say “order of thinks” like top to bottom, fast to slow, most important to least important.

If you look at the memory hierarchy inside the computer, according to the fastest to the slowest:

1. CPU Registers
2. Caches memory
3. Main or Primary Memory
4. Secondary Memory 

These are explained as following below.

  1. CPU Register:
    These high speed registers in CPU serve as working memory for instruction and temporary storage of data. Typically, they create a general purpose register file to store data as it is processed. The capacity of 32 data words is typical of a register file, and each register can be read or written from within a single clock cycle.




  2. Caches Memory:
    Now a days, most computers contain another level of IC memory- sometimes several such levels- Known as cache memory, that is positioned logically between the CPU registers and main memory. storage capacity of a cache is less than of main memory, but with an access time of one to three cycles, the cache is much faster than main memory because some or all of it can reside on the same IC as the CPU.


    For high performance computers, caches are essential components. Unlike the other three types of memory, the cache is usually transparent to programmers. Simultaneously, a computes cache and main memory implement directly mapped external memory by the instructions of the CPU.


  3. Main or Primary Memory:
    It is large, fairly fast external memory, which stores programs and data in active use. in main memory, storage locations are addressed directly by the load and store instruction of the CPU. While an IC Technology similar to that of a CPU register file is used, access is slower is due to large capacity of main memory and the fact that it is physically separated from the CPU. Access time of five or more clock cycles are usual.


  4. Secondary Memory:
    Secondary memory is very large in capacity but much slower than memory. Secondary memory store system programs, large data files, and the like are not consistently required by the CPU. When the capacity of the main memory. in secondary storage, information is considered on line, but is accessed indirectly through I/O programs that transfer information between main and secondary memory.


    The most and common examples of secondary memory are magnetic hard disks and CD-ROMs (compact discs only read memories), both of which have relatively slow electrical access mechanisms. Storage capacity of several gigabytes is typical, while access time is measured in milliseconds.

Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.

My Personal Notes arrow_drop_up


If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.