The Wayback Machine - https://web.archive.org/web/20240926170242/https://www.geeksforgeeks.org/difference-between-virtual-memory-and-cache-memory/
Open In App

Difference between Virtual memory and Cache memory

Last Updated : 22 Feb, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Cache Memory: Cache memory increases the accessing speed of CPU. It is not a technique but a memory unit i.e a storage device. In cache memory, recently used data is copied. Whenever the program is ready to be executed, it is fetched from main memory and then copied to the cache memory. But, if its copy is already present in the cache memory then the program is directly executed. 

 

Virtual Memory: Virtual Memory increases the capacity of main memory. Virtual memory is not a storage unit, its a technique. In virtual memory, even such programs which have a larger size than the main memory are allowed to be executed. 

Difference between Virtual memory and Cache memory:

S. No. Virtual Memory Cache Memory
1. Virtual memory increases the capacity of main memory. While cache memory increase the accessing speed of CPU.
2. Virtual memory is not a memory unit, its a technique. Cache memory is exactly a memory unit.
3. The size of virtual memory is greater than the cache memory. While the size of cache memory is less than the virtual memory.
4. Operating System manages the Virtual memory. On the other hand hardware manages the cache memory.
5. In virtual memory, the program with size larger than the main memory are executed. While in cache memory, recently used data is copied into.
6. In virtual memory, mapping frameworks is needed for mapping virtual address to physical address. While in cache memory, no such mapping frameworks is needed.
7. It is not as speedy as cache memory. It is a fast memory.
8. Those data or programs are kept here that are not completely get placed in the main memory. The frequently accessed data is kept in cache memory in order to reduce the access time of files.
9. Users are able to execute the programs that take up more memory than the main memory. The time required by CPU to access the main memory is more than accessing the cache. That is the reason frequently accessed data is stored in cache memory so that accessing time can be minimized.


Similar Reads

