Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lesson Objectives Aims Key Words Paging, Segmentation, Virtual Memory

Similar presentations

Presentation on theme: "Lesson Objectives Aims Key Words Paging, Segmentation, Virtual Memory"— Presentation transcript:

1 Lesson Objectives Aims Key Words Paging, Segmentation, Virtual Memory
Be able to describe how memory is managed in an operating system Understand the following terms: Paging Segmentation Virtual memory Key Words Paging, Segmentation, Virtual Memory

2 Remember our history lesson…
Early computers and micro computers usually ran one task only until completion This meant memory management was simple – why?

3 Single contiguous allocation
Sounds complex, but all this means is: There will be a small amount of memory reserved for the operating system/system use The rest is for the single task loaded/programmed/running on the system

4 Multi-tasking, Multi-programming
Any system that allows multiple programs/processes/tasks to run at the same time must make use of some form of memory management. There are three main types Paging Segmentation Virtual memory

5 When is memory not memory?
When it’s storage… Storage (hard drives, SSD’s) can be used as working memory Dedicated memory such as RAM is referred to as “Primary Memory” Any other store used as memory is referred to as “Secondary Memory”

6 Paging, Segmentation, Virtual Memory
Task For each type of memory management, do the following: Draw and label a detailed diagram explaining how it works and highlighting any key terms Give a short description of what it is/entails Extra info – any advantages or disadvantages, operating system overheads, examples of where it is used Paging, Segmentation, Virtual Memory

7 Paging In simple terms…
A page is a unit of logical memory of a program A frame is a unit of physical memory All pages are of the same size All frames are of the same size

8 Paging

9 Paging Paging – Also called swapping – is the process of moving data between RAM and virtual memory. It moves data out of RAM that is not immediately needed and replaces it with ones that are. This process is slower than using just using primary memory alone since secondary storage is slower and the data has to move around more. It achieves this by using a page table to keep track of where data resides.

10 Segmentation

11 Segmentation Memory segments are NOT of fixed width
Each program is split in to component parts – Code, Variables, Stacks, Libraries etc Each part does not need to be stored contiguously in memory This means we can SHARE memory segments

12 Segmentation When programs are loaded up into memory, segmentation allows the primary memory to store only the bit it needs at that particular time. For example, Dynamic Link Libraries can be stored on the hard disk until called by main memory by a program. Segmentation allows programs to be broken up into smaller address spaces and each can have its own type of protection and can be shared amongst other processes.

13 Virtual Memory RAM is a finite resource It is quite possible to open more programs than there is memory available to use Virtual memory uses paging to allocate sections of Secondary Memory to enable this to happen

14 Virtual Memory Uses secondary storage (such as the hard disk) as an extension of physical memory (RAM). The memory manager can trick the operating system into thinking that it has more physical memory than it actually does by making use of secondary storage such as the hard disk or flash drives

15 Virtual Memory O/S can page out idle tasks in to virtual memory to free up Primary Memory Paging to Secondary Memory takes LOTS of time and therefore isn’t an ideal solution

16 Summary Computer memory consists of primary memory (random-access memory [RAM]) for running programs and secondary memory (Hard Disk Drive [HDD] and other storage media). The memory manager allocates primary memory to running processes. Segments are blocks of memory that can vary in size. A segmentation table keeps track of the addresses of segments used by each process. Pages are fixed-size blocks of memory that are smaller in size than segments. Details of the mapping of logical addresses to physical addresses are stored in the page table. Pages can be swapped out to a virtual memory page file on the HDD. A flag in the page file indicates that this has happened. If too many pages are being swapped in and out of virtual memory, the system can slow down and become unresponsive, which is known as disc thrashing

17 Review/Success Criteria
You should understand: The need for memory management Three memory management techniques What a Page, Frame and Segment are

Download ppt "Lesson Objectives Aims Key Words Paging, Segmentation, Virtual Memory"

Similar presentations

Ads by Google