The Quest
for Lag Free Gaming - Part 1
At one time or another, all of us have complained of
too low or choppy frame rates at least once when we're
playing games. Low frame rates can be detrimental to the
gaming experience, particularly if it happens at that
critical moment when you've lined up for a frag and got
fragged instead by the one on your crosshair. Naturally, we
don't want any lag when playing games, so what can we do? A
lot actually, but we must know what cause these problems in
the first place.When most people complain about lag, they either mean too low frame rates or choppy frame rates (stuttering). Actually, they are very different from one another - low frame rates are often caused by the lack of performance from either the processor or graphics cards in your PC. On the other hand, stuttering can be caused by a number of different things. Solving low frame rates problems are relatively easy: either get a faster processor, graphics card or both. A less expensive solution will be to turn down the details and / or resolution of the game you're playing. Stuttering problems are harder to solve - it can be anything from a software bug, either in the drivers or the game itself, to something else entirely. That's why people are always telling you to update your drivers and games with the latest drivers and patches.
So, if even after updating your drivers and applying the latest patches, you still have stuttering - what's next? Barring software bugs and hardware problems, stuttering problems are often caused by the game taking too much time retrieving or fetching data it needs - either from the memory or hard disk. In short, that could mean your PC's memory is too slow or too small. In this article, we look at what we can do to eliminate memory-related stuttering and what's the best solution to have a lag free gaming rig.
A Little Background
First, let's talk a little bit about the PC. Most games and applications you're using (more so if you're using Windows) will be 32 bit in nature. In fact, only until recently did Microsoft release their 64 bit version of their desktop operating system - the Windows XP Professional x64 Edition. There are updated 64 bit binaries for your 32 bit games to be use with Windows XP x64 Edition, but most games are still 32 bit in nature (and don't really benefit much from going 64 bit). Since we're talking about memory, we need to know that a 32 bit application can address (or make use) of 4 GBs of memory. However, most PCs (still) don't come with that much memory - we usually only see PCs with 512 MBs or 1 GBs of memory. So how do they do it?Virtual Memory
Virtual memory, just like it's name, is not really 'real' memory. Instead, it is a file on your hard disk (or a partition in some cases) used as a placeholder to store data an application otherwise will store in main memory (RAM). It's works something like this: when an application runs, it will request a block of memory from the operating system, but it doesn't always use the entire block. When an application begin to fill the block with actual data and the amount of data is larger than the memory installed on your PC, the operating system will place that extra bits of data into virtual memory - a file on the hard disk. If (or more appropriately when) the application finally retrieves that extra data, the operating system will 'swap' the data in the memory with the one in the file. That's why we sometimes call virtual memory a swap file or page file.Virtual memory is a must have for every modern, multitasking operating systems. We usually run more than one program at one time, so we will need very large amounts of memory to run them all. Take a look at Windows XP. Even at idle, there are about 20 processes (small applications) running at the same time. These are all 32 bit applications, meaning they can address (or make use of) up to 4 GBs of memory. Without virtual memory (and some creative memory management), we have to install 20 x 4 GBs of memory - a total of 80 GBs of RAM just to have Windows run idle (it's an overly simplistic example). By using virtual memory and memory management, we can get by with much less than that - around 130 MBs. Now, that's a HUGE saving!
Virtual memory does have its limits and these limits can be very 'limiting'. Suppose you only have 512 MB of memory (in addition to virtual memory), but the game you're running is using up to 1 GBs of memory (or more). Even with virtual memory, there's only place for less than half of that in RAM. You'd have to put the rest of it in virtual memory. If the game needs to access all of them at once, the operating system must swap between the RAM and the page file. In this situation, the processor will be able to quickly process the data in memory, but it may have to wait until the rest of the data (in virtual memory) is swapped from the hard disk - the hard disk is much slower than RAM. That's when you'll notice a sharp drop in frame rates - a 'stutter'. Frame rates will go back up once the hard disk finished reading (or writing) and all the data processed. With larger amounts of data, the hard disk will have to spend more time accessing data, so the 'stutter' can take more time. The worst scenario in this case will be if the game needs to access all these data all the time, then the operating system must continually swap data between RAM and virtual memory.
You can see an example of that scenario (or something close to it) in the picture above. For those unfamiliar to games, that's Battlefield 2 running at the highest detail (high resolution texture and geometry) on a 512 MB system. While there is (barely) enough memory to run the game, frame rates does suffer with hard disk access when the operating system is swapping data between the memory and hard disk.
If you look at both pictures, you'll notice they have different number of processes (21 vs 19). Running less processes (or applications) may help, but not if the memory used by one application is way too big (in our example above, it's about 1 GB). That's why game developers usually recommend you to shutdown all other applications before playing their game. That way, the game will be free to use all available memory and processor time. However, in our case, that wouldn't help much. We simply need more RAM.
[Previous Page]
[Go to top]
[Next Page]