Memory management, virtual memory

A multiple-choice

1, a storage management object (C).

A, facilitate the users B, improve space utilization main memory

C, user-friendly and the utilization of the main memory to improve D, increases the actual capacity of main memory

Management memory (main memory): the memory management

External memory management: document management

 

2, memory management, the following statement is correct (B)

A, which storage management, logical addresses regardless of the user program are sequential

B, address mapping hardware required to support address translation

C, segment tables and page tables are by the user according to the process established case

D, static relocation procedure may be implemented floating

B: program load process is actually changed during the logical address physical address, there are three ways charged:

(1) The absolute load mode: only suitable for single-channel program, and needs to know the memory usage.

(2) loading a relocatable manner: program environment suitable for multi-channel, when the process is completed once loaded.

(3) is loaded dynamically at runtime: loaded when the program actually runs.

C: the difference between paging and segmentation:

(1) page is a physical unit of information, paging is for discrete distribution, reduction in outer fraction memory, improve memory utilization;

         Segment is a logical unit of information, paging is a discrete distribution, meaning it contains a set of relatively complete information. The purpose is segmented in order to better meet the needs of users.

 

Size (2) is fixed and page determined by the system, is divided into the logical address of the page address and page number in two parts, the machine is implemented by hardware, there is only one system and therefore the size of a page.
         Length of the segment is not fixed, depending on the program written by the user, typically at the source program editing, according to the nature of the information to divide editing program.


(3) collated address space is one-dimensional, i.e. a single linear space; page table (page number, block number), an instruction fetch or data access requires two memory.
         Segmented address space is two-dimensional operation, when the programmer identifies an address, requiring both the segment name is given, and the need to give the segment address. Segment table (segment number, segment length, base address), instruction fetch, or data access requires two memory.

         Paragraph of page: a page is divided into several segments: address structure (segment number, the page number within the segment, the page address), required data or instruction fetch memory access times.

D: dynamically loaded at runtime, allowing movement program in memory.

 

3, dynamic relocation operation is performed in (B).

A, the compilation process B, the loading process C, modification process D, process execution

During the loading of the program is actually becomes the logical address physical address, there are three ways charged:

(1) The absolute load mode: only suitable for single-channel program, and needs to know the memory usage.

(2) loading a relocatable manner: program environment suitable for multi-channel, when the process is completed once loaded.

(3) is loaded dynamically at runtime: loaded when the program actually runs.

 

4, (A), require allocation continuity.

A, fixed storage management B, page storage management

C, the storage management segment D, page storage management section

(1) page storage management, storage management segment, segment page storage management are discrete memory allocation.

(2) continuously allocates memory management:

a, a single continuous distribution:

OS system area available to use, the user area load distribution only one user program.

b, the fixed partition allocation:

Can be loaded in memory multiprogramming, and will not interfere with each of these programs, the user space is divided into a number of fixed-size region, an operation load of each partition.

There are two division in dividing partitions: the partition size distribution of equal lack of flexibility, the flexibility of the memory allocation can be increased by using the partition allocation sizes.

c, dynamic partition allocation:

According to the actual needs of the process, whom dynamically allocated memory space

Data structures: free partition table, free partitions chain

Allocation algorithm: first fit algorithm (FF), first fit algorithm loop (NF), the best adaptation algorithm (BF), the worst adaptation algorithm (WF)

Allocation operation: memory allocation, reclaiming memory

 

5, (C) Storage Manager supports multi-channel programming, simple algorithm, but the internal debris and more.

A, stage B, the page type C, fixed partition D, your page segment of formula

Can be loaded in memory multiprogramming, and will not interfere with each of these programs, the user space is divided into a number of fixed-size region, an operation load of each partition.

There are two division in dividing partitions: the partition size distribution of equal lack of flexibility, the flexibility of the memory allocation can be increased by using the partition allocation sizes.

 

