Chapter 3 Flashcards

1
Q

What is Paged Memory Allocation?

A

The concept of dividing jobs into units of equal size and each unit is called a page.

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

What is a page frame in Paged Memory Allocation?

A

A section of main memory that is the exact same size as the page chosen.

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

Outline the role of Memory Manager in a Paged Memory Allocation.

A

Before executing a program, a basic Memory Manager prepares it by:
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 those frames

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

What are the advantages of Paged Memory Allocation?

A
  1. The pages do not have to be loaded in adjacent memory blocks
  2. Because of storing programs non-contiguously main memory is used more efficiently because an empty page frame can be used by any page of any job.
  3. There is no external fragmentation between page frames
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the disadvantages of Paged Memory Allocation?

A
  1. Overhead is increased
  2. Internal Fragmentation is still a problem
  3. Entire job is loaded into memory.
  4. The key to success of this scheme is the size of the page
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does the Memory Manager keep track of jobs’ pages?

A

Memory Manager uses tables to keep track of them:
1. Job Table
2. Page Map Table
3. Memory Map Table

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

Outline what the Job Table stores in Paged Memory Allocation?

A
  1. Contains two values for each active job: the
    size of the job and the memory location where its Page Map Table is stored
  2. The Job Table is a dynamic list that grows as jobs are loaded into the system and shrinks, as they are later completed.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Outline what the Page Map Table stores in Paged Memory Allocation?

A

Contains the vital information for each page:
1. The page number and its corresponding memory address of the page frame

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

Outline what the Memory Map Table stores in Paged Memory Allocation?

A

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

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

What is displacement in Paged Memory Allocation?

A

How far away a certain byte is from the beginning of its page frame. The operating system can access the correct bytes by using its relative position from the beginning of its page frame.

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

What is the algorithm to calculate the
page and displacement ?

A

BYTE_NUMBER_TO_BE_LOCATED / PAGE_SIZE = PAGE_NUMBER

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

Outline the steps of address resolution to find the exact memory location in Paged Memory Allocation?

A
  1. Do arithmetic computation to determine page number and displacement.
  2. Refer to PMT and find out which page frame contains page calculated
  3. Get the address of the beginning of the page frame
  4. Add displacement to starting address of page frame identified
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is Demand Paging Memory Allocation?

A

With demand paging, jobs are still divided into equally-sized pages that initially reside in secondary storage. When the job begins to run, its pages are brought into memory only as they are needed, and if they’re never needed, they’re never loaded.

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

Outline the role of Memory Manager in Demand Paging Memory Allocation

A

Before executing a program, a basic Memory Manager prepares it by:
1. Determining the pages needed in memory to execute program
2. Locating enough empty page frames in main memory, swapping if needed.
3. Updating the three tables after swaps

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

What are the advantages of Demand Paging Memory Allocation?

A
  1. The demand paging scheme allows the user to run jobs with less main memory than is required.
  2. Quick data retrieval between secondary storage and main memory because of DASDs (direct access storage devices)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the disadvantages of Demand Paging Memory Allocation?

A
  1. Thrashing
  2. Scheme is most efficient when programmers are aware of the page size used by their operating system and are careful to design their programs to keep page faults to a minimum
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What three new fields are added to the PMT in Demand Paging Memory Allocation? Detail their usage.

A
  1. Status field - to determine if the page being requested is already in memory
  2. Modified field - to determine if the page contents have been modified while in memory
  3. Referenced field - to determine if the page has been referenced most recently
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How does the three added field in PMT benefit Demand Paging Memory Allocation?

A
  1. Status field - spares the system time to bring page from secondary storage as a table is quicker to scan.
  2. Modified field - used to save time when pages are removed from main memory and returned to secondary storage. If the contents of the page haven’t been modified, then the page doesn’t need to be rewritten to secondary storage.
  3. Reference Field - used to determine which pages show the most processing activity and which are relatively inactive. This information is used by several page-swapping policy schemes to determine which pages should remain in main memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is swapping in Demand Paging Memory Allocation?

A

Moving in a new page if no empty page frames are available. One of the resident pages must be swapped back into secondary storage.

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

What is a page fault in Demand Paging Memory Allocation?

A

A failure to find a page in memory

21
Q

What operating system software handles page faults? Detail how it handles this issue.

A

The page fault handler determines whether there are empty page frames in memory so that the requested page can be immediately copied from secondary storage. If all page frames are busy, then the page fault handler must decide which page will be swapped out.

22
Q

Define thrashing in Demand Paging Memory Allocation.

A

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

23
Q

Describe the FIFO in terms of page replacement.

A

The first-in first-out (FIFO) policy is based on the assumption
that the best page to remove is the one that has been in memory the longest.
This algorithm uses only the modified and status bits when swapping pages.

24
Q

Describe the LRU in terms of page replacement.

A

The least recently used (LRU) policy chooses the page least recently accessed to be swapped out.
It chooses pages in PMT with modified and referenced bits of 0.

25
Q

What is the formula for calculating failure rate caused by page interrupts?

A

Failure-Rate = Number_of_Interrupts / Page_Requests_Made

26
Q

Clock Replacement Variation is a page replacement concept based on LRU. Describe.

A

