0% found this document useful (0 votes)
74 views20 pages

Memory Management: TM2033 Platform Technology

This document discusses memory management techniques in operating systems. It explains that swapping and paging were developed to allow processes larger than physical memory to run using virtual memory. Swapping moves entire processes between disk and memory, while paging divides processes and memory into pages and swaps pages in and out as needed. Using demand paging, only required pages are loaded initially, improving efficiency. Virtual memory combines physical memory and disk space, allowing processes to run without being fully loaded into memory at once.

Uploaded by

Sazs Gaming
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views20 pages

Memory Management: TM2033 Platform Technology

This document discusses memory management techniques in operating systems. It explains that swapping and paging were developed to allow processes larger than physical memory to run using virtual memory. Swapping moves entire processes between disk and memory, while paging divides processes and memory into pages and swaps pages in and out as needed. Using demand paging, only required pages are loaded initially, improving efficiency. Virtual memory combines physical memory and disk space, allowing processes to run without being fully loaded into memory at once.

Uploaded by

Sazs Gaming
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

* TM2033

Platform Technology

Memory Management

Dr Nazatul Aini Abd Majid


[email protected]
*

* To understand operating system fundamental


concepts and algorithms based on those used in
the industry including Windows and Linux.
*

* Uni-program
* Memory split into two
* One for Operating System (monitor)
* One for currently executing program
* Multi-program
* “User” part is sub-divided and shared among active
processes
*
* OS needs to manage memory:
* Memory management  determines if it is possible to
load programs and data into memory and if so where
in memory
* Optimize the use of memory. This could be
prevented:
*

*How memory management


manage the memory?
*

* Content
* Why swapping is needed?
* What is swapping?
* What is paging?
* What is virtual memory
* Summary
* Quiz 2
*
* Problem: I/O is so slow compared with CPU. Even in
multi-programming system, CPU can be idle most of
the time
* Solutions:
* Increase main memory
* Expensive
* Leads to larger programs
*  Swapping
*

* Content
* Why swapping is needed?
* What is swapping?
* What is paging?
* What is virtual memory
* Summary
* Quiz 2
*

* Long term queue of processes stored on disk


* Processes “swapped” in as space becomes available
* As a process completes it is moved out of main memory
* ISSUE: If none of the processes in memory are ready (i.e.
all I/O blocked)
*
* Swap out a blocked process to intermediate queue
* Swap in a ready process or a new process
* Therefore, the cpu will not idle for long
*
*How if a user wants to run a
program bigger than the size of
main memory?

* use virtual memory  paging is one of the important


concept in virtual memory.
*

* Content
* Why swapping is needed?
* What is swapping?
* What is paging?
* What is virtual memory
* Summary
* Quiz 2
*
* Split memory into equal sized, small chunks -page
frames
* Split programs (processes) into equal sized small
chunks - pages
* Allocate the required number page frames to a
process
* Operating System maintains list of free frames
* Use page table to keep track
*
*

* Content
* Why swapping is needed?
* What is swapping?
* What is paging?
* What is virtual memory
* Summary
* Quiz 2
*
*
* Demand paging
* Do not require all pages of a process in memory
* Bring in pages as required
* Virtual memory = Main memory (RAM) + Part of Hard disk
* We do not need all of a process in memory for it to run
* We can swap in pages as required
* So - we can now run processes that are bigger than total
memory available!
*
* Page fault
* Required page is not in memory
* Operating System must swap in required page
* May need to swap out a page to make space
* Select page to throw out based on recent history
* Thrashing
* Too many processes in too little memory
* Operating System spends all its time swapping
* Little or no real work is done
* Disk light is on all the time
* Solutions
* Good page replacement algorithms
* Reduce number of processes running
* Fit more memory
*

* Content
* Why swapping is needed?
* What is swapping?
* What is paging?
* What is virtual memory
* Summary
* Quiz 2
Dr Nazatul Aini Abd Majid
[email protected]

You might also like