|
|
|
|||||||
|
|
||||||||
|
|
|
|
|
|||||
|
||||||||
|
Memory BottlenecksInsufficient memory (Random Access Memory, or RAM) in a computer isone of the most common performance bottlenecks. It is usually more important than CPU speed, and often more importantthan disk speed. Of course, some systems have ample memory, some don't really need much. How can you tell if youhave a bottleneck? How much memory is enough? Ideally, you should have enough so that you never, or at least veryrarely, have to use the paging file (or swapfile). Very few people will achieve that ideal. The reason you wantto avoid using the paging file is that it is slow. When a program is entirely in the physical RAM where it belongs,the CPU can access the code at memory speed. When the memory is full and parts of the program get swapped out tovirtual memory (the paging file), the needed parts of the program have to be read back from the disk before theCPU can access them. Memory speed is measured in nanoseconds (ns, one billionth of a second).Most RAM is rated at 60 or 70ns. Disk access is measured in milliseconds (ms, one thousandth of a second). Mostdisk accesses take at least 8 ms. Fragmentation can dramatically increase this time because several disk accesseshave to be done to complete one I/O request. Also, if many I/O requests are being submitted at the same time, theI/Os may have to be queued, which means each I/O request has to wait its turn while the earlier ones complete.If an I/O request has to wait for five others to complete, then it takes six times as long to get the data. Ifyour machine is doing a lot of I/Os and you are not using the Diskeeper defragmenter, an I/O could take severalseconds to complete. Accessing code in RAM takes a few nanoseconds, certainly far lessthan one millisecond, but accessing code that has to be swapped in first will take at least 8 milliseconds, maybeseveral seconds, just to get it back into the RAM. Since one millisecond equals one million nanoseconds, you seewhy this can dramatically reduce your system's performance. So how can you find out how much memory you are using?Bring up Task Manager and click the Performance tab. This will showyou two real-time graphs, the CPU Usage History and the Memory Usage History (MUH). To the left of MUH is the MemoryUsage value. In the tool bar, click View, go to Update Speed and click Low, then click Options and make sure "AlwaysOn Top" is not checked. Stretch out the window to the full width of the screen. This gives you a graph ofabout 15 minutes length. Now go ahead and do your usual work (you can minimize Task Manager if you wish). Afterat least 15 minutes, bring the Task Manager window back. From the MUH you will see how much memory you actuallyused over the last 15 minutes. You may see the amount is greater than the amount of RAM installed. This means youhave been swapping memory to the paging file. You can also find out which processes are using the paging file. InTask Manager, click the Processes tab. In the menu bar, click View and Select Columns. Check the boxes for MemoryUsage and Virtual Memory Size. Now the list of processes will display how much RAM and how much virtual memoryeach process is using. The virtual memory is, of course, how much of the paging file this process is using. Ifthe only processes that are using the paging file are idle, that is, their CPU time is very low, then you haveenough memory, at least for the time period you are looking at. Leave the Task Manager running and check it periodically. If the amountof memory in use rarely or never exceeds the amount of physical RAM you have installed, you don't need more RAM.But if it's consistently higher, and you can't attribute the paging file usage to idle processes, then you havea memory bottleneck and should add as much RAM as is needed to exceed your typical memory use. You will most likelyget a very significant performance boost. While you are monitoring the memory usage, check out the other graph,CPU Usage History. If this is usually at or near 100%, you have a CPU bottleneck. In this case you definitely wouldbenefit from a faster CPU. The CPU upgrade would be more important than a memory upgrade because the computer justcan't do any more than it already is doing. Handling a memory bottleneck would free some CPU time, since the memoryswapping does use the CPU, but increasing the CPU speed will do more to improve performance because it will benefitall processes, not just the ones that are affected by swapping. In Summary:
If you don't have either bottleneck: More RAM will do you no good at all. A faster CPU, while it would likely speed up the system, may not makea noticeable difference. Your money would probably be better spent elsewhere, such as for fasterhard disks.
If you have any comments about this article orany requests for new technical articles e-mail
|
||||||||
|
|
Executive Software Europe |
|
||||||