Search the courses, subjects, tracks, games and features, or jump straight to a page.
Learn it your way
A short class with Sarah and her students. The other ways are under More.
Sign up free to listen. Transcripts are free to read.
Today, we're discussing thrashing. Who can tell me what they think thrashing might mean in terms of computer memory?
I think it might be when the computer is working really hard, like it's struggling to keep up.
Exactly! Thrashing happens when a process is trying to use more memory than is physically available. This can cause a lot of overhead in terms of page swapping.
So it’s about swapping pages in and out too much?
Yes! When this happens, the system spends more time managing memory than executing tasks. We call this excessive swapping.
What’s a 'working set' mentioned in this context?
'Working set' refers to the set of pages currently being used by a process. If that set cannot fit in memory, thrashing occurs.
How do we fix thrashing then?
Great question! Solutions include increasing physical memory, suspending some processes, or improving the locality of reference within the code. Let's keep these in mind!
Now that we understand what thrashing is, let’s discuss how to handle it. What might be one way we can reduce thrashing?
Maybe we could give more memory to the programs that need it?
Yes! Increasing physical memory allocation can help accommodate a larger working set and can alleviate thrashing.
What about just stopping the program that’s causing thrashing?
That’s another viable strategy. We can suspend that process to allow other programs to use memory more efficiently.
Are there better ways to write programs so they use memory more effectively?
Definitely! Improving the algorithm’s efficiency, enhancing locality, and minimizing the working set can all help reduce memory needs.
So it’s about managing both memory and processes?
Correct! Effective memory management is crucial for maintaining performance during high load situations.
Lastly, why is it so important to avoid thrashing? What impact does it have?
If the system is busy swapping pages, it can be really slow.
Right! The more time spent on swapping pages, the less time a CPU has to execute instructions, leading to poor system performance.
So does that mean users will experience lag?
Exactly. High lag and unresponsiveness are direct outcomes of thrashing.
Can we measure how bad thrashing is?
We can observe metrics like CPU usage, disk I/O operations, and overall task execution time to gauge thrashing severity.
I think I understand now how detrimental it is.
Great! Understanding the impact helps us prioritize preventive measures against thrashing.
When memory's low, thrashing will show, pages swap fast, but performance won't grow.
Imagine a librarian who needs to fetch books from a distant warehouse at a snail's pace instead of using the books she already has on hand; this is akin to thrashing in a computer system.
Remember 'T.W.L.' for Thrashing: Too Many Pages, Working Sets Overflow.
Use 'SWAP' - Swapping Wasted Actual Performance.
Term
Thrashing
Click to flip
Term
Working Set
Click to flip
Term
Page Fault
Click to flip
A condition where excessive paging occurs due to insufficient physical memory, resulting in more time spent swapping pages than executing processes.
The set of pages that a program is currently using or has accessed recently, crucial for understanding memory demands.
The tendency of a processor to access the same set of memory locations repetitively over a short period.
Thrashing occurs when a computer system spends more time swapping pages in and out of memory than executing processes due to insufficient physical memory.
This section discusses thrashing as a result of a process accessing more virtual memory than the physical memory available, leading to excessive page swapping. Solutions to alleviate thrashing include increasing physical memory or improving algorithm efficiencies to better handle memory access.
Thrashing is a condition that arises in virtual memory systems when a computer is forced to spend more resources on paging than executing the actual task. Specifically, when a program's working set cannot fit into the available physical memory, the operating system spends significant time swapping pages in and out of memory—this is known as thrashing.
The concept of a 'working set' refers to the set of pages that a program is actively using or has used recently. When the working set exceeds the physical memory allocated, thrashing becomes evident. This section highlights key ways to manage this issue:
This summary underscores the critical nature of effective memory management in preventing thrashing and ensuring smooth system performance.