Thrashing(12) Flashcards

1
Q

Thrashing definition

A

occurs when processes do not have enough assigned memory page frames and the page fault rate is really high. Leads to low CPU utilization since the OS spends most time swapping pages between main and secondary storage

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

Relationship between degree of multi-programming vs CPU utilization

A

more multi-programming = more processes OS has scheduled to run = more time spent switching of of one process to accommodate another process

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

When does thrashing occur

A

lack of memory

over-commited memory

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

How to prevent thrashing

A
  1. ) local or priority page replacement

2. ) Dynamically allocate every process as many page frames as it needs - thrashing will not occur

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

Explain how local or priority page replacement can be used to prevent thrashing

A

Page frame allocation only occurs for a specific process so if one process starts thrashing it will not affect other processes currently scheduled to run

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

Issue with using local or priority page replacement to prevent thrashing

A

Doesnt stop N processes from thrashing independently at the same time

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

Explain temporal and spatial locality

A

for any given process only a few memory pages of the process are used during a small space of time and these pages tend to be close together in terms of memory address locations

Temporal - given location just referenced will likely be referenced again in near future
Spatial: if location was just referenced, nearby location swill likely be referenced

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

Working set definition

A

Its implied that memory references for a process tend to be grouped where groups of pages accessed along a given time slice are called a working set. Also defined minimum number of pages needed for a process to behave well.

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

Relationship between working set size, memory space and process performance

A

If working set size for each process is sufficiently less that the main mem size then good process performance else process could potentially thrash

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

Why does locality often occur

A

programs use loops that tend to reference arrays or other data structures by indices.

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

Sequential locality

A

special case of spatial locality - occurs when relevant data elements are arranged and accessed linearly

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

Equidistant locality

A

More general case
occurs when the linear traversal is over a longer area of adjacent data structures with identical structure and size accessing corresponding elements of the structure rather than each structure itself

e.g. matrix represented as sequential matrix of rows and the requirement is to access a single column of that matrix

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

How do working sets make us of logicality

A

OS only needs to keep recently referenced pages in memory

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

How does the working set model perform implicit load control

A

in many operating systems the size of the working set is changed dynamically as the memory demands of the process changes

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

how is the working set for each process estimated

A

0 is the start time of the working set, w is the size of the working set measured in the number of references. - process can only start if its been allocated w frames
assumes local replacement
also assumes that this method can keep track of working set size of each process and dynamically reallocated frames according to changing process demands

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

Low temporal and spatial locality is indicative of what?

A

more pages being referenced by the process - if memory pages referenced are not close to arch other in time of reference of space then usually it indicated ta more computationally large and complex process that requires many pages to execute.
Requires a larger working set

17
Q

There is a risk of what if the working set it not in memory

A

Thrashing