slides14 - Memory Management Flashcards

1
Q

Memory units that can be directly addressed

A
  1. main memory (multiple clock cycles)
  2. registers (1 clock cycle)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Address binding (3)

A
  • When loading a program into memory -> need to resolved all address references so they point to locations occupied by that program
  1. Compile-time: know where program would reside in memory and does not change
  2. Load time: don’t know where program would reside at compile time; addressing needs to relative
  3. Execution time: want to change memory locations of code segment at runtime; need hardware support so can be loaded and unloaded several times during execution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Logical vs Physical address spaces

A

LOGICAL ADDRESS
- aka virtual address
- generated by CPU

PHYSICAL ADDRESS
- address seen by memory

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

Memory management unit (MMU)

A

Translates logical address to physical address

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

Static loading

A
  • Load whole program at the start
  • Problems:
    1. wait for whole program to load into memory
    2. waste memory by loading unused portions of program for a given run
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Dynamic loading

A
  • Defer loading and only load when needed
  • Disadvantage:
    • loading can happen at runtime and runtimes can be affected by loading
    • loaded segments should be cached so future references can be quick and only first reference suffers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Contiguous memory allocation

A
  • Allocations for each process must be in a single contiguous block
  • As processes are created, we allocate chunks of memory for each process and deallocate once completed
  • Creates holes in memory -> external fragmentation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Methods to allocate contiguous memory

A
  1. First fit: allocate the hole that is big enough from start location and stop there (50% of N blocks will be lost to fragmentation).
  2. Best fit: allocate smallest hole that is big enough. Search entire list of free holes.
  3. Worst fit: allocate largest hole. Search entire list. Produces largest leftover hole.
  4. Next fit: variation of first fit but starts next search where previous one left off.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly