The purpose of storage management is to expand main memory capacity and improve main memory utilization efficiency. Storage management refers to the management technology of main memory. The object of memory management is main memory. It mainly achieves the purpose of efficiently utilizing main memory and expanding main memory capacity through reasonable allocation and management of main memory. The main functions of memory management include allocating and reclaiming main memory space, improving main memory utilization, expanding main memory, and effectively protecting main memory information.
The operating environment of this tutorial: Windows 7 system, Dell G3 computer.
The purpose of storage management is to expand main memory capacity and improve main memory utilization efficiency.
Storage management is a management technology for main memory. Its main purpose is to achieve efficient utilization of main memory and expand main memory capacity by rationally allocating and managing main memory.
The object of memory management is main memory. Its main functions include allocating and reclaiming main memory space, improving main memory utilization, expanding main memory, and effectively protecting main memory information.
Storage Management Solution
The main purpose of the storage management solution is to solve the problem of multiple users using main memory. Its storage management solution mainly includes Partition storage management, paging storage management, segmented storage management, segmented paging storage management and virtual storage management.
Partition Storage
There are three different ways to manage partition storage: static partition, variable partition, and relocatable partition.
Static Partition
Static partition storage management is to divide the allocable main memory space into several consecutive areas in advance. The sizes can be the same or different. In order to explain the allocation and usage of each partition, storage management needs to set up a "main memory allocation table". The main memory allocation table indicates the starting address and length of each partition. The occupied flag bit in the table is used to indicate whether the partition is occupied. When the occupied flag bit is "0", it means that the partition has not been occupied. When allocating main memory, always select those partitions with the flag "0". When a partition is assigned to a job, fill in the name of the job occupying the partition in the occupation flag column. Using static partition storage management, the utilization of main memory space is not high. [2]
Variable partitioning
The variable partitioning method is to divide the partitions according to the size of the job. When a job is to be loaded, check whether there is enough space in the main memory based on the amount of main memory required by the job. If there is enough space, divide a partition according to the required amount and allocate it to the job; if not, make the job wait for main memory space. . Since the size of the partition is determined according to the actual needs of the job, and the number of partitions is also random, the waste of main memory space in the fixed partition method can be overcome.
With the loading and evacuation of jobs, the main memory space is divided into many partitions, some partitions are occupied by jobs, and some partitions are free. When a new job requires loading, you must find a large enough free area and load the job into this area. If the free area found is larger than the job requirements, the original free area will be divided into two parts after the job is loaded. , part of it is occupied by jobs; the other part is divided into a smaller free area. When a main row is evacuated, if the area it returns is adjacent to other free areas, it can be combined into a larger free area to facilitate the loading of large jobs.
Variable partition scheduling algorithm
1) First adaptation algorithm. Each time it is allocated, the unallocated table is always searched sequentially until the first free area that meets the length requirement is found. Split the found unallocated area, part of it is allocated to the job, and the other part is still a free area. This allocation algorithm may divide a large space into small areas, resulting in more main memory "fragments".
2) Best adaptation algorithm. Select the smallest partition from the free area that can meet the job requirements. This ensures that a larger area is not divided, making it easier to satisfy large jobs when loading them. When using this allocation algorithm, the free areas can be arranged smoothly in increasing sizes. When searching, always start from the smallest area until an area that meets the requirements is found.
3) Worst adaptation algorithm. Select the largest free area for the job to use, so that the remaining free area will not be too small. This algorithm is beneficial to medium and small jobs. When using this allocation algorithm, the free areas can be smoothly arranged in descending order, and the search always starts from the largest area. In this way, the table must also be rearranged when a partition is reclaimed.
Paging storage
Paging storage management is to divide the logical address space of a process into several equal-sized pieces, called pages or pages, and number each page, starting from 0, such as page 0, page 1, etc. Correspondingly, the memory space is also divided into several storage blocks of the same size as the page, called (physical) blocks or page frames, and they are also numbered, such as 0# block, 1# block, etc. When allocating memory to a process, several pages in the process are loaded in block units into multiple physical blocks that may not be contiguous. Because the last page of the process often does not fit into one piece, unusable fragmentation is formed, which is called "in-page fragmentation".
Segmented storage
In the segmented storage management method, the address space of the job is divided into several segments, and each segment defines a set of logical information. For example, there are main program segment MAIN, subprogram segment X, data segment D, stack segment S, etc. Each segment has its own name. For the sake of simplicity, a segment number can usually be used instead of the segment name. Each segment is addressed starting from 0 and uses a continuous address space. The length of the segment is determined by the length of the corresponding logical information group, so the length of each segment is different. Since the address space of the entire job is divided into multiple segments, it is two-dimensional. That is, its logical address consists of the segment number (segment name) and the address within the segment.
Segment page storage
The basic principle of the segment page system is a combination of the basic segmented storage management method and the basic paging storage management method, that is, the user first The program is divided into several segments, each segment is divided into several pages, and each segment is given a segment name.
Virtual Storage
When the storage space requirement of the program is greater than the actual memory space, it makes the program difficult to run. Virtual storage technology uses actual memory space and a relatively large external storage space to form a virtual storage space that is much larger than the actual memory space. The program runs in this virtual storage space. The basis for realizing virtual storage is the principle of locality of the program, that is, during the running process, the program often reflects the characteristics of running within a certain local scope. In time, the same instruction segments and data are often run (called temporal locality). In space, instructions and data in a certain local storage space are often run (called spatial locality). Some program segments cannot be run at the same time. Or don't get run at all. Virtual storage divides the storage space required by a program into several pages or segments. The pages and segments used by the program are stored in the memory, and they are stored in external memory when they are not used temporarily. When the pages and segments in the external memory are used, they are transferred to the memory, and vice versa, they are sent to the external memory. Pages or segments loaded into memory can be scattered.
For more related knowledge, please visit the FAQ column!
The above is the detailed content of What is the purpose of storage management?. For more information, please follow other related articles on the PHP Chinese website!