chapter 7 Flashcards

1
Q

fundamental strategies used in MM

A

1- placement strategy
2- fetch strategy
3- replacement strategy

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

bitmap / bit vector

A

a mem divided into units of same size. a bitmap represent whether a segment of mem is free 0 or allocated 1.

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

linked list for mem management

A

the linked list is stored in the free mem itself

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

1- placement strategy: list-based (used within a process)

A

these strategies focus on how holes in the list, which represent free mem, are sorted and utilised during mem allcocation. Hole lists are sorted differently:
- first fit: sorting by mem @, first large enough hole is chosen
- rotating first fit / next fit: sorting by mem @, similar to first fir by the search starts from the last allocated hole
- best fit: sorting by hole size, smallest hole first
- worst fit: sorting by hole size, largest hole first

problem with this strategy is fragmentation

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

1- placement strategy: buddy system (used by the OS)

A

allocates mem by splitting mem into partitions of size that are 2^n. when a mem request is made, system attempts to find smallest available partition (best fit), if the partition is too large, it gets split into 2 smaller buddies, it keeps splitting until an appropriate partition size is obtained.

if 2 buddies are free, they could be merged back

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

external fragmentation

A

occurs outside the allocated mem areas, typically happens with list-based strategies (best fit, first fit) and also with buddy systems.

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

internal fragmentation

A

occurs within the allocated mem areas, typically happens when more mem is allocated than whats needed, leading to wasted space inside the allocated block

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

swapping

A

addresses within a process are statically bound, they can only be loaded in the same place in main mem from where they were swapped out.

  1. solution: static partitioning of the main mem. main mem is split into partitions where each process run in one partition. processes swapped back in should be placed in the same partition they were in before
  2. solution: program relocation.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

segmentation

A

mapping logical @ to physical @ space. size of segments is variable. segmentation allows different segments of a program, such as data, code, stack to be placed in different parts of physical mem

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

paging

A

organising logical @ space

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

compacting

A

is shen segments of mem are moved closed together to close gaps

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

Page table

A

It contains a presence bit (valid bit). If its = 1, then the page is present in mem. If it is 0, page isn’t in mem, triggering a page fault.

A page fault is triggered when a program tried to access a page that’s not loaded in physical mem.

Inverted page table has a single table for the entire system. Each entry in this table corresponds to a physical page frame and contains a PID and logical @

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

What happens when a page fault occur?

A

1- a trap is triggered alerting the OS that the required page isn’t in mem
2- the OS then loads the missing page from secondary mem into physical mem
3- once the page is loaded, the mem access that triggered the page fault is called again

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

Translation lookalike buffer TLB

A

Is a speciliased hardware cache, it stores recent translations of virtual @ to physical ones, allowing for faster lookups. When there is a TLB hit, meaning the required page info is found in TLB, no additional mem access are necessary. When there is context switches, TLB content must be updated which is known by TLB flush. If a page is accessed that’s not in TLB, the page access info is entered in TLB.

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

Absolute, static and dynamic linking

A

Absolute linking: addresses are fixed at compile time, this means that the program can only run correctly if it is loaded at a specific memory location.
Static linking: during the loading or starting of the program, addresses are relocated, this allows the program to be loaded into different memory locations.
Dynamic linking : the code accesses generally operands indirectly, this allows the program to be moved in memory at any time.

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

Segmented paging

A

Is a combination of paging and segmentation. The idea is to use segments that are divided into pages.
- logical @ has segment number, page number and offset within the page
- segment table: each entry in this table points to a page table. segment number from logical @ is used to find the page table.
- page table: once the correct page table is found, the page number is used to find the entry in the page table which has the number of the page frame.

17
Q

Multilevel paging

A

Logical address is broken down into multiple parts corresponding to different levels of the page tables. Base Register points to the first level page table, the first part in the logical address will help us find the entry in this page table, once it is found it will direct us to the second level page table, and so on and so forth.

Each level of the page tables have a presence bit, allowing tables to be swapped out or created on demand.