6, to improve the utilization of the main memory is primarily by (A) implementation.

A, memory allocation B, memory protection C, NAT D, memory expansion

 

7, the dynamic partition allocated in main memory partition management operations according to demand, so that (D).

A, the length of the partition is fixed

B, the number of partitions is determined

C, the number of partitions and the length are determined

D, the length of the partition is not fixed in advance, the number of partitions is uncertain

According to the actual needs of the process, whom dynamically allocated memory space

 

8, (A) storage management procedures are not suitable for multi-channel systems.

A, a single continuous distribution B, the fixed partition C, variable partition D, your page segment of formula

OS system area available to use, the user area load distribution only one user program.

Fixed partition allocation:

 

9, there is the phenomenon of the fragments (A).

A, main memory space utilization decreased B, main memory space utilization rate

C, main memory space utilization can be improved D, The storage space utilization is not affected

Space debris is too small can no longer use the.

 

10, can solve the problem of external fragmentation of storage management is (D).

A, the dynamic partition management B, Storage Management segment

C, fixed partition management D, page storage management

Pros: Because this program does not require memory allocation process or program segments and continuous data stored in memory, eliminating the external fragmentation, which can improve memory utilization to some extent, and it helps organize multi-channel program execution.

Disadvantages: easy to produce debris inside pages

 

11, the following options will not produce storage management problem is internal fragmentation (B).

A, paging storage management B, Storage Management segment

C, fixed storage management D, page storage management section

Segment is a logical unit of information, which contains a set of relatively complete information about its meaning. Segmented object is to be able to better meet the needs of users. Length of the segment is not fixed, depending on the program written by the user, typically at compile the source program, according to the nature of the information is divided by the compiler. The segment size is determined by the user, divided according to user needs, the number assigned to how much, it will not produce debris.

Debris Summary:

(1) Paging: The process is divided into several equal-sized pages, so space is the last page of the process will not be completely filled (because there is no guarantee process right size divisible size pages), when placed in memory, the last pages have given rise to internal fragmentation.

                    Because this program does not require memory allocation process or program segments and continuous data stored in memory, eliminating the external fragmentation, which can improve memory utilization to some extent, and it helps organize multi-channel program execution.

(2) subparagraph: When an old process exits memory, a smaller than its new process is assigned to the space it had occupied, because they can not fill, have given rise to some distance between the memory occupied by the next process, It is external fragmentation, but no internal fragmentation.
   
(3) a fixed partition: Since the fixed partition size, the partition is smaller than when the program will produce internal fragmentation.

(4) paragraph of page: internal fragment (generated by the page within a segment), no external fragmentation

 

12, the optimal allocation algorithm to adapt the free areas (C).

A, the address is incremented by the free area in the order registration table

B, according to the address registered in the decreasing order of a free area table

C, in ascending order according to the length of the empty area registered in the table    

D, in descending order according to the length of the empty area registered in the table

In ascending order according to the address registered in the free zone table: first fit algorithm

In ascending order according to the length of the free area is registered in the table: Best-fit algorithm

The descending order by the length registered in the empty area table: worst adaptation algorithm

 

13, a computer-based dynamic storage management, which main memory capacity of 55MB (initially empty), using the best fit algorithm, the order of allocation and deallocation of: allocating 15MB, 30MB allocation, release 15MB, dispensing 8MB, distribution 6MB, at this time the main memory size of the largest partition is idle (B).

A、7MB             B、9MB             C、10MB           D、15MB

 

 

 When 8MB of space allocation highlights the best features of adaptation algorithms: always meet the requirements, but also the smallest free partition assigned to the job, so I chose the free partition 10M, 15M abandon the free partition.

 

 

14, when the tab is not introduced into the storage management table fast, each read and write data, to be accessed (B) main memory.

A, 1 times B, 2 times C, 3 times D, 4 times

