P3L2 Memory Management - Introduction Flashcards

1
Q

Visual Metaphor

Memory management is like …

  1. Use intelligently sized containers
    • memory ______ or segments
  2. Not all memory is needed at once
    • Tasks operate on a _______ of memory
  3. Optimized for performance
    • Reduce _____ to access state in memory –> better performance
A

Memory management is like … the toy part management system

  1. Use intelligently sized containers (equal sized containers for example help with storage)
    • memory pages or segments
  2. Not all memory is needed at once (some toys need only a few parts, or different types of parts, so don’t need to bring out all the parts all the time)
    • Tasks operate on a subset of memory
  3. Optimized for performance (if you reduce wait time for parts, you can make more toys in less time)
    • Reduce time to access state in memory –> better performance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the goals of memory management?

The range of the virtual addresses that are visible to a process can be much larger than the actual amount of physical memory behind the scenes.

In order to manage the physical memory, the operating system must be able to allocate physical memory and also arbitrate how it is being accessed.

A

The range of the virtual addresses that are visible to a process can be much larger than the actual amount of physical memory behind the scenes.

In order to manage the physical memory, the operating system must be able to allocate physical memory and also arbitrate how it is being accessed.

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

Allocation or Arbitration?

The OS should quickly be able to translate a virtual address into a physical address and validate it to verify that it is a legal access.

A

The OS should quickly be able to translate a virtual address into a physical address and validate it to verify that it is a legal access. - Arbitration

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

Allocation or Arbitration?

Operating system incorporates certain mechanisms and data structures so that it can track how memory is used.

A

Allocation

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

Allocation or Arbitration?

The operating system must be able to replace the contents in physical memory with contents from disk.

A

Allocation

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

Allocation or Arbitration?

Operating system incorporates certain mechanisms and data structures so that it can track what memory is free.

A

Allocation

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

Allocation or Arbitration?

The operating system can quickly interpret and verify a process memory access.

A

Arbitration

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

The virtual address space is subdivided into fixed-size segments called ___________.

The physical memory is divided into _____________ of the same size.

In terms of allocation, the operating system maps _________ into _____________

In this type of page-based memory management the arbitration is done via _______________.

A

The virtual address space is subdivided into fixed-size segments called pages.

The physical memory is divided into page frames of the same size.

In terms of allocation, the operating system maps pages into page frames.

In this type of page-based memory management the arbitration is done via page tables.

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

True or False?

Paging is the dominant memory management mechanism used in modern operating systems.

A

True.

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

Name two ways an OS decouples the virtual and physical memory

A
  1. Paging
  2. Segmentation

Paging is not the only way to decouple the virtual and physical memories. Another approach is segmentation, or a segment-based memory approach.

With segmentation, the allocation process doesn’t use fixed-size pages, but rather more flexibly-sized segments that can be mapped to some regions in physical memory as well as swapped in and out of physical memory.

Arbitration of accesses uses segment registers that are typically supported on modern hardware.

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

Every CPU package contains a _______________ (____).

The CPU issues virtual addresses to the ______ , and the ______ is responsible for converting these into physical addresses.

A

Every CPU package contains a memory management unit (MMU).

The CPU issues virtual addresses to the MMU, and the MMU is responsible for converting these into physical addresses.

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

Give 3 example when an MMU will signal a fault:

    1. 3.
A

If there is an issue, the MMU can generate a fault.

  1. Signal that the memory access is illegal; that is, there is an attempt to access memory that hasn’t been allocated.
  2. There are insufficient permissions to perform a particular access.
  3. The requested page is not present in memory and must be fetched from disk.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Another way that hardware supports memory management is by assigning designated _______ to help with the memory translation process.

For instance, ___________ can point to the currently active ____________ in a page-based memory system.

A

Another way that hardware supports memory management is by assigning designated registers to help with the memory translation process.

For instance, registers can point to the currently active page table in a page-based memory system.

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

Since the memory address translation happens on every memory reference, most MMU incorporate a small _________ of virtual/physical address translations.

This is a called the _____________________________.

This buffer makes the entire translation process a lot ______.

A

Since the memory address translation happens on every memory reference, most MMU incorporate a small cache of virtual/physical address translations. This is a called the translation lookaside buffer (TLB).

This buffer makes the entire translation process a lot faster.

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

The actual __________ of the physical address from the virtual address is done by the __________.

The operating system maintains _______________ which are necessary for the ____________ process; but the hardware actually performs it.

A

The actual translation of the physical address from the virtual address is done by the hardware.

The operating system maintains page tables which are necessary for the translation process; but the hardware actually performs it.

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

True or False?

Memory management is done by the operating system alone.

A

FALSE

Memory management is not done by the operating system alone. Hardware mechanisms help make memory management decisions easier, faster and more reliable.

17
Q

Name and briefly explain 4 hardware mechanisms that aid the OS in memory management

A
  1. MMU
    1. Translate virtual to physical address
    2. Faults - (no permission, bad memory location, not allocated …)
  2. Registers
    • e.g. pointer to page table
  3. Cache
    • TLB - Translation look-aside buffer
  4. Translation
    • Physical address translation done in hardware
18
Q

What is a TLB?

A

Translation lookaside buffer

A small cache of virtual/physical address translations to make memory address translations virtual <–> physical faster