Menu

Memory Management and Multitasking

Transfer of Programs and Data

When a program is not being used, the program and its data are kept on secondary storage, such as a tablet's built-in storage or a USB stick. Secondary storage is non-volatile, so it keeps its contents when the power is off, and it has a large capacity, so it can hold many programs and files.

The CPU cannot run a program directly from secondary storage. It can only fetch instructions and data that are held in RAM (random access memory). That is why the operating system has to move programs and their data between secondary storage and RAM.

Opening a program

When you open a program, the operating system loads the program into RAM, together with any files it needs. For example, if you open a cooking app to view a recipe, the app's instructions and the recipe file are copied into RAM.

While the program is running, the CPU takes the instructions it needs, and the data they work on, from RAM, and anything it works out is kept there too. If you change the recipe's serving size, the new amounts are worked out and stored in RAM.

Saving and closing

When you save your work, the operating system writes the saved data out of RAM and back onto secondary storage. When you close the program, the operating system removes it from RAM, freeing that memory for another program. The direction matters: opening loads a program into RAM, while saving writes data back out of RAM.

ActionDirection of transferWhat the operating system does
Opening a programSecondary storage to RAMLoads the program and any files it needs into RAM
Saving workRAM to secondary storageWrites the saved data back out of RAM onto secondary storage
Closing a programRemoved from RAMClears the program out of RAM so the space can be reused

Practise this

OCR GCSE Computer Science · Memory Management and Multitasking