In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
The continuation allocation method refers to the allocation of a continuous memory space to a user program. It mainly includes single continuous dispatch, fixed resolution assignment and static resolution assignment.
Single continuous continued dispatch
Under this method, the memory is divided into the piecemeal area and the user area, and the fragmented area is only provided for the operation, usually in the low address part; the user area is the memory space provided for the user except the fragmented area. This method does not need to stop memory maintenance.
The advantage of this method is that it is complex, free of internal fragments, can be used to cover up, and does not require rated technical support. The defect is that it can only be used in the operation bits and pieces of single user and single obligation, there are external fragments, and the application rate of memory is very low.
Fixed resolution mismatch
Fixed resolution matching is the most complex method of multi-program storage management, which divides the user memory space into several fixed-size areas, and each partition is loaded with only one homework. When there is a leisure zone, you can choose the appropriate size of homework from the external reserve homework queue to load it, such as reincarnation.
Figure 3-4 two methods of fixed resolution matching
Fixed resolution there are two different ways to partition, as shown in figure 3-4.
Equal partition size: a place where a computer is used to control multiple opposing objects, lacking sensitivity.
Partitions vary in size: divided into multiple smaller partitions, excessive medium partitions, and a large number of large partitions.
In order to facilitate memory allocation, partitions are lined up by size on weekdays, and a partition clarification table is set up for them, with each entry containing the source address, size, and shape of each partition (whether it can be allocated), as shown in figure 3-5 (a). When a valid user program is about to load, the table is retrieved to find the appropriate partition to dispatch and set its form to "dispatched"; if no suitable partition is found, memory is refused to be allocated to the user program. The allocation of storage space is shown in figure 3-5 (b).
There are two achievements in this partitioning method: one is that the program can be too big to fit into any partition, and then the user has to use the masking technique to use the memory space; second, the main memory application rate is low, when the program is smaller than the fixed partition size, it also takes up a good memory partition space, so that there is space waste outside the partition, which is called external debris.
Fixed partition is the most complex storage allocation that can be used for multi-programming, without internal fragmentation, but it can not complete multiple processes to share a main memory area, so the application rate of storage space is low. Fixed discrimination is rarely used in today's common operational bits and pieces, but it still plays a certain role in some mastery bits and pieces used to master multiple opposing objects.
Figure 3-5 fixed partition clarifies table and memory allocation status
Static resolution matching
Static resolution matching, also known as variable resolution matching, is a static partition method of external memory. This partitioning method does not divide the memory afterwards, but statically sets up the partition according to the size of the process when the process is loaded into memory, and makes the size of the partition exactly to meet the needs of the process. Therefore, the size and number of piecemeal flat partitions are variable.
Figure 3-6 static Partition
As shown in figure 3-6, there is 64MB memory space in bits and pieces, with medium and low 8MB fixed allocation to operation bits and pieces, and other available memory for users. Start the first three processes of ancient loading, and after they are identified and allocated to the required space, only 4MB is left in memory, and process 4 cannot be loaded. At some point, there is no proper process in memory, CPU presents leisure, and the operation is piecemeal to swap out process 2 and into process 4. Because procedure 4 is smaller than procedure 2, a block of 6MB memory occurs in main memory. After that, CPU presents leisure, and the main memory can not contain process 2, so the operation is piecemeal to swap out process 1 and into process 2.
Static partitions are good at the beginning of the dispatch, but then lead to a lot of small blocks of memory in memory. As time goes on, more and more fragments will occur in memory (the original 4MB and 6MB at both ends in figure 3-6, and as the process swaps in / out, it is likely to present more and smaller blocks of memory), and the application rate of memory decreases. These small blocks of memory are called internal fragments, which means that the storage space outside all partitions will result in more and more fragments, which is exactly the same as the external fragments in the fixed partition. Controlling internal debris can be dealt with by Compaction, which is to operate bits and pieces to stop moving and rectifying the process from time to time. However, this requires static repositioning of the memory support, and is absolutely time-consuming. The compact process is similar in practice to the disk consolidation program in Windows bits and pieces, except that the latter is compact for external memory space.
When the process loads or swaps into the main memory, if there are multiple leisure blocks large enough in memory, the operation bits and pieces must be sure which memory block is allocated to the process. This is the allocation strategy of static partitions. Consider the following algorithms:
Initial adaptation (First Fit) algorithm: leisure partition is linked by an increasing number of addresses. Search the order when allocating memory to find the first leisure partition that meets the request.
Optimal adaptation (Best Fit) algorithm: the leisure partition is increased by capacity to form a partition chain, and the first leisure partition that can meet the request is found.
Worst-case adaptation (Worst Fit) algorithm: also known as maximum adaptation (Largest Fit) algorithm, leisure partition with capacity incremental successive links. Find the first leisure section that can meet your request, that is, select the largest partition.
Proximity adaptation (Next Fit) algorithm: also known as reincarnation first adaptation algorithm, evolved from the first adaptation algorithm. The difference is that when allocating memory, the search continues from the position where the previous search was completed.
Among these methods, the first adaptation algorithm is not only the most complex, but also the best and fastest on weekdays. In the final version of UNIX, the initial adaptation algorithm was used to allocate memory space for the process, which was done using array data construction (rather than linked lists). However, the initial adaptation algorithm will make the low address of memory present many small leisure partitions, and each time you assign a search, you have to go through these partitions, thus adding the cost of finding.
The proximity adaptation algorithm attempts to deal with this result, but in practice, it often leads to the allocation of space at the end of the memory (because in a scan, when the back of the memory is partially used and then released, it does not intervene in the allocation), breaking into small fragments. It usually has worse consequences than the initial adaptation algorithm.
The best adaptation algorithm is called "the best", but the function is very poor on weekdays, and because each optimal dispatch will leave very small blocks of memory that are difficult to apply, it will produce the most internal fragments.
The worst adaptation algorithm, in contrast to the best adaptation algorithm, chooses the largest available block, which seems to be the least prone to fragmentation, but delimiting the largest extended memory will quickly lead to no large blocks of memory available, so the function is also very poor.
Kunth and Shore identify the first three methods to imitate the application of memory space, and the consequences are as follows:
The initial adaptation algorithm can have better consequences than the optimal adaptation method, and both of them must have better consequences than the maximum adaptation method. In addition, it is noted that when the algorithm is completed, the optimal adaptation method and the maximum adaptation method need to stop sorting or traversing the available blocks in the assignment operation, while the first adaptation method and the near adaptation method only need complex search; in the takeover operation, when the receiving block is adjacent to the original leisure block (there are three adjacent conditions, comparatively complex), these blocks need to be merged. When the algorithm is complete, use the array or linked list to stop the governance. In addition to the application rate of memory, the algorithm cost here is also a factor in the operation of piecemeal design requirements.
Table 3-1 comparison of three memory partition governance methods
Outside of the number of lessons
Inside the fragment
Fragment hardware support is available empty
Inter-treatment and crushing
Film method to deal with empty
Lack of progress between
Karma number of one-way continuation
Dispatch 1 has unbounded address memory, out of bounds
Introspection institution-cover up communication multi-channel fixation
Continuation of assignment
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 263
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.