Professional Documents
Culture Documents
Copy-on-Write
Thrashing
I. Introduction
initially share the same pages in memory. If either process modifies a shared page,
only then is the page copied. It means that Copy-on-Write allows more efficient
Thrashing was introduced when a process does not have “enough” pages, the
page-fault rate is very high. It can be said that thrashing happens when a process is
II. Objectives
Copy-on-Write finds its main use in sharing the virtual memory of operating
• vfork() variation on fork() system call has parent suspend and child using copy-
– Very efficient
Pool should always have free frames for fast demand page execution
fault.
Example
resource; the resource can be shared between the copy and the original.
Copy-on-Write in summary:
are modified
overused, leading to a constant state of paging and page faults, inhibiting most
application-level processing.
collapse. The situation can continue indefinitely until either the user closes some running
How it works:
system. Active memory pages exist in both RAM and on disk. Inactive pages are
removed from the cache and written to disk when the main memory becomes full.
If processes are utilizing all main memory and need additional memory pages, a
cascade of severe cache misses known as page faults will occur, often leading to a
noticeable lag in operating system responsiveness. This process together with the futile,
repetitive page swapping that occurs are known as "thrashing". This frequently leads to
high, runaway CPU utilization that can grind the system to a halt. In modern computers,
thrashing may occur in the paging system or in the I/O communications subsystem.
workload cannot be effectively held within physical memory, then constant data
Cache Thrashing
Where main memory is accessed in a pattern that leads to multiple main memory
locations competing for the same cache lines, resulting in excessive cache misses.
TLB Thrashing
Where the translation lookaside buffer (TLB) acting as a cache for the memory
management unit (MMU) which translates virtual addresses to physical addresses is too
Heap Thrashing
Frequent garbage collection, due to failure to allocate memory for an object, due
Process Thrashing
A similar phenomenon occurs for processes: when the process working set cannot
be coscheduled – so not all interacting processes are scheduled to run at the same time –
they experience "process thrashing" due to being repeatedly scheduled and unscheduled,
Using hysteresis thresholding could help mitigate the issue. One threshold for
Directions: Choose the letter of the correct answer that each number provided.
a) Thrashing
b) Copy-on-Write
c) System Call
a) Thrashing
b) Copy-on-Write
c) System Call
3. In what implementation Copy-on-Write finds its main use in sharing the virtual
b) Vfork()
d) Thrashing
4. Has parent suspend and child using copy-on-write address space of parent.
a) Page-on-Write
b) Page-on-call Demand
c) Segmentation Pages
d) Zero-fill-on-demand pages
6. Should always have free frames for fast demand page execution.
a) Thrashing
b) Copy-on-Write
c) Pool
a) Thrashing policy
b) Copy-on-Write policy
to that page.
a) OS
b) Copy-on-Write
c) System Call
d) Virtual Memory
9. The technique used when a resource is duplicated but not modified but Modifications
10. Allows more efficient process creation as only modified pages are copied.
a) Thrashing
b) Copy-on-Write
c) System Call
a) Thrashing
b) Copy-on-Write
c) System Call
constant state of paging and page faults, inhibiting most application-level processing.
a) Copy operation.
b) Thrashing
13. This process together with the futile, repetitive page swapping that occurs are known
as what?
a) Thresholding
b) Thrashing
14. In virtual memory systems, may be caused by programs or workloads that present
a) Thresholding
b) Thrashing
a) Thresholding
16. Where main memory is accessed in a pattern that leads to multiple main memory
locations competing for the same cache lines, resulting in excessive cache misses.
a) Cache Thrashing
b) TLB Thrashing
c) Heap Thrashing
d) Process Thrashing
17. Where the translation lookaside buffer (TLB) acting as a cache for the memory
a) Cache Thrashing
b) TLB Thrashing
c) Heap Thrashing
d) Process Thrashing
18. Frequent garbage collection, due to failure to allocate memory for an object, due to
a) Cache Thrashing
b) TLB Thrashing
c) Heap Thrashing
d) Process Thrashing
19. A similar phenomenon occurs for processes: when the process working set cannot be
coscheduled, so not all interacting processes are scheduled to run at the same time.
a) Cache Thrashing
b) TLB Thrashing
c) Heap Thrashing
d) Process Thrashing
20. Possible solution that could help mitigates the issue. One threshold for paging and
a) Catharsis Thresholding
b) Trace Thresholding
c) Hysteresis Thresholding
d) Process Thresholding
Answer Key:
1. A 16. A
2. A 17. B
3. A 18. C
4. B 19. D
5. D 20. C
6. C
7. D
8. A
9. A
10. A
11. A
12. B
13. B
14. B
15. B