How does the operating system manage memory, and what are paging, segmentation and virtual memory?
Memory management: how the operating system allocates and protects memory between processes, paging and segmentation, and virtual memory using secondary storage to extend the apparent size of main memory.
An Eduqas Component 2 answer on memory management: how the operating system allocates and protects memory between processes, the difference between paging and segmentation, and how virtual memory uses secondary storage to extend the apparent size of main memory.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
Eduqas wants you to explain how the OS allocates and protects memory between processes, distinguish paging from segmentation, and explain virtual memory, why it is used, and disk thrashing. This builds on the OS dot point and the memory hierarchy from section 3.1.
The answer
Allocating and protecting memory
Paging and segmentation
Virtual memory and disk thrashing
Examples in context
Memory management is why you can run many apps at once and why a misbehaving app rarely takes down the whole system (memory protection). Virtual memory is why a computer can open a file or run a program larger than its RAM, and why adding RAM speeds up a machine that was thrashing. Paging is the scheme used by virtually all modern operating systems. This dot point connects to the memory hierarchy (registers, cache, RAM, secondary storage) from section 3.1 and to the OS's process management in the previous dot point.
Try this
Q1. State the difference between paging and segmentation. [2 marks]
- Cue. Paging divides memory into equal fixed-size blocks (frames/pages); segmentation divides a process into variable-size logical segments (code, data, stack).
Q2. What is virtual memory? [2 marks]
- Cue. Using part of secondary storage as if it were extra main memory, swapping pages between disk and RAM so the apparent memory is larger than the physical RAM.
Q3. Why does disk thrashing slow a computer dramatically? [1 mark]
- Cue. The OS spends most of its time swapping pages between RAM and disk (which is far slower than RAM) rather than executing instructions.
Exam-style practice questions
Practice questions written in the style of WJEC Eduqas exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
Eduqas 20216 marksExplain the difference between paging and segmentation as methods of memory management.Show worked answer →
Paging (up to 3 marks): main memory is divided into equal, fixed-size blocks called frames, and a process is divided into equal-size blocks called pages of the same size; pages are loaded into any available frames, which need not be contiguous. Because the divisions are a fixed size, paging can cause internal fragmentation (the last page may not be full).
Segmentation (up to 3 marks): a process is divided into logical, variable-size segments that reflect its structure (for example a code segment, a data segment, a stack segment); each segment is allocated a contiguous area of memory. Because segments vary in size, segmentation can cause external fragmentation (gaps between segments).
Markers reward the fixed-size-physical-blocks description of paging and the variable-size-logical-divisions description of segmentation, ideally with the fragmentation each can cause.
Eduqas 20225 marksExplain what virtual memory is, why it is used, and what is meant by disk thrashing.Show worked answer →
Virtual memory (up to 2 marks): a technique where part of secondary storage (the hard disk or SSD) is used as if it were extra main memory; pages of a process not currently needed are moved out to this area, and pages that are needed are brought back into RAM, so the apparent amount of memory is larger than the physical RAM.
Why it is used (up to 1 mark): it allows programs larger than physical RAM to run, and lets more processes be held at once than RAM alone would allow.
Disk thrashing (up to 2 marks): if too many processes are running, the OS spends most of its time swapping pages between RAM and disk rather than executing instructions, because pages are constantly needed and evicted; performance collapses because disk access is far slower than RAM.
Markers reward the secondary-storage-as-extra-RAM definition, the run-larger-programs reason, and the excessive-swapping description of thrashing.
Related dot points
- The operating system: its role as the interface between the user, applications and hardware, process management and CPU scheduling, the handling of interrupts, and the management of input/output and the file system.
An Eduqas Component 2 answer on the operating system: its role as the interface between user, applications and hardware, process management and CPU scheduling algorithms, the handling of interrupts, and the management of input/output and the file system.
- Input, output and storage: the role of input and output devices, the memory hierarchy from registers and cache to RAM and secondary storage, and the operating principles, advantages and uses of magnetic, optical and solid-state storage.
An Eduqas Component 2 answer on input, output and storage: the role of input and output devices, the memory hierarchy from registers and cache to RAM and secondary storage, and how magnetic, optical and solid-state (flash) storage work with their advantages and uses.
- Software applications: the distinction between system software and application software, generic, special-purpose and bespoke applications, the role of utility programs (compression, defragmentation, backup, antivirus), and how software is licensed.
An Eduqas Component 2 answer on software applications: the distinction between system and application software, generic, special-purpose and bespoke applications, the role of utility programs such as compression, defragmentation, backup and antivirus, and software licensing models.
- The fetch-decode-execute cycle: the special-purpose registers (PC, MAR, MDR, CIR, ACC) and their use in fetching, decoding and executing an instruction, and the effect of the cycle on the registers.
An Eduqas Component 2 answer on the fetch-decode-execute cycle: the special-purpose registers (program counter, MAR, MDR, current instruction register, accumulator) and exactly how each is used to fetch, decode and execute an instruction.
- Computer architecture: the components of the CPU (the ALU, the control unit, the registers and the system buses), the Von Neumann stored-program concept, and the difference between Von Neumann and Harvard architectures.
An Eduqas Component 2 answer on computer architecture: the components of the CPU (ALU, control unit, registers), the address, data and control buses, the Von Neumann stored-program concept, and how Von Neumann differs from Harvard architecture.
Sources & how we know this
- WJEC Eduqas GCE AS/A Level Computer Science specification (from 2015) — Eduqas (2015)