Hello There! we are back to learning about Operating Systems. For the last three days I took a break from learning about OS and in the meanwhile was learning about SvelteJS which is a JS framework for building UI.
We last time were learning about the Memory management and now we will start from Virtual Memory. We learned about virtual memory a little in some of the posts from Memory Management Module and now we will be digging deeper into it. We will start from what a virtaul memory is.
What Is Virtual Memory?
Virtual Memory is a technique that is used to excede the limit of the main memory by using the secondary memory to store pages that we can swap in and out of the memory. It is a technique that is used to execute the porcesses that are not in the main memory.
This technique allows the user to execute the programs that are bigger than the main memory. The Operating Systems divideds the program into small parts called pages. It keeps the pages that are required at the time for execution in the main memory and all other pages in a backing store usually a HDD or SDD.
These pages are swapped in and out of the main memory as they are needed. The backing store is usually an are of the disk which is outside the filesystem.
If the flow of the program reaches a point where the required part is not in the main memory the OS will swap that part in from the backing store and the part which is not being used right now is swapped out of the main to the backing store until the program has not finished execution.
It allows to execute more that one process at the same time as the processes can be non-contigous in paging system. Each process can be larger that the available real memory.
This was what Virtual Memory is and next we will be taking a look at how it actually works and what algorithms are used and how they are used in managing virtual memory.