Virtual Memory

What is virtual memory?

Virtual memory (Virtual Memory)  is a very important technology for computer system memory management. In essence, it only exists logically. It is a hypothetical memory space. Its main function is to serve as a bridge for processes to access main memory (physical memory) and simplify memory management.

 What is the use of virtual memory?

Virtual memory mainly provides the following capabilities:

  • Isolate process : Physical memory is accessed through virtual address space, and virtual address space corresponds to process one by one. Each process thinks it owns the entire physical memory, and processes are isolated from each other, and code in one process cannot change physical memory that is being used by another process or the operating system.
  • Improve physical memory utilization : With the virtual address space, the operating system only needs to load part of the data or instructions currently used by the process into physical memory.
  • Simplified memory management : Processes have a consistent and private virtual address space. Programmers do not need to deal with real physical memory, but use virtual address space to access physical memory, thus simplifying memory management.
  • Multiple processes share physical memory : When a process is running, it will load many dynamic libraries of the operating system. These libraries are common to each process, and only one copy of them is actually loaded in memory. This part is called shared memory.
  • Improve memory usage security : control process access to physical memory, isolate access rights of different processes, and improve system security.
  • Provide larger usable memory space : Allow the program to have more available memory space than the system's physical memory size. This is because when the physical memory is not enough, the disk can be used to save the physical memory page (usually 4 KB) to the disk file (which will affect the read and write speed), and the data or code page will be stored between the physical memory and the disk as needed. to move between.

Come form Javaguide summary of common operating system interview questions (Part 2) | JavaGuide (Java interview + study guide)

Guess you like

Origin blog.csdn.net/m0_62600503/article/details/131293574