Virtual memory: The use of a portion of the hard disk as memory

During memory allocation, the operating system sometimes generates some free memory areas that cannot be used normally. These are memory fragments, or memory bits. These memory bits are divided into two types: internal and external bits.

1) Internal oddment refers to that when a process requests memory allocation from the operating system, after the system meets the memory requirements of the process, it also allocates some extra memory to the process. That is to say, the extra memory belongs to the process and cannot be accessed by other processes.

2) External oddment refers to some free memory areas in the memory. Although these memory areas are not owned by any process, they are formed because the memory area is too small to meet the memory size applied by other processes.

Page storage management allocates memory to processes in the unit of pages (the page size is fixed and determined by the system). For example, suppose that the total memory is 100K and the memory is divided into 10 pages with each page size of 10K. Apply now process A 56 k of memory, because the page type page storage management is A process of memory allocation for the unit, so the system will provide to process A 6 page, which is 60 k of memory space, and so on the last page in the process of using only 6 k, 4 k more to fragments of the memory, but this 4 k fragments of the memory system has been assigned to process A, These memory areas are no longer accessible to other processes, and such memory fragments are known as internal oddment.

3) Segment storage management is the segment (the size of the segment is determined by the program logic, and the size is not fixed) for the unit of memory allocation to the process, the process how much memory, the system will allocate to the process how much memory, so that there will be no internal oddment, but the segment allocation will produce external oddment.

For example, if the total memory size is 100 KB, process A applies for 60 KB memory from the system, and the system still has 40 KB free memory space. If process B applies for 50K memory area from the system, and the system only has 40K memory area left, the 40K memory area does not belong to any process, but cannot be allocated to process B because the size cannot meet the requirements of process B, resulting in external oddplaces