Memory & Process Management
Computer Science: OCR GCSE, topic 1.5.5
Memory and Process Management
As with all hardware in the computer, the memory (RAM) and central processing unit (CPU) must be managed by a part of the operating system.

Purpose of memory manager
- The memory manager controls the allocation of random access memory (RAM) to each running process.
- If the memory manager fails to manage memory well, then the computer will slow down and might crash.
- The memory manager moves data from secondary storage into RAM.
- The data can be removed from RAM when no longer needed.

Purpose of process manager
- Modern operating systems allow users to run multiple programs at once.
- In reality, a CPU can only execute one process at a time. So the CPU must switch between processes so quickly that it seems that they are running simultaneously.

Memory allocation
- The Operating System assigns memory in RAM when an application/process starts.
- If an application/process requires more memory, the OS will assign it more memory. The OS must be careful not to overwrite memory allocated to any other applications/processes running.

Multitasking
- Modern operating systems allow multiple applications to run at once. This is known as multitasking.
- For this to work, the operating system must manage how memory and CPU time is allocated to each running process.

Multitasking (cont.)
- If there is only one CPU, the tasks of each different application/process are managed by the OS to appear as if multiple are running at the same time.
- It does that by quickly swapping between the instructions of the different applications/processes running.
- The OS assigns processes/applications to each core so that more than one set of instructions is being executed at the same time.
Test yourself on Memory & Process Management
What might happen if the memory manager does not efficiently manage the memory?
In reality, how many processes can be run on a single processor at once?