Ch. 8 - Memory Management Flashcards

1
Q

What are the 3 most common forms of locality?

A

> Temporal Locality
Spatial Locality
Branch Locality

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

Temporal Locality (Definition and Example)

A

A referenced memory location is likely to be referenced again soon after. (eg. loops)

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

Spatial Locality (Definition and Example)

A

If a memory location is referenced, it is likely that nearby locations will be accessed soon after. (eg. array traversal)

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

Branch Locality

A

Branching of code is limited to a few nearby possibilities.

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

What are the benefits of using locality of reference?

A

> Reduce the number of page faults (access the same page over and over again)
More TLB and cache hits (less likely to go to disk to get data)

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

What are some issues in sharing memory?

A

> Transparency (several processes need to co-exists, unaware of each other)
Safety (processes cannot corrupt each other or the OS)
Efficiency (low overhead needed)
Relocation (programs can run in different memory locations)

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

What are the steps a program must go through before being executed by the CPU?

A
  1. Compiling (generate object code)
  2. Linking (combine object code into executable code)
  3. Loading (copy the executable code into memory, do any necessary run-time linking with libraries)
  4. Execution (dynamic memory allocation during program execution)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Direct Placement (Memory Management Scheme)

A

Load entire user program (code, data, etc.) into the same memory location. The linker produces the same loading address for every user program.

Fastest memory management scheme

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

Overlays (Memory Management Scheme)

A

Program is organized into a tree-like structure. Root of overlay always loaded into memory while sub-trees a re loaded as needed by overlaying existing code.

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

Static Partitioning

A

Main memory is divided into a fixed number of fixed size partitions (small jobs, medium jobs, large jobs). Multiple jobs can run concurrently sharing the CPU (1 small, 1 medium, 1 large)

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

Dynamic Partitioning

A

Allow for any number of programs to be loaded into memory as long as there is enough room. Each program is allocated the exact amount of memory it needs.

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

What is an issue of using static partitioning?

A

Wasted memory if there isn’t a job to execute that can fit in each partition (internal fragmentation)

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

What is an issue with dynamic partitioning?

A

When programs finish, the space freed may be too small to run a new program (external fragmentation)

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

Internal Fragmentation

A

Waste of memory within a partition (difference between size of partition and size of process loaded)

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

External Fragmentation

A

Waste of memory between partitions (scattered non-contiguous free space).

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

Swapping

A

Move some or all of a process’ memory to disk, freeing up memory for use by the process or other processes.

17
Q

Why is swapping not desirable?

A

Moving process’ memory from memory to disk and vice versa is slow. Swapping is a necessary evil to prevent memory from becoming full.