Recipe 18.3. Using Memory More Efficiently


Problem

You find that your PC runs slowly because it runs up against its RAM limit, but rather than buy more RAM, you want to make the most out of the memory that you already have.

Solution

The Task Manager offers an excellent way to see how your RAM is being used. Then, based on what you uncover about RAM use, you can configure your system to make more effective use of the RAM that you have.

The Task Manager's Performance tab, shown in Figure 18-2, monitors your memory use. To get there, run the Task Manager by pressing Ctrl-Alt-Delete, then clicking the Performance tab.

The most important parts of the screen are the charts that report on Page File use and the tabular material below it that give a more detailed view of your current use of memory.

The charts relating to the Page File show current usage as well as usage over time. If Page File use is frequently high, it means that your system either isn't making the most efficient use of RAM, or you need more RAM. To make more efficient use of RAM, see the section "General Advice for Making Better Use of RAM" later in this recipe. The data below the Page File chart can be difficult to decipher. So use Table 18-1 to understand that data and, based on what you find, to make better use of RAM.

Table 18-1. Understanding Performance tab memory reporting

Category

Subcategory

What the data means

Totals

Handles

A handle lets a program use system resources such as Registry keys, fonts, and bitmaps. Sometimes poorly written programs don't close their handles down when the program closes, leading to memory loss. As a practical matter, you won't need to monitor this number.

 

Threads

A thread is a discrete portion of a program executing a single task independently of other parts of a program. Again, as a practical matter, you won't need to monitor this number.

 

Processes

This reports on the number of programs and services processes currently running on your system. Monitor this to see whether you have too many programs and services running on your PC. To shut down unnecessary services, see Recipe Recipe 18.8.

Commit Charge (K)

Total

The total amount of physical memory (RAM) and virtual memory (page file) currently in use, in kilobytes. The more programs, files and data you have open, the greater will be your commit charge. The greater the commit charge, the more demands put on your system. To reduce the commit charge, close programs and files, especially large files.

 

Limit

Reports on the total amount of physical and virtual memory that is currently available for your PC, measured in kilobytes. To increase the limit, you can increase the page file size or add RAM to your system.

 

Peak

Reports on the highest total amount of memory, measured in kilobytes, that has been in use during your current session. Check this value each session to see whether the peak value is frequently at or near the limit value. If it is, you need to increase your memory, either by adding RAM or by increasing your page file size.

Physical Memory (K)

Total

Displays the total amount of RAM in your PC, in kilobytes. This number can be confusing to find out the amount of RAM in megabytes, divide it by 1024.

 

Available

Reports on the total amount of RAM, in kilobytes, currently available. When available RAM is used up, your system begins to use its page file.

 

System Cache

Reports on the total amount of RAM, in kilobytes, that is being used for the most recently accessed data and programs. Programs and data can be in the system cache even after they have been closed down; the PC looks to the system cache first when opening a program or file, since it can be opened from the cache faster than from the hard disk.

Kernel Memory (K)

Total

The total amount of memory, in kilobytes, in use by the primary components of XP its kernel. The kernel is the core programs and files that make up the operating system.

 

Paged

The total amount of memory in a page file, in kilobytes, used by the primary components of XP.

 

Nonpaged

The total amount of memory of RAM, in kilobytes, used by the primary components of XP.


Here's how to use the information on the tab to make better use of RAM:

  • If the Total Commit Charge exceeds the Total Physical Memory, you probably need more RAM.

  • When the Commit Charge is regularly higher than the Physical Memory available, it means that you have to regularly use a Page File, which slows your system down. Buy more RAM it's relatively inexpensive and will boost system performance.

  • Before running a memory-intensive application, use the Processes Tab to identify memory-hogging applications, and close them down.

  • The Processes tab of the Task Manager lists every process and program in use, and shows the total amount of memory each uses. Click twice on the Mem Usage heading on the tab to reorder the list of programs and processes so that those that require most memory show up at the top. Close down programs that you don't really need before running a memory-intensive application.

  • If the Peak Commit Charge is frequently at or near the Limit Commit Charge, you need to increase your memory.

  • When this occurs, it means that your PC is frequently out of memory, or close to being out of memory. Either add RAM, or increase your Page File size.