Page: work address space is one-dimensional, i.e. a single linear space; page table (page number, block number), an instruction fetch or data access to memory requires two (page tables in memory).

Staging: The job is two-dimensional address space, programmers in identifying an address, both need to give the section name, and the need to give an address within the segment. Segment table (segment number, segment length, base address), instruction fetch, or data access requires two memory.

Paragraph of page: a page is divided into several segments: address structure (segment number, the page number within the segment, the page address), required data or instruction fetch memory access times.

 

15, dynamic storage management of (D) according to operational requirements always pick one of the largest free zone.

A, B sequence allocation algorithm, the first allocation algorithm to adapt

C, the optimal allocation algorithm to adapt to D, the worst adapt allocation algorithm 

Dynamic partition allocation algorithms:

(1) first fit algorithm: free partition to address increasing order link.

Pros: Large free area retains high address section.

Cons: Low-access section will produce internal fragmentation; once for each partition is to find spare part will increase from the low-access overhead.

(2) first-fit algorithm for the cycle:

Pros: Find free partition reduce overhead; free partition evenly distributed.

Disadvantages: lack of large free area.

(3) Best adaptation algorithms: incremental capacity

Pros: Find fast (already in ascending order); to avoid the "" overqualified ""

Disadvantages: will produce internal fragmentation is difficult to meet customer needs

(4) The worst fit algorithm: decreasing capacity

Benefits: reducing the possibility of debris; look for high efficiency (already descending order)

Cons: After splitting a free block is still large, in descending order free zone, after working for some time, it is difficult to meet the needs of large operations.

 

16, a segment storage management system, the address length is 32 bits, wherein the segment number 8 bits, the maximum segment length is (C).

A、28  B           B、216B             C、224B              D、232B

Address structure:

Page: page number, bit offset

Segment: segment number, the segment address

 

17, the dither means (B).

A, when using the machine, causing screen flicker

B, just call up the page is loaded and immediately formed the frequent load \ recall phenomenon

C, the system disk problems, causing system instability phenomenon

D, due to improper allocation of main memory, main memory is not accidental cause of the phenomenon

 

18, the base virtual storage management system is (C) theoretical program.

A, dynamic B, overall

C, local D, virtual sex

Program presented in the implementation of the local law, that is, within a short period of time, the implementation of the program limited to a certain part, and correspondingly, it accesses the storage space is also limited to a certain part.

 

19, the storage management segment, (C).

A, section between absolute address certain discrete

B, the logical address must be continuous interstage

C, allocated in units of segments, each assigned a main memory area continuous

D, each segment are of equal length

 

20, virtual storage technology can not (A) is based.

A, B storage management, storage management segment C, page storage management D, page storage management section

Size of the process is still limited by the size of the partition or memory space available, can not be achieved virtual storage.

 

21, splicing the dynamic storage management techniques may be (A).

A, concentrated spare area B, increasing the capacity of main memory   

C, to reduce an access cycle D, the address translation acceleration

 

22, in a paging system environment, programmer preparation, which is a continuous address space, a tab is (D) to complete.

A, programmer B, compiled address C, user D, the system

 

23, the following statements about the virtual memory, is correct (B).

A. Virtual memory allocation can only be based on continuous technology B. Virtual memory can only be based on non-continuous distribution technology

C. Virtual storage capacity is limited only by the capacity of the external memory D. Virtual storage capacity is limited only by memory capacity

Logical memory capacity is added to the sum of external memory capacity is determined.

 

24, demand paging system page table entry, the access bit for the reference (D).

A, page allocation B, transferred to the page C, that access D, selected pages swapped out

Demand paging system adds four fields in the page table:

Status bits: whether the transferred memory

Access Bit: The number of Visits

Modified bit: whether modified, unmodified if the page does not need to be written back to external memory.

External memory address: typically the physical block number

 

25, demand paging system page table entry in the external memory address for reference when (B).

A, page allocation B, transferred to the page C, that access D, pages swapped out

