What if your computer could magically know exactly what it needs to keep ready to avoid slowing down?
Why Thrashing and working set model in Operating Systems? - Purpose & Use Cases
Imagine you are trying to work on many tasks at once, but your desk is too small to hold all your papers. You keep shuffling papers in and out, losing track and slowing down your work.
Without a good way to manage which papers you keep on your desk, you waste time constantly swapping them. This makes your work slow and frustrating, and you often repeat tasks because you lost important papers.
The working set model helps by keeping only the most needed papers on your desk, so you don't waste time swapping. It tracks what you used recently and keeps that ready, preventing thrashing--when you spend all your time swapping and no time working.
if (memory_full) { swap_any_page(); }if (working_set_exceeds_limit) { swap_least_used_page(); }This concept enables computers to run programs smoothly without wasting time swapping memory pages back and forth.
When you open many apps on your phone, the working set model helps keep only the apps you use most active, so your phone doesn't slow down by constantly switching between all apps.
Thrashing happens when too much swapping slows down the system.
The working set model tracks recent memory use to keep important data ready.
This improves performance by reducing unnecessary swapping.