Basic PC Tips

Disk Space and Memory Explained

There is often confusion between memory and disk storage and I have often heard people talk about their computer running out of memory when the disk is full.

This mistake is understandable and highlighting it may appear to be picky! However, it helps to understand the difference if you experience problems with your computer and need to speak to support personnel.

Memory is an integral part of a computer system and the main processor(CPU), which is the part of a computer that does most of the work, can directly manipulate any information in it. A Hard Disk Drive is external to the CPU (although it is housed in the same computer case) and the CPU cannot directly access it. In order for the CPU to work on information stored on a Hard Disk Drive that information must first be moved into memory.

A Hard Disk drive is used for long-term storage, while memory temporarily holds the information that the CPU is currently working with.

The following helps to explain the concept more clearly.

It helps of you think of your computer as an office. The memory is equivalent to your office desk and the Hard Disk Drive to the office filing cabinet.

In order to work on a document it needs to be on the desk - the same is true for a computer, in order for the CPU to work with a document or file it needs to be in memory.

When you have finished working on a document you store it in the filing cabinet - when you have finished creating or editing a document on your computer you save it onto the Hard Disk Drive.

If you are working on many documents it is easier and faster if you have a large desk - if your PC has many files open or running multiple programs it needs plenty of memory.

If your filing cabinet is full of old documents, you need to discard unwanted ones … or buy a larger filing cabinet! - If your Hard Disk Drive is full you should delete or archive unwanted documents … or buy a larger Hard Disk Drive!

Unfortunately, things aren't quite as simple as I've described above.

In reality, the amount of information that the computer is working on is very likely to be much larger than can fit in the available memory ... and to get around this problem the operating system will create a swapfile (also called a pagefile or virtual memory).

The swapfile is an area of the Hard Disk Drive that is used by the computer as an overflow area when it runs out of room in memory. When this happens, information in memory that hasn't been used for a while will be moved onto the Hard Disk Drive, into the swapfile. When the processor needs this information it will be moved back into memory and another piece of information will be moved to the swapfile to create room (this is why it is called a swapfile).

While the process of writing information to the Hard Disk Drive appears to be quick, it is in fact thousands of times slower than writing to memory, so the more information that has to be swapped out to the swapfile the slower your computer will appear. This is why you will often be advised to increase the memory of your computer to improve performance (in this situation increasing the size of the Hard Disk Drive will make no difference!)

Think of this process as being an invisible helper who continuously keeps your desk tidy by swapping the documents you are working on between your desk and your filing cabinet.

You do not need to concern yourself with the swapfile. However, it is useful to know about in two situations:

  1. If the computer needs more memory, Windows will detect this and display a message telling you that it is increasing the size of virtual memory (it may use one of the other terms above).
  2. If your Hard Disk Drive starts to get full your PC will behave erratically - slowing down, having errors etc. caused by the fact that there is insufficient free space for the swapfile. This is unlikely in modern computers that have large Hard Disk Drives. However, if your computer does start having problems it is always a good idea to check that you have available space on the Hard Disk Drive (generally drive C:).