External memory address to obtain the physical block number, and the program in the external memory, for use when the page is transferred.

 

26, the segment of page storage management system, the memory is equally divided into (A), the program logically divided into several modules (D).

A, block B, partition. C, para length D, segments  

 

 

27, the following (A) replacement algorithms will produce Belady phenomenon.

A, B FIFO, least recently using the C, least recently Use D, the best

 

28. Consider a paging system page table stored in memory.

(1) If the memory access cycle is 1.0 microseconds, the CPU fetches an instruction from memory or a time required operand () sec.

(2) if the establishment of a table can be stored for quick page table entry is 8, 80% by the address conversion table is completed quickly, the average memory access time of () sec. (Assuming that table fast access time can be ignored)

A、 1.0       B、 1.1       C、 1.2       D、 2.0

Second, the calculation problems

1, a paging store management system, a logical address space of the job is 4 (page size is 2048 bytes), and the pages are sequentially stored in the physical block 0,1,2,3 2,4,6,7 , the existing logical address 4865 and 10020, to convert them into physical addresses.

 

 

 Paged memory management of address translation:

When a process is to access data in a logical address, the address conversion tab means automatically effective address into a page number and the page address in two parts, the page number is compared with the length of the page table, if the page number is greater than or equal to the page table length bounds interrupt is generated, if not out of range, can be obtained by the page number block number to obtain a physical address.

2, a prior job, the segment storage management system has been established the main memory allocated to the segment table is expressed as follows.

Segment number

Section chief

Main memory starting address

0

680

1760

1

160

1000

2

200

1560

3

890

2800

Calculating a job accessing [0,550], [2,186], [1300] and [3,655] (first element of segment number in square brackets, the second element is the segment address) when absolute address.

 

 

 (1)将段号与段表长度比较,若段号大于段表长度产生越界中断。

(2)若未越界,获得该段的起始地之后,再检查段内地址是否超过了段长,若超过同样产生越界中断。

(3)若未越界,将该段的起始地址与段内地址相加,产生物理地址。

 3、在页式虚拟存储管理的计算机系统中,运行一个共有8页的作业,且作业在主存中分配到4块主存空间,作业执行时访问页面顺序为7,0,1,2,3,0,4,3,2,3,6,7,3,1,5,7,6,2,6,7。请问用FIFO和LRU调度算法时,它们的缺页中断率分别是多少?

 虚拟存储器的置换算法:

(1)最佳置换算法:

所选择的被淘汰的页面是以后永远不会被访问的页面,或者是最长时间内不会被访问的页面,采用此算法可以获得最低的缺页率,但是由于页面的访问不能预知,因而该算法是不能实现的。

(2)先进先出(FIFO)页面置换算法:

总是淘汰最先进入内存的页面。 

(3)最近最久未使用(LRU):

淘汰自上次被访问以来所经历时间最长的页面。

(4)最少使用置换算法(LFU)

(5)Clock置换算法:

将未使用过的页面换出去,循环扫描。

改进型的Clock置换算法:

不仅考虑到了页面的访问情况,而且考虑了页面置换的代价。

一类:没有被访问,没有被修改,最佳淘汰页。

二类:没有被访问,但是被修改。

三类:已经被访问,没有修改。

四类:被访问,被修改。

 

4、某操作系统采用可变分区分配存储管理方法,用户区为512K且始址为0,且初始时用户区的512K空间空闲,用户请求下列操作:

Req(300K), req(100K), release(300K), req(150K), req(30K), req(40K), req(60K), release(30K)

回答下列问题:

(1)    采用首次适应算法,空闲分区中有哪些空闲块(给出图示,并给出始址、大小)?

(2)    采用最佳适应算法,空闲分区中有哪些空闲块(给出图示,并给出始址、大小)?

Guess you like

Origin www.cnblogs.com/zhai1997/p/12043600.html