Memory Flashcards

(70 cards)

1
Q

What does a program that has been brought from disk into memory become?

A

A process

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

Is this multi- or uni-programming? Only one process runs at a time

A

Uniprogramming

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

What was the con with uniprogramming?

A

Inefficient

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

Is this multi- or uni-programming?
Processes share hardware resources, CPU & memory

A

Multiprogramming

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

Why do we have an abstraction for memory?

A

Processes may interfere with each other
Processes can suffer from access issues

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

⭐️ What is address space an abstraction of?

A

Physical memory

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

⭐️ What’s the running program’s view of memory in the system?

A

The address space

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

⭐️ What 2 types of components does the address space consist of?

A

Static & dynamic

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

⭐️ What sort of components in the address space are code and some global variables?

A

Static

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

⭐️ What sort of components in the address space are the stack and the heap?

A

Dynamic

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

⭐️ What three main components does the address space consist of?

A

Code
Heap
Stack

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

Why won’t the code in the address space be changed during execution?

A

It’s static

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

What contains the local variables, pass parameters & return values in the address space?

A

Stack

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

What does add/push do to the stack pointer?

A

Increment it

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

What does remove (free) / pop do to the stack pointer?

A

Decrement it

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

Does the stack or the heap use LIFO?

A

Stack

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

What component of the address space contains explicitly dynamically allocated & user-managed memory?

A

Heap

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

What command should programmers use to deallocate in the heap?

A

free()

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

What does the OS use to virtualize memory?

A

Virtual addresses

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

What do we call the translation/mapping from virtual to physical addresses?

A

Adress translation/mapping

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

What are these the goals of:
- Transparency
- Protection
- Efficiency

A

Virtual memory

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

Which address does the compiler/linker assume that the process starts at in OSes using address translation?

A

0

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

Address translation aims to relocate addresses in a … way

A

transparent

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

What sort of relocation within address translation methods does this describe:

At load time, the OS adjusts the addresses in a process to reflect its position in memory
Once a memory is assigned a place in memory and starts executing it, the OS cannot move it

A

Static relocation (no HW requirement)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What are the 2 issues with static relocation in address translation?
Inflexibility Rewrite
26
What sort of relocation within address translation methods does this describe: - Two registers for each process: 1. Base register indicates the starting address 2. Bound/limit register determines the memory size - Memory-Management Unit (MMU): Translate virtual addresses to physical addresses for every memory reference
Dynamic relocation (HW supported)
27
How is each memory reference in dynamic relocation translated?
Physical address = virtual address + base
28
What are the two problems with dynamic relocation?
Internal & external fragmentation (memory inefficiency)
29
⭐️ What do we call the allocation of contiguous memory spaces to different processes?
Memory allocation
30
⭐️ What sort of memory allocation is described below: - Physical memory broken up into fixed partitions - One base register per process
Fixed partition
31
⭐️ What are the advantages of fixed partition memory allocation?
Easy to implement Fast context switch
32
⭐️ What are the problems with fixed partition memory allocation?
Internal fragmentation
33
⭐️ What sort of memory allocation is described below: Each process is assigned a memory partition when needed, with the OS maintaining a table of holes - Base register and limit register - Dynamic relocation
Variable partition
34
⭐️ Give the definition: Available memory spaces of various sizes that are scattered throughout memory
Holes
35
What's created when processes are loaded into memory & removed from memory, resulting in fragmentation?
Holes
36
⭐️ What are the advantages of variable partition memory allocation?
Flexible
37
⭐️ What are the disadvantages of variable partition memory allocation?
External fragmentation
38
When each partition has the same size, what sort of fragmentation can occur?
Internal fragmentation
39
⭐️ What do we call the allocation algorithm that allocates the first hole that's big enough in memory?
First-fit
40
⭐️ What do we call the allocation algorithm that allocates the smallest hole that is big enough in memory?
Best-fit
41
⭐️ What do we call the allocation algorithm that allocates the largest hole in memory?
Worst-fit
42
What is a solution to external fragmentation?
Compaction
43
Give the definition: Shuffling of the memory contents to place all free memory together in one large block
Compaction
44
What is the main issue with compaction?
Performance overhead - memory intensive
45
⭐️ Give the definition: The dividing of the contiguous address space into several logic segments
Segmentation
46
What sort of memory assignment does segmentation allow?
Non-contiguous
47
Give the definition: A memory management technique where a process' memory is allocated in separate, non-adjacent blocks rather than in a single continuous block
Non-contiguous memory assignment
48
What another downside to segmentation, apart from external fragmentation?
Performance overhead
49
What's a solution to the performance overhead that segmentation can cause?
Compaction - Reduces fragmentation
50
Give the definition: A fault that's occurred by the OS when an illegal or out of bounds address is detected by the hardware
Segmentation fault
51
Segmentation breaks the address space into segments based on what part of a virtual address?
Top few bits
52
How do we handle the fact that the stack grows backwards in segmentation?
Adding extra hardware support that checks which way the segment goes
53
What does 1 indicate about the way a segment grows in segmentation?
Positive direction
54
What does 0 indicate about the way a segment grows in segmentation?
Negative direction
55
Give the definition: Segments that are shared between address spaces / processes
Code sharing
56
To enable code sharing, what extra hardware support is needed in segmentation?
Protection bits
57
What do we call the bits added to a segment to indicate permissions of read, write and execute?
Protection bits
58
⭐️ What's address space an abstraction of?
Physical memory
59
⭐️ What are the 2 types of memory addresses?
Virtual memory & physical memory
60
⭐️ What hardware component makes it possible to translate virtual memory into physical memory, for every memory reference?
The MMU
61
⭐️ What are the 2 types of fragmentation?
Internal & external
62
⭐️ Segmentation is helpful in reducing...
the wasted memory
63
⭐️ Segmentation suffers from...
External fragmentation
64
⭐️ Dynamic relocation requires extra hardware support to translate virtual addresses to physical addresses (T/F)
True
65
Static relocation doesn't require extra hardware support to translate virtual addresses to physical addresses (T/F)
True
66
⭐️ Which of the following is an issue with segmentation? External fragmentation Internal fragmentation
External fragmentation; Segmentation results in different sized holes.
67
⭐️ Multiple segments need only one pair of base-bound registers (T/F)
False
68
⭐️ What are the 2 methods for allocating contiguous physical memory to a process?
Fixed partition Variable partition
69
⭐️ What's the drawback with fixed partition?
Internal fragmentation
70
⭐️ What's the drawback with variable partition?
External fragmentation