Systems software - OCRMultitasking and memory management

A computer is controlled by systems software. Operating systems provide this control, while utilities help to maintain the system.

Part ofComputer ScienceComputer systems

Multitasking and memory management

Multitasking means to be able to run more than one program simultaneously. In the past, computers with CLIs were unable to multitask - the operating systems of the day only allowed one program to run at a time.

Modern operating systems are multitasking in that they allow several programs to run side-by-side. It is not uncommon for a user to be music while entering text into a , or streaming a video while making a of files.

Multitasking is possible only if:

  • the operating system can support multitasking
  • the computer has enough memory to hold more than one program in primary memory at the same time

Memory management

Computer memory must be managed to ensure that:

  • more than one program can run at the same time
  • more than one document can be opened at the same time

One method of memory management is known as . Memory is broken up into fixed-size blocks, known as .

Different operating systems allocate their own size to pages. For example, memory pages in modern operating systems are typically 4 kilobytes (KB) in size.

When a program is run, it is loaded into memory. The operating system determines how much memory the program requires, and allocates enough pages to hold it and its documents. When the program is closed, the allocated pages are freed up for use by other programs.

The pages a program occupies may or may not be , but this does not matter. The operating system knows what each page occupies and fetches the data held in them when needed.

Example

Consider this example. Program A requires two pages. It is allocated pages 0 and 1. Program B requires three pages. It is allocated pages 2, 3 and 4.

Table with programs that have been loaded to memory and allocated pages

Program A now closes, and Program C now runs. Program C requires three pages. Pages 0 and 1 are now free, so Program C is allocated pages 0, 1 and 5.

Table with programs that have been loaded to memory and allocated pages