It is implemented with a circular queue (which contains the page number and its reference bit) and uses a pointer to step through the reference bits of the active pages, simulating a clockwise motion.
If the bit is one (indicating that it was recently referenced), the bit is reset to zero and the bit for the next page is checked. If the reference bit is zero (indicating that the page has not recently been referenced), that page is targeted for removal.

27
Q

Another LRU variation uses an 8-bit reference byte and a bit-shifting technique to track the usage of each page currently in memory. What variation is this and describe?

A

The Bit Shifting Variation references the left most bit as 1 when it is first copied to memory. At specific intervals:
1. The Memory Manager shifts every page’s reference bytes to the right by one bit, dropping the rightmost bit
2. The left most bit is set to 1 if referenced, 0 if not referenced.
3. Selects the page with the smallest value in its reference byte when a page fault occurs.

28
Q

What is a working set in paging?

A

The collection of pages residing in memory that can be accessed directly without incurring a page fault.

29
Q

What is locality of reference?

A

During any phase of a program’s execution, the program references only a small fraction of its pages.

30
Q

What is the concept of Segmented Memory Allocation?

A

Each job is divided into several segments of different sizes, one
for each module that contains pieces that perform related functions. Segmented memory allocation was designed to reduce page faults that resulted from having a segment’s loop split over two or more pages.

The final important aspect is that memory is not divided into page frames, instead memory is allocated in a dynamic manner.

31
Q

What is the important distinction between a page and a segment?

A

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.

32
Q

Outline the role of Memory Manager in Segmented Memory Allocation.

A

The Memory Manager needs to keep track of the segments in memory through the same three tables:
* 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). It contains the segment numbers, their lengths, access rights, status, and (when each is loaded into memory) its location in memory.
* The Memory Map Table monitors the allocation of main memory (one for the whole system)

33
Q

What are the advantages of Segmented Memory Allocation?

A
  1. The segments don’t need to be stored contiguously in memory.
  2. Reduce page faults that occurred of looping over two or more pages
34
Q

What are the disadvantages of Segmented Memory Allocation?

A
  1. Since memory is partitioned dynamically, external fragmentation returns
  2. Recompaction of available memory is necessary from time to time
35
Q

What is the concept of Segmented/ Demand Paged Memory Allocation?

A
  1. It is a combination of segmentation and demand paging
  2. Subdivides segments into pages of fixed equal length
36
Q

How is an address accessed in Segmented/ Demand Paged Memory Allocation?

A

The system locates the address, which is composed of three entries:
1. The segment number
2. The page number with that segment
3. The displacement within that page

37
Q

What are the advantages of Segmented/Demand Paged Memory Allocation?

A
  1. Offers the logical benefits of segmentation, as well as the physical benefits of paging
38
Q

What are the disadvantages of Segmented/Demand Paged Memory Allocation?

A
  1. The overhead that is required to manage the tables
  2. The time required to reference tables
39
Q

What is associative memory’s usage in Segmented/Demand Paged Memory Allocation?

A
  1. Used to minimize the number of references
  2. Has several registers allocated to each job and they associate several segment and page numbers belonging to the job being processed in RAM.
  3. Stores the information related to the most-recently-used pages
  4. Abandons the need to search through PMT and SMT unless search fails
40
Q

What is virtual memory and how can it be implemented?

A
  1. It is the capability of moving pages at will between main memory and secondary storage.
  2. It requires cooperation between the Memory Manager and the processor hardware
  3. Works well in a multiprogramming environment
  4. Virtual memory can be implemented with both paging and segmentation with each having it pros and cons.
41
Q

Segmentation allows users to share program code. How is this accomplished?

A

The shared segment contains:
1. An area where unchangeable code (called reentrant code) is stored
2. Several data areas, one for each user

42
Q

What is the advantages of virtual memory?

A
  1. A job’s size is no longer restricted to the size of main memory
  2. Memory is used more efficiently because only needed jobs are stored
  3. It allows an unlimited amount of multiprogramming,
  4. It facilitates dynamic linking of program segments
43
Q

What is the disadvantages of virtual memory?

A
  1. Increased processor hardware costs
  2. Increased overhead for handling paging interrupts
  3. Increased software complexity to prevent thrashing
44
Q

What is cache memory?

A
  1. The concept of using a small, fast, and expensive memory to supplement the workings of main memory.
  2. The purpose of cache memory is to keep handy the most recently
    accessed data and instructions so that the CPU can access them repeatedly without wasting time.
45
Q

How is cache memory implemented?

A
  1. Cache memory is divided into blocks of equal size called slots
  2. When the CPU first requests an instruction or data from a location in main memory, the requested instruction and several others around it are transferred from main memory to cache memory slots.
  3. The slot also contains a label that indicates the main memory address from which the block was copied
  4. When the CPU requests additional information from that location in main memory, cache memory is accessed first; and if the contents of one of the labels in a slot matches the address requested, then access to main memory is not required.
46
Q

What are design considerations for cache memory?

A
  1. Cache size
  2. Block size
  3. Block replacement algorithm
  4. Rewrite policy
47
Q

What is the formula for cache hit ratio?

A

(number of requests found in the cache / total number of requests) * 100

48
Q

Another cache efficiency formula; the memory access time, has a formula of:

A

Avg_Mem_AccTime = Avg_Cache_AccessTime + (1- HitRatio) * Avg_MainMem_AccTime