Chapter 3: Memory Management
Memory Management:
Storage management functions:
· Memory space allocation and recovery, including memory allocation and sharing
· Address translation
· Memory space expansion
· Storage protection
Program loading:
· Static relocation
· Dynamic Relocation
Program link:
· Static Link
· Dynamic link during loading
· Dynamic link during runtime
Logical Address Space:
Physical address space:
Memory protection:
· Storage key protection
· Upper and lower limit protection
Static continuous allocation management:
· Fixed partition Storage Management: evenly divided memory
· Variable-type partition Storage Management: memory is divided by a certain proportion
Dynamic Allocation Management:
How much is used and how much is used, resulting in a lot of fragments after a long time
Allocation Algorithm:
· FirstFit)
· Next adaptive algorithm (NextFi)
· Best adaptive algorithm (BestFit)
· WorstFit)
Relocated partition management:
Memory relocation:
Discontinuous allocation management methods:
· Paging Management
· Segmented Management
· Segment-and-Page Management
Virtual Memory Management:
Locality Principle:
You do not need to load all the memory. The starting point of calling a program or data virtual storage is the local principle. The local principle can be divided into temporal locality and spatial locality.
Basic concepts of virtual memory:
Virtual Memory refers to virtual memory that does not actually exist. Broadly speaking, virtual memory is used as long as the actual memory address is not used during programming.
The basis for implementing virtual memory:
· Hardware basics: memory, external storage, dynamic address switching mechanism, and page-missing interrupt mechanism
· Software basics: Data Structure of virtual conversion, interrupt service processing mechanism, and operating system support
Virtual Memory implementation solution:
· Webpage-based virtual storage (request paging)
· Segment-based virtual storage · segment-and-page-based virtual storage
Main features of virtual storage:
· Multiple features
· Exchange
· Virtualization
Request paging management method:
Page adjustment policy: Request-based page adjustment and pre-adjustment page
Page Replacement Algorithm:
· Optimal Replacement Algorithm (OPT)
· FIFO Algorithm)
· The least recent use of the page algorithm (LRU)
· CLOCK algorithm (CLOCK)
Page allocation policy:
· Fixed allocation local replacement policy
· Variable Allocation global replacement policy
· Variable Allocation local replacement policy
Working Set:
In a paging environment, the local access performance of a program is that the program frequently uses some pages within a certain period of time. Therefore, the long-standing residence of these pages in the memory is conducive to improving the processing efficiency.
Jitter:
If the number of storage blocks allocated to a process is smaller than the minimum value required by the process, the process runs frequently and causes page disconnection. This phenomenon is called jitter. Jitter reduces system operation efficiency.
Methods To prevent jitter:
· Adopt a local replacement policy
· Introduce Working Set Algorithms
· Suspend or withdraw the process
· Increase physical memory