DOC PREVIEW
CORNELL CS 414 - Memory Management

This preview shows page 1-2-3-21-22-23-43-44-45 out of 45 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Memory ManagementSlide 2Slide 3Address BindingMemory Management RequirementsSlide 6Slide 7Slide 8Slide 9Simple Memory ManagementFixed PartitioningSlide 12Slide 13Placement Algorithm with PartitionsSlide 15Slide 16Dynamic PartitioningDynamic Partitioning: an exampleSlide 19Placement AlgorithmPlacement Algorithm: commentsReplacement AlgorithmBuddy SystemExample of Buddy SystemSlide 25Slide 26Buddy Systems: remarksRelocationAddress TypesAddress TranslationSimple example of hardware translation of addressesExample Hardware for Address TranslationSimple PagingExample of process loadingExample of process loading (cont.)Page TablesLogical address used in pagingLogical address in pagingSlide 39Logical-to-Physical Address Translation in PagingSimple SegmentationSlide 42Logical address used in segmentationLogical-to-Physical Address Translation in segmentationSimple segmentation and paging comparison1Memory ManagementMemory ManagementChapter 8Chapter 82Memory ManagementMemory ManagementIt is the task carried out by the OS and hardware to accommodate multiple processes in main memoryIf only a few processes can be kept in main memory, then much of the time all processes will be waiting for I/O and the CPU will be idle Hence, memory needs to be allocated efficiently in order to pack as many processes into memory as possible3Memory ManagementMemory ManagementIn most schemes, the kernel occupies some fixed portion of main memory and the rest is shared by multiple processesWhat is the location in main memory of the active (running, ready, blocked) processes?It is not fixed: how do we write programs, then?4Address BindingAddress BindingAddresses in the source program are generally symbolicSymbolic addresses are bound to absolute addressesBinding can be done at any different stepsCompile time: if compiler knows where the process will resideLoad time: the loader binds the relocatable addresses produced by the compiler to absolute addressesExecution time: if the process can be moved during its execution from one memory segment to anotherMore on this later5Memory Management RequirementsMemory Management RequirementsRelocationprogrammer cannot know where the program will be placed in memory when it is executeda process may be (often) relocated in main memory due to swappingswapping enables the OS to have a larger pool of ready-to-execute processes memory references in code (for both instructions and data) must be translated to actual physical memory address6Memory Management RequirementsMemory Management RequirementsProtectionprocesses should not be able to reference memory locations in another process without permissionimpossible to check addresses at compile time in programs since the program could be relocatedaddress references must be checked at run time by hardware7Memory Management RequirementsMemory Management RequirementsSharingmust allow several processes to access a common portion of main memory without compromising protectioncooperating processes may need to share access to the same data structurebetter to allow each process to access the same copy of the program rather than have their own separate copy8Memory Management RequirementsMemory Management RequirementsLogical Organizationusers write programs in modules with different characteristics instruction modules are execute-onlydata modules can be read and/or writtensome modules are private others are publicTo effectively deal with user programs, the OS and hardware should support a basic form of module to provide the required protection and sharing9Memory Management RequirementsMemory Management RequirementsPhysical Organizationsecondary memory is the long term store for programs and data while main memory holds program and data currently in usemoving information between these two levels of memory is a major concern of memory management (OS)it is highly inefficient to leave this responsibility to the application programmer (no offense)10Simple Memory ManagementSimple Memory ManagementAn executing process must be loaded entirely in main memory (if user-implemented overlays are not used)Although the following simple memory management techniques are not used in modern OS, they lay the ground for a proper discussion of virtual memoryfixed partitioningdynamic partitioningsimple pagingsimple segmentation11Fixed PartitioningFixed PartitioningPartition main memory into a set of non overlapping regions called partitionsPartitions can be of equal or unequal sizes12Fixed PartitioningFixed PartitioningAny process whose size is less than or equal to a partition size can be loaded into the partitionIf all partitions are occupied, the operating system can swap a process out of a partitionA program may be too large to fit in a partition. The programmer must then design the program with overlays (overlays also allows for larger-than-memory programs)When the module needed is not present the user program must load that module into the program’s partition, overlaying whatever program or data are there13Fixed PartitioningFixed PartitioningMain memory use is inefficient. internal fragmentation: Any program, no matter how small, occupies an entire partition.Unequal-size partitions lessens these problems but they still remain...Also, how do you choose partition sizes?Equal-size partitions was actually used in early IBM’s OS/MFT (Multiprogramming with a Fixed number of Tasks)14Placement Algorithm with PartitionsPlacement Algorithm with PartitionsEqual-size partitionsIf there is an available partition, a process can be loaded into that partitionBecause all partitions are of equal size, it does not matter which partition is usedIf all partitions are occupied by blocked processes, choose one process to swap out to make room for the new processOnly need a bit-vector to mark which partitions are free/used15Placement Algorithm with PartitionsPlacement Algorithm with PartitionsUnequal-size partitions: use of multiple queuesAssign each process to the smallest partition within which it will fitTries to minimize internal fragmentationProblem: some queues will be empty if no processes within a size range is present16Placement Algorithm with PartitionsPlacement Algorithm with PartitionsUnequal-size partitions: use of a single queueWhen its time to load a process into main


View Full Document

CORNELL CS 414 - Memory Management

Documents in this Course
Security

Security

49 pages

Processes

Processes

24 pages

Deadlocks

Deadlocks

57 pages

Threads

Threads

5 pages

Threads

Threads

29 pages

Deadlocks

Deadlocks

36 pages

Load more
Download Memory Management
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Memory Management and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Memory Management 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?