Chapter 3 Flashcards

(61 cards)

1
Q

Before a job is loaded into memory, it is divided into parts called _____ that will be loaded into memory locations called _____________

A

pages, page frames.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

_____________ is based on the concept of dividing each incoming job into pages of equal size.

A

Paged memory allocation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The sections of a disk are called ______ (or sometimes blocks), and the sections of main memory are called __________.

A

sectors, page frames

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Before executing a program, the Memory Manager prepares it by:

A
  1. Determining the number of pages in the program
  2. Locating enough empty page frames in main memory
  3. Loading all of the program’s pages into them
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Primary advantage of storing programs in noncontiguous location (paged memory allocation):

A

The main memory is used more efficiently because an empty page frame can be used by any page of any job.

In addition, the compaction scheme used for relocatable partitions is eliminated because there is no external fragmentation between page frames (and no internal fragmentation in most pages).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Disadvantage of storing programs in noncontiguous location (paged memory allocation):

A

A job’s pages can be located anywhere in main memory, the Memory Manager now needs a mechanism to keep track of them—and that means enlarging the size and complexity of the operating system software, which increases overhead.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What tables does the Memory Manager use to keep track of jobs, pages, and memory locations in paged memory allocation?

A
  • Job Table
  • Page Map Table
  • Memory Map Table
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Job Table contains two values for each active job:

A
  • size of the job
  • the memory allocation where its page map table is stored
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is displacement or offset?

A

The factor used to locate that byte within its page frame. It is a relative factor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Contains two values for each active job: the size of the job (shown on the left) and the memory location where its Page Map Table is stored (on the right)

A

Job Table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Contains the vital information for each page—the page number and its corresponding page frame memory address.

A

Page Map Table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Has one entry for each page frame listing its location and free/busy status.

A

Memory Map Table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Formula for finding the address of a given program instruction:

A

The byte number is divided by the page size, keeping the remainder as an integer. The resulting quotient is the page number, and the remainder is the displacement within that page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Formula for finding the exact location in memory:

A

ADDR_PAGE_FRAME = PAGE_FRAME_NUM * PAGE_SIZE

INSTR_ADDR_IN_MEM = ADDR_PAGE_FRAME + DISPL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Every time an instruction is executed, or a data value is used, the operating system (or the hardware) must translate the job space address, which is relative, into its physical address, which is absolute.

This is called resolving the address, also called:

A

address resolution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Advantages and disadvantages of paging scheme:

A

Advantages:
- it allows jobs to be allocated in noncontiguous memory locations so that memory is used more efficiently
- more jobs can fit in the main memory

Disadvantages:
- overhead is increased
- internal fragmentation is still a problem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

The concept of loading only a part of the program into memory for processing

A

Demand paging

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

It was the first widely used scheme that removed the restriction of having the entire job in memory from the beginning to the end of its processing

A

Demand paging

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

One of the most important innovations of demand paging was that it made ____________ feasible

A

virtual memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

The key to the successful implementation of demand paging is the use of a ____________________________

A

high-speed direct access storage device (such as hard drives or flash memory) that can work directly with the CPU

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

It determines whether there are empty page frames in memory so the requested page can be immediately copied from secondary storage.

If all page frames are busy, the ____________ must decide which page will be swapped out. Then the swap is made

A

page fault handler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

When there is an excessive amount of page swapping between main memory and secondary storage, the operation becomes inefficient. This phenomenon
is called ________

A

thrashing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

A failure to find a page in memory is often called a __________

A

page fault

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

the policy that selects the page to be removed

A

