Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the storage management that does not produce internal fragments in the computer?

2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail what is the storage management that does not produce internal fragments in the computer. Xiaobian thinks it is quite practical, so share it with you as a reference. I hope you can gain something after reading this article.

Storage management without internal fragmentation is: segmented storage management. In segmented storage management, the address space of a job is divided into segments, each segment defining a set of logical information. Each segment is addressed starting at 0 and using a contiguous segment of address space. The entire job address space is two-dimensional because it is divided into segments.

Storage management without internal fragmentation is: segmented storage management. Paginated storage management has internal fragmentation, segmented storage management has external fragmentation.

paginated storage management

Pagination management is the division of a process's logical address space into several equal size slices, called pages or pages, and numbering of each page, starting with 0, such as page 0, page 1, etc.

Correspondingly, the memory space is divided into several memory blocks of the same size as the page, called (physical) blocks or page frames, and they are also numbered, such as block 0 #, block 1 #, etc. When allocating memory for a process, several pages in the process are loaded into multiple physical blocks that may not be contiguous in units of blocks. As the last page of the process often does not fill a single page, unusable fragments are formed, referred to as "in-page fragments."

segmented storage management

The purpose of introducing segmented storage management is mainly to meet the requirements of users (programmers) in programming and use, some of which are difficult to meet by other storage management methods. As a result, this approach to storage management has become the basis for all storage management approaches today.

In segmented storage management, the address space of a job is divided into segments, each segment defining a set of logical information. For example, there are main program segment MAIN, subroutine segment X, data segment D, stack segment S, etc. Each segment has its own name. For simplicity, a segment number is usually substituted for a segment name, each segment is addressed from 0, and a contiguous address space is used. The length of a segment is determined by the length of the corresponding logical block, so segments vary in length. The address space of the whole job is two-dimensional because it is divided into multiple segments, that is, its logical address is composed of segment number (segment name) and intra-segment address.

The addresses in the segment address have the following structure:

In this address structure, a job is allowed to have up to 64K segments, each segment having a maximum length of 64KB. Fragmentation is supported by many compilers, which automatically generate segments based on the source program. For example, Pascal compilers can create separate sections for global variables, procedure call stacks for storing corresponding parameters and return addresses, code sections for each procedure or function, local variables for each procedure or function, and so on. Similarly, the Fortran compiler can create a separate segment for a common block or allocate a separate segment for an array. The loader loads all of these segments and assigns each segment a segment number.

The introduction of segmented storage management is mainly to meet the following series of needs of users and programmers:

1)Easy programming

Usually, users divide their jobs into logical segments, each of which is addressed from 0 and has its own name and length. Therefore, the logical address desired to be accessed is determined by the segment name (segment number) and the intra-segment offset (intra-segment address). For example, the following two instructions use segment names and intra-segment addresses:

LOAD 1,[A] |〈D〉;

STORE 1,[B] |〈C〉;

Among them, the meaning of the former instruction is to read the value in D unit in segment A into register 1; the meaning of the latter instruction is to store the contents of register 1 in C unit of segment B.

2)information sharing

When sharing programs and data, it is based on logical units of information. For example, share certain routines and functions. A page in a paging system is a physical unit (block) of information that has no complete meaning and is not easy to share; however, a segment is a logical unit of information. Thus, in order to achieve segment sharing, it is desirable that storage management be adapted to the way user program segments are organized.

3)information Protection

Information protection is also to protect the logical unit of information, so the segmented management mode can realize the function of information protection more effectively and conveniently.

4)dynamic growth

In practical applications, some segments, especially data segments, will continue to grow during use, and it is impossible to know exactly how much data segments will grow in advance. The other storage management methods mentioned above are difficult to cope with this dynamic growth situation, but the segmented storage management method can solve this problem better.

5)dynamic link

Dynamic linking means that several target segments are not linked together before the job runs. To run, first the main program corresponding to the target program into memory and start running, when the running process and need to call a certain section, only this section (target program) into memory and linked. It can be seen that dynamic links also require segments as units of management.

About "what is the storage management that does not produce internal fragments in computers" this article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.

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: 0

*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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report