A-level Computer Science revision · Processors, software and development

Virtual machines and caching

The idea

A virtual machine is software that emulates a computer, allowing one OS to run inside another or code to run on any hardware with the VM. Interpreters for intermediate code (such as Java bytecode) are process virtual machines. Caching stores frequently or recently used data in faster storage to speed up access.

  1. System VM: runs a whole OS. Process VM: runs intermediate code.
  2. Benefit: portability and testing; cost: slower than native.
  3. Cache: faster access, but data can become stale.

Watch out Code running on a virtual machine is usually slower than native code.

See it worked

Worked example

Why is Java compiled to bytecode?

  1. Bytecode runs on the Java virtual machine.
  2. Any device with a JVM can run it.
  3. So programs are portable.

Answer Bytecode is portable across any device with a JVM

Your turn

Question 11 mark

What is a disadvantage of running software on a virtual machine?

Choose one
Question 21 mark

What is a web browser cache used for?

Choose one
Question 32 marks

Give one use of a system virtual machine.

Write your answer, then see a model answer
  1. Name the use.
  2. Explain the benefit.

Answer Testing software on different operating systems on one physical computer, safely isolated from the host.

A-level Computer Science Pro, OCR H446

A-level Computer Science Pro

£119 once

Price rises to £199 on 1 January. Save £80 by joining before then.

At least 12 months of access

By paying you agree to our Terms and get access straight away, which ends your 14-day cancellation right.

No VAT is charged.

Independent practice for OCR A-level Computer Science (H446), not endorsed by OCR.

Privacy · Terms