Server Architecture

What is Virtual Memory? ~ About swap, MMU, paging table ~

What is Virtual Memory?

The word virtual memory is now confusing, but it has two meanings.

One is referred to as virtual memory, a technology used in swap etc. The other refers to the memory on the virtual server. In this article I will talk about the former.

Essence of virtual memory

Regarding the first "virtual memory", some people are mistaken as "virtual memory = swap", but the essence is different.

When creating an application, memory-aware programming is required , but it is extremely difficult for application developers to handle the address of physical memory.

So virtual memory is made to handle physically disjointed addresses as sequential addresses so that application developers can handle it easily.

By using the concept of virtual memory, the application developer only needs to program only the amount that you want, and the OS side will deal with where to pay out. The OS gathers the released physical addresses, redirects them to the virtual memory of the sequential number, and pays out to the application.

 

As a secondary extension of it, a swap was devised and implemented that considered part of the HDD as an address of virtual memory.

MMU (Memory Management Unit) converts virtual memory addresses and physical memory addresses.MMU converts using "Page Table" which describes how to convert virtual address and physical address. As this paging table changes every moment, updates are made from time to time.

The MMU once existed in the memory controller and was sandwiched between the CPU and the memory, but now the memory controller is built in the CPU, and the MMU is built in the CPU as well.

Why be confused?

In Windows, it is probably caused by expressing the swap area as "virtual memory".

Summary

Virtual memory is essentially a function to provide sequential addresses to applications, swapping as a secondary extension of them, " Area of ​​HDD using virtual storage = swap".

コメント

Copied title and URL