Virtual Memory in Operating System
What is Virtual Memory
Virtual memory is a technique that makes it seem like there is more memory available than what actually exists. It lets programs use more memory than the computer’s physical memory (RAM) by using part of the storage (like a hard drive) as if it were RAM. This helps run bigger applications on computers with less physical memory.
There are two main types of virtual memory:
Virtual memory in a computer is managed by the Memory Management Unit (MMU), which converts virtual addresses into physical ones.
Paging
Memory is divided into small, fixed-size blocks called pages. When RAM is full, pages not in use are moved to the hard drive (swap file). When needed again, they are swapped back into RAM.
Segmentation: Memory is divided into segments of different sizes. Segments not needed are moved to the hard drive. The system tracks these segments and brings them back when needed.
Sometimes, both paging and segmentation are combined.
Virtual Memory vs. Physical Memory:
RAM is faster and used first for running programs, while virtual memory is slower and used when RAM is full.
- Swapping is when a process's pages are moved out of memory to make space. The process is paused while it's swapped out. Later, the process can be swapped back into memory to continue running.
- Thrashing happens when the system spends too much time swapping pages in and out of memory instead of running programs. This usually occurs when too many processes are trying to use memory, causing the system to keep replacing pages. As a result, the CPU is underused, and the system becomes slow.

This would be great if it wasn’t so boring.
ReplyDeletebra, wht you mean he gives some good points :0
DeleteIt's actually nice what you going on about @max
DeleteMax for real hating, the test got to him. ;)
ReplyDelete