When a process arrives it is allocated memory from a

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: ghout memory. • When a process arrives, it is allocated memory from a hole large large enough to accommodate it. • Operating system maintains information about: a) allocated partitions b) free partitions (hole) OS OS OS OS process 5 process 5 process 5 process 5 process 9 process 9 process 8 process 2 process 10 process 2 process 2 process 2 Dynamic Dynamic Storage-Allocation Problem How to satisfy a request of size n from a list of free holes. First-fit: Allocate the first hole that is big enough. Best Best-fit: Allocate the smallest hole that is big enough; must search entire list, unless ordered by size. Produces the smallest leftover hole. Worst Worst-fit: Allocate the largest hole; must also search entire list. How do they compare? Variable Variable Partitioning Variable partitioning is the strategy of parking differently sized cars along a street with no marked parking space dividers. Variable Variable Partitioning Problem 1: 50% rule empirically empirically observed that with N allocated blocks, .5N will be lost due to external fragmentation! Fixed Fixed Partitioning Fragmentation Fragmentation External fragmentation – total memory space exists to satisfy a request, request, but it is not contiguous. Internal fragmentation – allocated memory may be slightly larger than requested memory; this size difference is memory internal to a partition, but not being used. Reduce external fragmentation by compaction • Shuffle memory contents to place all free memory together in one large block. • Compaction is possible only if relocation is dynamic, and is done at execution time. Paging Paging Physical address space of a process can be noncontiguous Divide Divide physical memory into fixed-sized blocks called frames (size is power of 2, between 512 bytes and 8192 bytes). Divide logical memory (VAS) into blocks of same size called pages. Keep track of all free frames. To To run a program of size n pages, need to find n free frames and load executable. Free frames need not be c...
View Full Document

This document was uploaded on 04/02/2014.

Ask a homework question - tutors are online