Virtual Memory in OS: Examples, Types, & Uses | How Does it Work?

Hi Learner! Here, we are going to explain in detail about what is virtual memory in OS and its examples, types, and uses; and involving with how virtual memory works without any hassle. So, at the end of this article, you will definitely fully understood about virtual memory in operating system with ease.

What is Virtual Memory?

Definition/MeaningVirtual memory is large secondary memory of operating system, and it allows to hardware and software of computer system to support for physical memory on transferring time of data from main memory to secondary memory such as hard disk.

Virtual Memory Diagram

Virtual Memory

Due to move virtual memory into physical memory, operating system splits own memory into different blocks with fixed number of addresses. All pages reserved in the hard disk, and OS moves it from hard disk to primary memory, when they get need, and finally virtual addresses translate into real addresses.

Virtual Memory Tutorial Headlines:

In this section, we will show you all headlines about this entire article; you can check them as your choice; below shown all:

  1. What is Virtual Memory?
  2. Need of Virtual Memory
  3. Types of Virtual Memory
  4. How Virtual Memory Works
  5. Virtual Memory Example
  6. Difference in Between Virtual and Physical Memory
  7. Advantages of Virtual Memory
  8. Disadvantages of Virtual Memory
  9. FAQs (Frequently Asked Questions)
  • What is virtual memory in operating system?
  • Why it is called virtual memory?
  • What is the size of virtual memory in computer architecture?
  • How do I increase virtual memory?
  • Where is virtual memory usually located?
  • How virtual memory is implemented in OS (Operating System)?
  • How is virtual memory created?
  • Why is virtual memory used in operating system?
  • Why is virtual memory needed?
  • What is virtual memory in computer architecture with example?
  • What is virtual memory example?
  • What are the different types of virtual memory in computer architecture?

Let’s Get Started!!

Need of Virtual Memory

  • Main objective of needing is virtual memory is to increase the storage space of running memory, without adding any external memory such as RAM (Random Access Memory).
  • If, any time computer’s physical memory totally get occupy for other programs, but same time it needs to some extra memory then requests forwards to hard disk for swapping files like as virtual memory.
  • If, any time computer requires the extra more main memory (RAM), then it try to install in the machine, and it works as small area of disk for fulfill system needs.

Types of Virtual Memory

Read More – Cache Memory | Locality of Reference in OS

Entire memory operations of computer managed by the memory management unit (MMU), and it enables with handling Virtual Memory. Memory management unit embedded in the CPU (Center Processing Unit).

In virtual Memory, two techniques use like as Paging and Segmentation.


In this way, memory get spit into different small blocks with near about 4 KB in size.

The paging enables with using the page table, which is help out to translate the virtual addresses for using operating system and other running other applications, and they use those addresses into physical addresses which are using by MMU.

When, operating system and other currently using applications are not able to find appropriate address, which located into RAM, then memory management unit try to response for missing memory reference along page fault. But if Page occur into RAM, then its virtual address exists into page table.


Main objective of using the Segmentation is to handle the virtual memory. In this process, virtual memory divides into various different segments. But these segments are not using into memory because those segments to be transferring in the virtual memory on hard drive. Segment table keeps all records of entire information of whole segments. 

Sometime virtual memory system tries to merge the paging and segmentation, and after getting combinations of then memory get divide into pages or frames.

How Virtual Memory Works

Read More – Page Fault in Operating System!!

Now these days, virtual memory is very common word. Virtual memory is very helpful, when anyone page get need to load into primary memory for its execution, but it has not enough memory for those pages.

Then, virtual memory helps to short out that issue such as – lack of memory.

Now, here we will explain the working of virtual memory with suitable example. Like as –

Virtual Memory Example

  • Suppose, if operating system requires the 200 MB memory’s space to manage the all programs, which are working in currently.
  • Then, Operating system will try to create the 200 MB of virtual memory, and VMM (Virtual Memory Manager) helps to handle that memory.
  • VMM has to work to arise the new files on the hard disk, which are need (100 MB) such as (200 MB-100 MB) = 100 MB.
  • VMM has responsible to deal in real memory, which is only 100 MB.

Difference in Between Virtual and Physical Memory

Here’s a tabular comparison between virtual and physical memory:


Virtual Memory

Physical Memory


Potentially larger than physical memory

Limited by the actual

size of RAM installed on the computer


Exists on the hard drive or other storage devices


on the RAM modules installed on the motherboard


Slower compared to physical memory

Faster since it is directly accessed by the CPU

Access Time

Longer access times due to the need to transfer data between storage and RAM

Shorter access times as data is directly accessed from RAM


Persistent, data remains even after power-off.         

Volatile, data is lost when the power is turned off


Acts as an extension of physical memory when the latter is insufficient