Locality of Reference and Cache Operation in Cache Memory
This article deals with the concept of locality of reference and cache operations in cache memory. Locality of reference refers to the process of accessing a particular portion of memory at any given time period. Cache memory is a small-sized memory that allows fast access by storing the frequently needed data and instructions. And cache operations
7 min read
Difference between Cache Coherence and Memory Consistency
1. Cache coherence :Cache coherence in computer architecture refers to the consistency of shared resource data that is stored in multiple local caches. When clients in a system maintain caches of a shared memory resource, problems with incoherent data can arise, which is especially true for CPUs in a multiprocessing system.In a shared memory multip
2 min read
Difference Between Efficiency and Speedup in Cache Memory
To understand the operation of cache memory, one has to familiarize the concepts of efficiency as well as speedup in computer architecture. These two metrics are sometimes considered synonyms but in fact they have different applications and let a system analyst come across different picture of the system’s efficiency. Effectiveness is the ability o
6 min read
Difference between Cache Memory and Register
In the context of a computer’s architecture, two terms that may be familiar are the cache memory and the register, however, few people may not know the differences and functions of each of the two components. Both of them are important to the CPU but they have different roles and are used in different manner. In this article, we will look at some i
5 min read
Difference between Virtual function and Pure virtual function in C++
Virtual Function in C++ A virtual function is a member function which is declared within a base class and is re-defined(Overridden) by a derived class. When you refer to a derived class object using a pointer or a reference to the base class, you can call a virtual function for that object and execute the derived class’s version of the function. Pu
2 min read
Differences between Associative and Cache Memory
1. Associative Memory: The time required to find an object stored in memory can be significantly reduced if the stored data can be identified by the content of the data for its own use rather than by access. A memory unit accessed by a material is known as an associative memory or a content addressable memory (CAM). This type of memory is accessed
2 min read
Difference between Virtual Memory and Job Pool
Virtual Memory :Virtual memory is a memory management technique in the operating system that gives users the illusion that they are working with memory that is equal to the memory of secondary storage medium ( that is very large memory). Thus, this allows a programmer to write a program that requires more memory than the actual memory.Job Pool :A j
3 min read
Cache Memory Design
Prerequisite - Cache Memory A detailed discussion of the cache style is given in this article. The key elements are concisely summarized here. we are going to see that similar style problems should be self-addressed in addressing storage and cache style. They represent the subsequent categories: Cache size, Block size, Mapping function, Replacement
5 min read
Concept of Cache Memory Design
Cache Memory plays a significant role in reducing the processing time of a program by provide swift access to data/instructions. Cache memory is small and fast while the main memory is big and slow. The concept of caching is explained below. Caching Principle : The intent of cache memory is to provide the fastest access to resources without comprom
4 min read
Cache Hits in Memory Organization
The user has a memory machine. It has one layer for data storage and another layer for the cache. The user has stored an array with length N in the first layer. When the CPU needs data, it immediately checks in cache memory whether it has data or not. If data is present it results in CACHE HITS, else CACHE MISS, i.e., data is not in cache memory so
8 min read
Terminologies Cache Memory Organization
Cache Memory is a small, fast memory that holds a fraction of the overall contents of the memory. Its mathematical model is defined by its size, number of sets, associativity, block size, sub-block size, fetch strategy, and write strategy. Any node in the cache hierarchy can contain a common cache or two separate caches for instruction and or data.
4 min read
Factors affecting Cache Memory Performance
Computers are made of three primary blocs. A CPU, a memory, and an I/O system. The performance of a computer system is very much dependent on the speed with which the CPU can fetch instructions from the memory and write to the same memory. Computers are using cache memory to bridge the gap between the processor's ability to execute instructions and
5 min read
Cache Memory Performance
Types of Caches : L1 Cache : Cache built in the CPU itself is known as L1 or Level 1 cache. This type of cache holds most recent data so when, the data is required again so the microprocessor inspects this cache first so it does not need to go through main memory or Level 2 cache. The main significance behind above concept is "Locality of reference
5 min read
Cache Memory in Computer Organization
Cache memory is a small, high-speed storage area in a computer. The cache is a smaller and faster memory that stores copies of the data from frequently used main memory locations. There are various independent caches in a CPU, which store instructions and data. The most important use of cache memory is that it is used to reduce the average time to
9 min read
Difference between Random Access Memory (RAM) and Content Addressable Memory (CAM)
Random Access Memory (RAM) is used to read and write. It is the part of primary memory and used in order to store running applications (programs) and program's data for performing operation. It is mainly of two types: Dynamic RAM (or DRAM) and Static RAM (or SRAM). RAM is made up of small memory cells that are arranged in a grid pattern. Each cell
4 min read
Difference Between Eidetic Memory and Photographic Memory
Difference Between Eidetic Memory and Photographic Memory: Eidetic memory and photographic memory are two distinct forms of human memory. Memory is the capacity to gather, retain, and recall information. This cognitive function hinges on three primary processes: encoding, storage, and retrieval. Human memory encompasses the capacity to maintain and
10 min read
Difference between Byte Addressable Memory and Word Addressable Memory
Memory is a storage component in the Computer used to store application programs. The Memory Chip is divided into equal parts called as "CELLS" . Each Cell is uniquely identified by a binary number called as "ADDRESS" . For example, the Memory Chip configuration is represented as '64 K x 8' as shown in the figure below. The following information ca
3 min read
Difference between Volatile Memory and Non-Volatile Memory
Memory is one of the most fundamental components in computing systems. Broadly, computer memory can be divided into two types namely volatile memory and non volatile memory. Even though both are crucial in the total functioning of the electronics, they are not interchangeable, each playing specific roles. Volatile memory deploys power in order to s
6 min read
Difference between Uniform Memory Access (UMA) and Non-uniform Memory Access (NUMA)
In computer architecture, and especially in Multiprocessors systems, memory access models play a critical role that determines performance, scalability, and generally, efficiency of the system. The two shared-memory models most frequently used are UMA and NUMA. This paper deals with these shared-memory models, explaining their characteristics, adva
5 min read
Difference between RAM and Cache
Memory is important in modern computing systems because it allows for efficient and quick data processing. Random Access Memory (RAM) and cache memory are two common types of memory used in computers. Both serve separate purposes and are required for a computer's maximum performance. RAM is the primary memory that stores data and programs currently
5 min read
Difference between Cache and Cookies
Both Cache and Cookies were fabricated to spice up website performance and to create additional accessibility by storing some data on the client-side machine. The main difference between Cache and Cookie is that Cache is used to store online page resources during a browser for the long run purpose or to decrease the loading time. On the other hand,
4 min read
Difference between Buffer and Cache
Among all the categories existing in the field of computing, both buffers and caches are important for improving system efficiency. But they are different from each other concerning their functions and the modes they employ. Thus, it is vital to comprehend the difference between a buffer and a cache for those who wants to consider their system more
5 min read
Difference Between CPU Cache and TLB
The CPU Cache and Translation Lookaside Buffer (TLB) are two important microprocessor hardware components that improve system performance, although they have distinct functions. Even though some people may refer to TLB as a kind of cache, it's important to recognize the different functions they serve in a computer's memory management system. What i
4 min read
Memory Allocation Techniques | Mapping Virtual Addresses to Physical Addresses
Prerequisite : Requirements of Memory Management System, Logical and Physical Address Memory Allocation Techniques:To store the data and to manage the processes, we need a large-sized memory and, at the same time, we need to access the data as fast as possible. But if we increase the size of memory, the access time will also increase and, as we kno
5 min read
Virtual Memory | Questions
Advantages Large virtual memory. More efficient use of memory. Unconstrained multiprogramming. There is no limit on degree of multiprogramming. Disadvantages Number of tables and amount of processor overhead for handling page interrupts are greater than in the case of the simple paged management techniques. Due to lack of an explicit constraint on
2 min read
Virtual Memory in Operating System
Virtual Memory is a storage allocation scheme in which secondary memory can be addressed as though it were part of the main memory. The addresses a program may use to reference memory are distinguished from the addresses the memory system uses to identify physical storage sites and program-generated addresses are translated automatically to the cor
15 min read
Difference between Chatbot and Virtual Assistant
1. Chatbot : Chatbot is a type of software that is programmed to interact with humans in such a way that it sounds like humans themselves. Chatbot is created using Natural Language Processing and Machine Learning. It identifies the meaning of the question asked by the user and collects data from the user that may be required to answer the question.
2 min read
Difference between Parallel Virtual Machine (PVM) and Message Passing Interface (MPI)
1. Parallel Virtual Machine (PVM) : PVM is a type of software tool which is designed for heterogeneous distributed computing. This software was created at the Oak Ridge National Laboratory in 1989 and it was rewritten in 1991 at the university of Tennessee. In this system, it allows a heterogeneous network which can be made from a collection of dis
2 min read
Difference between virtual function and inline function in C++
Virtual function: Virtual function is a member function which is declared within a base class and is redefined by a derived class. Inline function: Inline function is a normal function which is defined by the keyword inline, it is a short function which is expanded by the compiler and its arguments are evaluated only once. The syntax of defining th
2 min read
Difference Between Friend Function and Virtual Function in C++
A friend class can access private and protected members of other classes in which it is declared as friend. It is sometimes useful to allow a particular class to access private members of other classes. Just likely, a friend function is a function that is declared outside the scope of a class. This function can be invoked like a normal function and
3 min read