page replacement policy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
two page replacement policy
- first-in first-out (FIFO) policy - least recently used (LRU) policy
26
based on the theory that the best page to remove is the one that has been in memory the longest
first-in first-out (FIFO) policy
27
chooses the page least recently accessed to be swapped out
least recently used (LRU) policy
28
an unusual circumstance through which adding more page frames causes an increase in page interrupts when using a FIFO page replacement policy
FIFO anomaly
29
A variation of the LRU page replacement algorithm
clock page replacement policy
30
the clock page replacement policy is paced according to the:
computer’s clock cycle
31
A second variation of LRU uses an ________________________ to track the usage of each page currently in memory
8-bit reference byte and a bit-shifting technique
32
Page Map Table for demand paging included three bits:
- status bit - referenced bit - modified bit
33
the set of pages residing in memory that can be accessed directly without incurring a page fault
working set
34
meaning that during any phase of its execution the program references only a small fraction of its pages
locality of reference
35
each job is divided into several segments of different sizes, one for each module that contains pieces that perform related functions
segmented memory allocation
36
segment map table contains:
- segment numbers - their lengths - access rights - status - its location in memory
37
The Memory Manager needs to keep track of the segments in memory. This is done with three tables combining aspects of both dynamic partitions and demand paging memory management:
* The Job Table lists every job being processed (one for the whole system). * The Segment Map Table lists details about each segment (one for each job). * The Memory Map Table monitors the allocation of main memory (one for the whole system).
38
The Segment Map Table functions the same way as a Page Map Table but manages _________ instead of pages.
segments
39
It is a combination of segmentation and demand paging, and it offers the logical benefits of segmentation, as well as the physical benefits of paging.
segmented/demand paged memory allocation
40
segmented/demand paged memory allocation requires four tables:
* The Job Table lists every job in process (one for the whole system). * The Segment Map Table lists details about each segment (one for each job). * The Page Map Table lists details about every page (one for each segment). * The Memory Map Table monitors the allocation of the page frames in main memory (one for the whole system)
41
major disadvantages of segmented/demand paged memory allocation
the overhead required for the extra tables and the time required to reference the segment table and the page table
42
a name given to several registers that are allocated to each job that is active
Associative memory
43
programmers started dividing their programs into sections that resembled working sets, really segments, originally called roll in/roll out and now called ________
overlays
44
based on the idea that the system can use a small amount of expensive high speed memory to make a large amount of slower, less-expensive memory work faster than main memory.
Caching
45
intermediate memory unit
cache memory
46
A typical microprocessor has two levels of caches:
Level 1 (L1) and Level 2 (L2)
47
When designing cache memory, one must take into consideration the following four factors:
- cache size - block size - block replacement algorithm - rewrite policy
48
used to determine the performance of cache memory and represents the percentage of total memory requests that are found in the cache
hit ratio (h)
49
hit ratio formula:
HitRatio = (number of requests found in the cache / total number of requests) * 100
50
Another way to measure the efficiency of a system with cache memory, assuming that the system always checks the cache first, is to compute the:
average memory access time
51
Difference of paging and segmentation
pages are physical units that are invisible to the user’s program and consist of fixed sizes; segments are logical units that are visible to the user’s program and consist of variable sizes.
52
Segmented/Demand Paged Memory Allocation Three-dimensional addressing scheme:
SEGMENT_NUMBER & PAGE_NUMBER & DISPLACEMENT
53
Segmented Memory Allocation two-dimensional addressing scheme:
SEGMENT_NUMBER & DISPLACEMENT
54
demand paging tables are basically the same as for paged memory allocation but with the addition of three new fields for each page in the PMT:
- to determine if the page being requested is already in memory (status bit) - to determine if the page contents have been modified (modified bit) - to determine if the page has been referenced recently (referenced bit)
55
Advantage and disadvantage of demand paging:
Advantage: - job is no longer constrained by the size of physical memory and it introduced the concept of virtual memory - utilized memory more efficiently because the sections of a job that were used seldom or not at all weren’t loaded into memory unless they were specifically requested Disadvantage: - increased overhead caused by the tables and the page interrupts
56
To access a location in memory, when using either paged or segmented memory management, the address is composed of two values:
- The page or segment number - Displacement
57
The use of virtual memory requires cooperation between the:
memory manager and the processor hardware
58
Describe how the function of the Page Map Table differs in paged vs. segmented/demand paging memory allocation.
In paged memory allocation, the Page Map Table (PMT) is always present in memory and directly maps each logical page of a job to its corresponding page frame in main memory. Every memory reference uses the PMT for address translation. In segmented/demand paging, the PMT is tied to individual segments and is loaded into memory only when pages from that segment are needed. The Segment Map Table (SMT) is first used to locate the segment’s PMT, and then the PMT maps the requested page to its frame. Or The PMT in paged memory allocation correlates each of the job’s pages with its page frame number. The PMT in segmented/demand paged memory allocation is similar to paged memory allocation, but also includes the status (whether in memory or not), modified (whether been modified or not), and reference bits (whether been recently referenced)
59
Describe how the OS detects thrashing. Once thrashing is detected, explain what the OS can do to stop it
It detects thrashing when the operation becomes inefficient, by an excessive amount of page swapping between main memory and secondary storage. To stop it, the page replacement policy comes into play. FIFO and LRU
60
Compare and contrast internal fragmentation and external fragmentation. Explain the circumstances where one might be preferred over the other.
Internal fragmentation occurs within allocated memory blocks and is common in fixed-sized allocation systems, while external fragmentation occurs between allocated memory blocks and is common in variable-sized allocation systems. Internal fragmentation is preferred in predictable environments, while external fragmentation is preferred in environments with unpredictable memory usage patterns.
61
One innovation that improved the performance of demand paging schemes was the concept of the _________
working set