General advice for making better use of RAM

The Task Manager can help you make better use of your RAM, as you've seen in the previous section of this recipe. But there is also some general advice you can follow for making better use of RAM as well.


Remove DLLs from cache memory

If you notice your system slowing down after XP has been running for some time, or if your RAM seems to be getting low, the culprit may be left-behind DLLs from programs that are no longer running but that XP still keeps in memory. Sometimes XP keeps DLLs in cache memory even when the program that required them is no longer running, and this cuts down on the memory available to other applications.

You can edit the Registry to have XP automatically remove DLLs from cache memory that are no longer needed by programs:

  1. Run the Registry Editor by typing Regedit.

  2. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer.

  3. Create a new DWORD value named AlwaysUnloadDll

  4. Give it a data value of 1.

  5. Exit the Registry and reboot in order for the new setting to take effect.

This Registry setting may cause problems with some programs. Some Windows programs especially older and 16-bit programs and Access may issue error messages with this setting in effect. If that starts happening, delete the key or give it a value of 0 (zero).



Reduce the number of colors

Using 32-bit color takes up a great deal more memory than 16-bit color, and additionally, puts a greater strain on your processor. If you primarily use business applications such as word processors and spreadsheets, you most likely won't notice a difference between 16-bit and 32-bit color, so going with 16-bit color is a good bet. To change your color depth, right-click on the desktop, then choose Properties Settings and in the Color Quality box, choose 16 bit.


Avoid DOS applications

DOS applications don't allow XP to manage memory properly and hold onto the memory they use; they don't allow it to be swapped out for use for other programs or processes. If you use any DOS applications, replace them with Windows versions.


Reduce the number of icons on your desktop

Every icon on your desktop uses up memory. Delete those you don't use regularly. Run the Clean Desktop wizard, which will automatically delete icons that you don't regularly use. To run it, right-click on the desktop and then choose Properties Desktop Customize Desktop Clean Desktop Now. The wizard will step you through the process of deleting unused icons. If you want the wizard to run every 60 days, check Run Desktop Wizard every 60 days.


Reduce applications and services running in the background

You may have many programs and services running in the background without realizing it. Look at your Notification Area for programs running that you don't require. Shut them down, and make sure that they don't load at startup. Also, XP frequently starts services on startup that you might not need. For example, if you don't use a wireless network card, you don't need the Wireless Zero Configuration service.

To see all the services running on your PC, run the Task Manager and click the Processes tab. That shows you all the programs and services currently running on your system. To close one, highlight it and then click End Process. If you're not sure what a process is, do a Google search on the filename you'll often out what the service is, what it does, and whether it's necessary to keep running.

Discussion

If your system doesn't have enough RAM, or uses what it has improperly, your system slows down. That's because in those circumstances, it moves data and programs to a paging file on your hard disk, and your hard disk is slower than RAM. A certain amount of this is normal, but if you use a paging file too much, or if even your paging file can't handle the memory load, you run into system slowdowns and problems.

As explained in this recipe, examining the paging file is one way to see whether you need more RAM or are making most effective use of what you have.

If after using the advice you find in this recipe, your system still runs sluggishly, and your paging file is used too much, there's only one solution to your problem: Install more RAM. RAM is relatively inexpensive, and installing extra RAM is one of the least expensive ways to give your system a performance boost.

See Also

For more information about using the Task Manager for troubleshooting, see Recipe 18.1. To turn off unnecessary services and programs that run on startup, see Recipe Recipe 18.9. And to make more effective use of a paging file (also called a swap file), see Recipe 18.5.



Windows XP Cookbook
Windows XP Cookbook (Cookbooks)
ISBN: 0596007256
EAN: 2147483647
Year: 2006
Pages: 408

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net