From aa861617ffbdce7b30362788e2b9c9161601a7fc Mon Sep 17 00:00:00 2001 From: Jet Hughes Date: Tue, 1 Nov 2022 13:04:33 +1300 Subject: [PATCH] vault backup: 2022-11-01 13:04:33 --- content/notes/22-virtual-memory.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/content/notes/22-virtual-memory.md b/content/notes/22-virtual-memory.md index 612b6906a..57da3e108 100644 --- a/content/notes/22-virtual-memory.md +++ b/content/notes/22-virtual-memory.md @@ -7,6 +7,26 @@ tags: --- # Swapping and virtual memory +swapping +- if there is not enough physical memory we need to sawp processes out of the main ememory to the secondary storage e.g., disk +- ![slide](https://i.imgur.com/ImjjXkb.png) +- when a process is ready, it is swapped into the main memory +- allows more processes to multitask + +partially loaded proceses +- dynamic loading + - load a potion of code when it is called as some code may not need to be executed, e.g., code for handling errors + - pros + - process not limited by amount of avilable memory + - more processes multitasking + - quicker to swap than entire process + +virtual memory +- idea that processes dont need to be fully in memory to run + +extends main memory to secondary storage, and allows dynamic loading of processes while they execute +- programmer deals with vmem just like paging scheme +- mem manager in OS kernel controls loading pages of the process into main mem from secondary storage # Demand paging