• Aucun résultat trouvé

Optimizing and Troubleshooting Memory Performance

Dans le document Windows XP Professional (Page 141-144)

When the operating system needs a program or process, the first place it looks is in physical mem-ory. If the required program or process is not in physical memory, the system looks in logical memory (the page file). If the program or process is not in logical memory, the system then must retrieve the program or process from the hard disk. It can take thousands of times longer to access information from the hard disk than to get it from physical RAM. If your computer is using exces-sive paging, this indicates that your computer does not have enough physical memory.

F I G U R E 4 . 1 The main System Monitor window 4362.book Page 121 Wednesday, August 18, 2004 1:56 PM

122 Chapter 4 Monitoring and Optimizing System Performance and Reliability

F I G U R E 4 . 2 The expanded Performance Logs and Alerts snap-in

Insufficient memory is the most likely cause of system bottlenecks. If you have no idea what is causing a system bottleneck, memory is usually a good place to start checking. To determine how memory is being used, you need to examine two areas:

Physical memory The physical RAM you have installed on your computer. You can’t have too much memory. It’s actually a good idea to have more memory than you think you will need just to be on the safe side. As you’ve probably noticed, each time you add or upgrade applications, you require more system memory.

Page file Page file is the logical memory that exists on the hard drive. If you are using excessive paging (swapping between the page file and physical RAM), it’s a clear sign that you need to add more memory.

The first step in memory management is determining how much memory your computer has installed and what the appropriate memory requirements are based on the operating system requirements and the applications and services you are running on your computer.

In this book, we use the following format for describing performance object counters: performance object > counter. For example, Memory > Available MBytes denotes the Memory performance object and the Available MBytes counter.

Key Counters to Track for Memory Management

Following are the three most important counters for monitoring memory:

Memory > Available MBytes Measures the amount of physical memory that is available to run processes on the computer. If this number is less than 4MB, it indicates that you have an

Monitoring, Optimizing, and Troubleshooting Performance 123

overall shortage of physical memory for your computer, or possibly, that you have an applica-tion that is not releasing memory properly. You should consider adding more memory or eval-uating application memory usage.

Memory > Pages/Sec Shows the number of times the requested information was not in mem-ory and had to be retrieved from disk. This counter’s value should be below 20; for optimal per-formance, it should be 4 or 5. If the number is above 20, you should add memory or research paging file use more thoroughly. Sometimes a high Pages/Sec counter indicates a program using a memory-mapped file.

Paging File > % Usage Indicates the percentage of the allocated page file that is currently in use. If this number is consistently over 70 percent, you may need to add more memory or increase the size of the page file.

These counters work together to show what is happening on your system. Use the Paging File >

% Usage counter value in conjunction with the Memory > Available MBytes and Memory > Pages/

Sec counters to determine how much paging is occurring on your computer.

If you suspect that one of your applications has a memory leak (a memory leak happens when a program uses an area of memory and when done does not release it to be used by other programs), you should monitor the following counters:

Memory > Available Bytes

Memory > Committed Bytes

Process > Private Bytes (for the application you suspect is leaking memory)

Process > Working Set (for the application you suspect is leaking memory)

Process > Handle Count (for the application you suspect is leaking memory)

Memory > Pool Nonpaged Bytes

Memory > Pool Nonpaged Allocs Managing the Windows XP Page File

Typically, if your computer is experiencing excessive paging, the best way to optimize memory is to add more physical memory. However, there are some other options for managing the pag-ing file for better performance. They include

Spreading the page file across multiple hard disks, which allows the disk I/O associated with paging to be spread over multiple disk I/O channels, for faster access.

Increasing the size of the page file if you have sufficient disk space. By default, Windows XP Professional creates a page file (pagefile.sys) that is 1.5 times the amount of physical memory that has been installed on your computer. You would want to consider increasing the page file size if the Paging File > %Usage counter was near 100%.

Here are the main counters for tracking page file usage:

Paging File > %Usage

Paging File > %Usage Peak (bytes)

4362.book Page 123 Wednesday, August 18, 2004 1:56 PM

124 Chapter 4 Monitoring and Optimizing System Performance and Reliability

If a paging file reaches the maximum size, the user will see a warning displayed and the system might halt. This is another reason to monitor the page file and increase the size.

Tuning and Upgrading Memory

If you suspect that you have a memory bottleneck, the following options can be used to tune or upgrade memory:

Increase the amount of physical memory that is installed on the computer.

If your computer has multiple disk channels, create multiple page files across the disk channels.

Verify that your paging file is sized correctly.

Try to run less memory-intensive applications.

Try to avoid having your paging file on the same partition as the system files.

Dans le document Windows XP Professional (Page 141-144)