For working professionals
For fresh graduates
More
13. What is Bios
27. Page Table in OS
41. Python OS Module
Multitasking is the new normal. We, humans, love it. We also want our gadgets to multitask. To keep our laptops running smoothly even when juggling multiple programs, operating systems use a clever technique called virtual memory. Virtual memory in OS is a ‘virtual’ reservoir of memory that enables you to expand your computer’s memory.
This tutorial is your key to understanding the basics of virtual memory and much more. Shall we?
First, let me explain Virtual memory in OS in detail.
Virtual memory in OS started developing in the late 50s and by the late 70s it had taken a proper form. The commercial computers of the 70s had virtual memory. Intel introduced virtual memory in personal computers in 1985. With this, even personal computers could now use larger files and never face storage issues.
Virtual memory in OS is an efficient way to help your laptop or computer allocate and manage space to run multiple programs quickly and smoothly. It expands the computer's available memory by using space on the hard drive. This allows the system to handle larger programs and data sets that can fit into RAM alone, ensuring smooth operation without running out of memory.
Easy right?
Now, let’s understand virtual memory in computer architecture with example.
You must have heard of photo editing software like Adobe Photoshop. When you start the program or the editor, virtual memory only brings the essentials to the RAM so that you can start editing. As you start using different features in the editor virtual memory swaps them with the inactive pages between the RAM and hard drive.
As the name suggests virtual memory is not a physical location within a computer. But the data is stored in the HDD (Hard Drive) or SSD (Solid-State Drive), which have higher capacity than RAM.
Virtual memory is crucial for multitasking, and that’s a fact. The following reasons are some of the most important ones that you need to know:
Now that you have understood what virtual memory is in computer architecture, it’s time to understand it further. Virtual memory management is a core concept. Its key components are:
Then what is a Memory Management Unit or MMU?
It is like a translator between CPU and physical memory. It plays a crucial role in virtual memory management within the Operating System. The following terms that I am explaining will help you understand MMU in detail:
Virtual memory has two types:-
Paging is the most common type of virtual memory in OS and one of the go-to processes for handle memory. It breaks down both the computer's memory and the programs running on it into smaller chunks called pages.
This method lets us swap pages in and out independently, which helps us use memory more efficiently and avoid wasting space. It also helps translate virtual addresses to actual memory locations more quickly.
However, there's a downside. If the free space where we store these swapped-out pages isn't located close together on the hard drive, it can slow things down.
Segmentation offers greater flexibility compared to paging by dividing programs based on their functionalities rather than rigid block sizes. Each segment can have different access permissions, thereby enhancing security measures. Moreover, since segments vary in size, it reduces external fragmentation issues.
However, managing segments of variable sizes can be complex, and there's a risk of internal fragmentation within segments.
These days virtual memory in OS often has a mix of paging and segmentation. While paging is for core memory management, segmentation is used within processes. Factors like specific needs of the program and memory management help decide between paging and segmentation.
Let’s look at the advantages of the virtual memory concept in OS:
Virtual memory in OS has its fair share of challenges. Let’s learn about them here:
I have covered nearly all basic topics related to virtual memory in OS in this tutorial. You have also seen why virtual memory management in OS is a fantastic way to overcome the limitations of physical RAM. Modern programs demand vast memory and how virtual memory helps achieve it. The types of virtual memory will come in handy while running general diagnostics on your system. While virtual memories have limitations like slower speed than RAM it still is the best way to achieve multitasking without breaking the bank.
Mastering complex concepts like virtual memory in OS opens up exciting career paths. At upGrad you will find a structured way to deep dive into these concepts.
It is a method to manage space which helps in running various systems simultaneously.
The size of Virtual memory in OS is the total memory capacity accessible by a computer, including both physical RAM and space on the hard drive or SSD, used for swapping data in and out of RAM.
Virtual RAM is on smartphones, where the device’s internal storage is used as additional RAM.
Virtual memory in OS is in the secondary memory storage like the HDD or SSD.
Think of virtual memory as an expandable backpack for your laptop. It helps you carry more things (programs) than would fit in your pockets (RAM) alone. This way you can work on things wherever you go.
Since RAM has physical limitations and OS has more memory, virtual memory is in OS.
The size of virtual memory in OS varies within a specific range. Initially, it starts at 1.5 times the total system memory and can increase to a maximum of 3 times the initial size. For instance, if your computer has 16 GB of RAM, the initial virtual memory size would be 24 GB (16 x 1.5). Similarly, the maximum virtual memory size could reach up to 48 GB (16 x 3).
Yes, virtual memory in OS is quite large.
For Android smartphones, you can find virtual RAM in the RAM management section. For OS like Win 10 or 11, it does not have user-accessible RAM as this is an automatic process within the OS.
The feature of virtual memory is permanent and the data it stores can be swapped when not needed. So, the data is temporary.
Author
Talk to our experts. We are available 7 days a week, 9 AM to 12 AM (midnight)
Indian Nationals
1800 210 2020
Foreign Nationals
+918045604032
1.The above statistics depend on various factors and individual results may vary. Past performance is no guarantee of future results.
2.The student assumes full responsibility for all expenses associated with visas, travel, & related costs. upGrad does not provide any a.