Memory Management: TM2033 Platform Technology
Memory Management: TM2033 Platform Technology
Platform Technology
Memory Management
* 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:
*
* 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
*
* 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]