Primary workspace for the CPU during program execution


Managed by the operating system using techniques like paging and segmentation

Managed by the operating system using memory management unit (MMU) and direct addressing


Generally cheaper in terms of cost per unit of storage

Typically more expensive in terms of cost per unit of storage


Cannot be extended

Extends the available physical memory


Page file on Windows, swap space on Linux

RAM modules

(DDR, SDRAM, etc.)

Advantages of Virtual Memory

Read More – Page Replacement Algorithms in OS!!

There are several of pros/benefits of enabling virtual memory, such as –

  • Assigning the memory is very cheap and effective way.
  • Page mapping get execute in good manner.
  • Virtual memory helps to trash the external fragmentation.
  • While using of huge virtual space, vast programs can implement.
  • Virtual memory allows too fast and easy processes.
  • Due to store of programs in the virtual memory, not need more memory space.
  • All data (page frames) can easily distribute on the entire physical memory.
  • Allowing the very effective swapping
  • It is capable to operate multiple applications concurrently.
  • It allows the flexibility because their large programs can fit into small size programs.
  • It allows sharing common data between their memories.
  • All processes can get large size to physical memory.
  • It allows reading all data from hard disk, when to need.
  • It allows replacing any code in physical memory without needing relocation.
  • It helps to improve the performance of CPU.
  • It has no any boundation for all degree of multi programming.
  • It allows huge virtual address space to physical memory.
  • It allows allotting the specific segment of program for execution of particular program, so it helps to enhance the speed of execution time.
  • It allows the protection between two programs.

Disadvantages of Virtual Memory

There are some limitations of virtual memory such as – 

  • While using of virtual memory, all application’s speed are getting slow.
  • It consumes more hard disk space.
  • Lack of system stability
  • It is not capable to deliver the equal performance like as RAM.
  • Due to virtual memory, system gets degrade.
  • It consumes more time between switching the applications.
  • Increase the software complexity and hardware cost.
  • Required the best hardware support
  • Kernel developers require a profound understanding of the hardware, if they are using Virtual memory.

FAQs (Frequently Asked Questions)

What is Virtual Memory in Operating System?

Virtual memory is going to enable data that is in the RAM but not presently used to transfer to the hard disk, it allows getting free up the room for another program and data as well. You can get complete detail about virtual memory through this blog post.

Why It is Called Virtual Memory?

A computer is able to address more memory compare to the amount physically installed on your system, and so this additional memory is actually known as the virtual memory.

What is the Size of Virtual Memory in Computer Architecture?

RAM has a limited resource, but whereas virtual memory has a unlimited resources, so there can be various processing, and every process has its own 2GB private virtual address space.

How do I Increase Virtual Memory?

  • Go to Control Panel > System and Security > System
  • Choose the ‘Advance System Settings’ to launch your ‘System Properties’. Then it will open the ‘Advanced’ tab.
  • Select the ‘Settings’ underneath ‘Performance’ to open ‘Advanced’ tab; then underneath ‘Virtual Memory’ choose the ‘Change’, and here ‘Virtual Memory’ option will show.

Where is Virtual Memory Usually Located?

Usually, virtual memory is located on the ‘Hard Drive’.

How Virtual Memory is Implemented in OS (Operating System)?

Through this article, we already have explained about how to implement virtual memory in OS; you can read it.

Why is Virtual Memory Used in Operating System?

Virtual memory uses whenever the computer has not more present RAM (Random Access Memory). Whenever, the amount of RAM required keeping hold all running programs and data is higher to amount of RAM present into computer.

Why is Virtual Memory Needed?

Main objective of needing is virtual memory is to increase the storage space of running memory, without adding any external memory such as RAM (Random Access Memory).

What is virtual Memory in Computer Architecture with Example?

Virtual memory is common concept that is using into computer’s operating system. Virtual memory is going to use both hardware and software to get enable a computer to provide extra memory for physical memory shortage and temporarily transferring data from RAM to disk storage.

What is Virtual Memory Example?

Example: A user may try to get load their email in their browser window; while also running a word processing software, a shift scheduling software and a content management system at same time frame.

What are the Different Types of Virtual Memory in Computer Architecture?

There are two types of virtual memory like as Paging and Segmentation; both explained in detail above in this post, you can check it.

Summing Up

Through this article, you have been fully learnt about what is virtual memory in OS and its examples, types, and uses; and involving with how virtual memory works without any hassle. If this article is helpful for you, then please share it along with your friends, family members or relatives over social media platforms like as Facebook, Instagram, Linked In, Twitter, and more.

Read More: Demand Paging in OS: Example, Advantages, and Working!!

If you have any experience, tips, tricks, or query regarding this issue? You can drop a comment!

Happy Learning!!

Leave a Reply

Your email address will not be published. Required fields are marked *