CS3224 - 3. Memory Management

CS3224 - 3. Memory Management - 1 1 Memory Management 2...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 1 Memory Management 2 Overview • Basic memory “management” • Address Spaces • Virtual memory • Page replacement algorithms • Design issues for paging systems • Implementation issues • Segmentation 2 3 Memory Management • Ideally programmers want memory that is – large – fast – non volatile • Memory hierarchy – small amount of fast, expensive memory – cache – some medium-speed, medium price main memory – gigabytes of slow, cheap disk storage • Memory manager – handles the memory hierarchy – Protects processes from each other. Approaches • Single Process, Contiguous Memory • Multiple Processes, Contiguous Memory • Multiple Processes, “Discontiguous” Memory • Multiple Processes, Only partially in memory 4 3 5 Basic Memory Management Single Process without Swapping or Paging Three simple ways of organizing memory- an operating system with one user process 6 Binding • If a program has a line: int x; When is the address of x determined? • What are the choices? • At compile time • At load time • At run time 4 7 Base / Limit Registers • Binding done at run time. • Addresses are added to base value to map to physical address • Addresses larger than limit value are an error 8 Swapping Memory allocation changes as – processes come into memory – leave memory Shaded regions are unused memory 5 9 Managing Free Memory • Assume a process being loaded can ask for any size “chunk” of memory needed. • We need to be able to find a chunk the right size. • How can we keep track of free chunks efficiently? 10 Memory Management with Bit Maps • Part of memory with 5 processes, 3 holes – tick marks show allocation units – shaded regions are free • Corresponding bit map • Same information as a list 6 11 Memory Management with Linked Lists Four neighbor combinations for the terminating process X 12 Order of Search for Free Memory • We can search for a large enough free block of free memory starting from the beginning. That’s called first fit . • If we already skipped over the first N holes because they were too small, maybe it’s a waste of time to look there again. Try next fit. • Should we be more selective in our choice? After all we’re just grabbing the first thing that works… • How does first (or next) fit effect fragmentation? Could we do better? • Can we find a hole that fits faster? What are the downsides? 7 13 The Contiguous Constraint • So far a process’s memory has been contiguous. • What if it didn’t have to be? • What problems would that help solve? • How would the hardware need to change? • What additional work would the OS have to do? 14 It’s All Gotta Be in Memory (or does it?) • We have assumed that the entire process has to be in memory whenever it is running....
View Full Document

This note was uploaded on 02/02/2011 for the course CS 3224 taught by Professor Johnsterling during the Spring '10 term at NYU Poly.

Page1 / 39

CS3224 - 3. Memory Management - 1 1 Memory Management 2...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online