Unit 4: Memory Management What is Memory Management Memory is vital to the functioning of any computer or computerized device. As discussed in Units 1 and 2, memory consists primarily of RAM chips that are installed on the motherboard of a computer. Atypical computer now has between 1 GB and 4 GB of RAM. RAM is divided into segments (typically 32 bits) that are used to temporarily store data and instructions that are being used by the computer. This is different from your hard drive, which permanently stores files and programs. RAM is much faster than your hard drive, so your data and instructions are loaded from your hard drive into RAM when the computer is using them. When you turnoff the power, everything stored in RAM is gone. In addition to the physical RAM installed in your computer, most modern operating systems allow your computer to use a virtual memory system. Virtual memory allows your computer to use part of a permanent storage device (such as a hard disk) as extra memory. Memory resources are managed by the operating system. The operating system is responsible for allocating memory address ranges as needed to run applications and processes. In this unit, we will look at the function of the memory manager in an operating system, and the types of problems that the memory manager must resolve. We will look at some of the techniques that operating systems can use to actually allocate memory, and some of the problems that can occur when using specific memory allocation strategies. We will also look at the purpose of virtual memory and how it works. This will include a look at page files, the page table, and the page replacement policies used by operating systems to manage virtual memory. The Memory Manager The memory manager is part of the kernel (core) of the operating system. It is responsible for efficiently managing all memory resources including RAM and virtual memory, and allocating memory space to applications and processes as needed. The memory manager must keep track of all memory addresses and what they are currently being used for. It must also protect those address ranges, and the data and instructions stored in them, from data and instructions being used by other processes. The memory manager is also responsible for freeing up memory when it is no longer being used so that other processes can use it. The memory manager is responsible for four critical tasks 1. Allocating main memory to processes 2. Retrieving and storing the contents to and from main memory when requested 3. Effective sharing of main memory 4. Minimizing memory access time