This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ghout memory.
• When a process arrives, it is allocated memory from a hole
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-fit: Allocate the smallest hole that is big enough; must
search entire list, unless ordered by size. Produces the smallest
Worst-fit: Allocate the largest hole; must also search entire list. How do they compare? Variable
Variable partitioning is the strategy of parking differently sized cars
along a street with no marked parking space dividers. Variable
Problem 1: 50% rule
empirically observed that with N allocated blocks, .5N will be lost due
to external fragmentation! Fixed
Fixed Partitioning Fragmentation
External fragmentation – total memory space exists to satisfy a
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
Physical address space of a process can be noncontiguous
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 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.
- Summer '14
- Operating Systems