Operating Systems - Memory Management
compsci ✒ operating-systems ✒ memory-management
Old methods of allocating memory
- If your OS can only run one program at a time, all the memory not needed by the OS can be assigned to the program, to do with as it wishes
- Of course, only running one program at a time is wasteful - if it is blocked by slow disk reading or having to send something over the network, the CPU will be idle most of the time.
- So you might divide the memory into fixed partitions, and assign one partition to each program - programs that need more memory have to use one of the larger positions and will not be started until one becomes free (and is assigned to it).
- Each partition has a continuous block of memory, so it can be represented by the start (base) and size of the partition (limit).
- But this is still inefficient - programs may not know how much memory they will use in advance, and you're still restricted to having the total memory usage of running programs <= amount of RAM
Swapping
- The first insight is that when a process is paused (e.g. waiting for input), it can be written to disk and the RAM assigned to a different process.
Further Reading
Copyright (C) 2006-8 Ryan Lothian. All rights reserved.
