Class Note for CMPSCI 377 at UMass(45)
Class Note for CMPSCI 377 at UMass(45)
Popular in Course
Popular in Department
This 5 page Class Notes was uploaded by an elite notetaker on Friday February 6, 2015. The Class Notes belongs to a course at University of Massachusetts taught by a professor in Fall. Since its upload, it has received 18 views.
Reviews for Class Note for CMPSCI 377 at UMass(45)
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 02/06/15
CMPSCI 377 Operating Systems Fall 2005 Lecture 10 October 18 Lecturer Vitaliy Lvin Scribes Szymon Kaflz39nskz39 and Matthew Tassimzn39 Last time ReadWrite Locks7 Monitors7 Condition Variables Today we re going to learn about Memory Management Terminology Addresses Uniprogramming Multiprogramming Relocation o Allocation o Swapping 101 Terminology We know that executable programs are stored on disk When programs are executed the OS loads them from disk into memory While the program executes it grabs instructions from the allocated memory for that program It also reads and writes data for that program from memory The following is a list of different terms used in memory management Segment 0 a memory spot assigned to process Physical address 0 real address in memory Virtual address 0 relative address to start of the current processs address space 0 by use of a look up table these addresses are assigned 10 1 102 Lecture 10 October 18 10 2 Addresses Now that we know what addresses are and the different types7 where do they come from The source of an address is made available for data and instructions in there different manners Compiletime 0 an exact physical location in memory is assigned starting from xed position 0 prereserved memory chunk and always the same chuck Loadtime o lets the OS determine processs starting position 0 xes up addresses and can run in different parts Execution time o lets the OS place address anywhere in physical memory 0 this solution cause the least problems 10 3 Uniprogramming This is a model from the past that allows only one program at a time In this case the memory management is very simple The OS gets the highest memory spot Only load one process at a time 0 load at address 0 o executes in contiguous memory The compiler will only generate physical addresses 0 maximum address memory size OS size highest location 0 OS is protected from running process by checking addresses IMPORTANT No overlap of 10 see lecture slides for example diagram 104 Multiprogramming As the name implies this model allows for multiple programs to run at once In order to have a correct memory management system these three properties must hold true Transparency Lecture 10 October 18 103 0 processes are not aware memory is shared 0 give the process no constraints on physical memory Safety 0 no processes overwrites each other 0 most important the OS Efficiency 0 performance not degraded due to sharing 0 it needs to be fast 105 Relocation o the Operating System gets loaded into high memory 0 processes start at memory address 0 o processes are allocated contiguous memory with base and limit addresses There are two types of Relocation Static Relocation At process load the process7 addresses are calculated Processes do not move after relocation Dynamic Relocation Hardware adds relocationbase register to virtual address to get physical address Hardware compares address with limit register There are some pros and cons of relocation Pros 0 easy movement of processes during execution 0 OS allows a process to grow 0 simple fast hardware 2 registers add and compare 0 slows system due to constant calculation 0 can t share memory between processes 0 process limited to physical memory size OS 0 limited multiprogramming o complicated memory management Relocation Properties Transparency processes unaware of sharing Safety each memory ref checked Efficiency checks fast if in hardware process growth can cause slow movement 104 Lecture 10 October 18 106 Allocation As processes start grow and end the OS must track available and inuse memory This can leave holes Which the OS must determine how to manage Memory allocation policies 0 First Fit use rst hole in Which process ts 0 Best Fit use smallest hole that process Will t in o WorstFit use the largest hole 107 Fragmentation Compaction Fragmentation Memory unavailable for allocation but unused by processes lnternal Fragmentation 0 many small holes caused by loading unloading o no contiguous space large enough for processes External Fragmentation 0 space allocated to processes but unused Compaction Eliminate holes from fragmentation Issues 0 amount of memory used 0 block size 108 Swapping Copy process to disk and release all memory 0 must reload processes When they become active 0 in static relocation they must go back to the same location 0 dynamic relocation is easier If swapping is supported compaction simple 0 not supported in modern OSs Lecture 10 October 18 105 109 Summary In order for proceess to execute they have the reside in memory Generally they use a Virtual address 0 Translated to physical addresses before accessing memory Segmentation o Allows processes to share memory 0 Expensive to grow over time Swapping 0 Total being used by all can exceed main memory 0 Increases context switch time
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'