You might think that modern PCs have more than enough memory. Even budget systems come with at least 2GB, and you can add 2GB more from as little as £20. 4GB of RAM should be enough for everyone, right?

Well, maybe not. Windows Vista needs 2GB to run properly, and large apps can swallow up a gigabyte more with ease. You can very quickly find that your 2GB system is grinding to a halt. Installing another 2GB may not make much difference. Very few 32-bit systems are able to access the full 4GB of memory – some can use less than 3GB. And upgrading to 64-bit Windows doesn't always help.

Fortunately, there is one way to deliver guaranteed results. Learn just a little about how Windows and your applications use memory and you can begin to fine-tune your PC, reducing RAM wastage, making more efficient use of system resources and hopefully delivering a real and lasting improvement to your system's performance.

Memory basics

Most 32-bit Windows systems can address a maximum of 4GB RAM. This isn't the CPU's fault: modern processors have a 36-bit address mode that allows them to access up to 64GB of RAM.

Software has to be aware of these 36-bit addresses, though: if not, they'll truncate them to 32-bit and read and write data in the wrong place. That's one reason why Microsoft restricted all the 32-bit client versions of Windows to a maximum 4GB of RAM.

That 4GB address space is split into two. Windows and your drivers get 2GB to themselves, and Windows fools each of your applications into thinking that it has sole access to the other 2GB. You could have five programs running at the same time, each using between 1 and 2GB of memory, so the 4GB figure isn't quite the limit it seems at first.

Memory is allocated in units called pages, usually 4KB in size, which are tracked in the PFN (Page Frame Number) database. If you have 2GB of RAM but your programs need to use 3GB, Windows will find pages in physical memory that haven't been accessed recently and write them to a paging file on your hard drive. The physical RAM is then freed up for use by the latest program you're running. This mechanism lets you bypass the 4GB address space limit and run many more applications, but there's a price to pay.

It takes much longer to access a hard drive than actual RAM, and so the more use is made of your paging file, the slower your system will get. For more on Windows memory fundamentals, visit the Windows Server Performance Team blog at http://blogs.technet.com/askperf and select the 'Memory Management' category.

Working sets

Task Manager is a useful tool for discovering how your PC is using RAM. Press [CTRL]+[Shift]+[ESC] to call it up, and select the Processes tab to see what's running. Then click 'View | Select Columns', check 'Memory – Working Set' and 'Memory – Private Working Set', and click 'OK'.

If you're running Windows XP then you won't see these options. We recommend downloading Process Explorer instead. Click 'View | Select Columns | Process Memory' and check 'Working Set Size' and 'WS Private Bytes' to see the same information.

You'll now see information on the working set, which is the amount of physical memory owned by each running program. The total working set figure can be misleading, however, as it may contain RAM shared by other processes.