Windows

Get IT Done: Track Windows XP's page file usage with System Monitor

Create a customized page file-monitoring console based on System Monitor and use it to track Windows XPs page file usage

Although Windows XP's System Monitor provides page file usage information, this data can be difficult to understand—even for the Windows expert. To help you make sense of the usage information you are presented with, here is how to create a customized page file-monitoring console based on System Monitor. The information you'll get from this console will put you in a better position to interpret the page file data presented by System Monitor.

Read more
If you missed my earlier articles on page-file usage, now is the perfect time to catch up:

Creating the console
Creating a page file console is a lengthy procedure, but it's fairly straightforward. To begin, access the Run dialog box from the Start menu and type Mmc in the Open text box.

When you see the empty console, pull down the File menu, select the Save command, name the console Page File Console.msc, and click the Save button. Then, right-click the Console Root folder, select Rename, and name the folder Page File Monitor.

Now, pull down the File menu and select the Add/Remove Snap-in command. When you see the Add/Remove Snap-in dialog box, click the Add button to open the Add Standalone Snap-in dialog box, as shown in Figure A.

Figure A


The Add Standalone Snap-in dialog box lists all of the snap-ins that are currently available for use in your custom console.

As you can see on this particular system, the ActiveX Control snap-in is selected by default. If it's not, go ahead and select the ActiveX Control snap-in.

To continue, click the Add button to launch the Insert ActiveX Control Wizard and then click Next. When you see the Control Category And Type page, leave the All Categories option selected in the Control category drop-down list. Then, scroll through the Control type list, and select System Monitor Control, as shown in Figure B.

Figure B


Once you launch the Insert ActiveX Control Wizard, you'll locate and select the System Monitor Control.

To continue, click Next. When you're prompted for a name, type Percentages and then click Finish.

When you return to the Add Standalone Snap-in dialog box, you'll repeat these same steps to launch the Insert ActiveX Control Wizard and access the System Monitor Control one more time. Only this time through, you'll name the control Log Viewer.

When you return to the Add Standalone Snap-in dialog box for the third time, scroll down the list, select the Performance Logs And Alerts snap-in, and click Add. Then, close the Add Standalone Snap-in dialog box and click OK to close the Add/Remove Snap-in dialog box. At this point, your custom page-file monitoring console should look like the one shown in Figure C. Before you continue, press [Ctrl]S to save your page-file monitoring console.

Figure C


When you complete the procedure, your custom page-file monitoring console will be ready to configure.

Configuring the monitor
Now that you've created your page-file console, you're ready to configure the monitor. To begin, select Percentages in the Page File Monitor tree and then click the Add button on the toolbar. When you see the Add Counters dialog box, select Paging File in the Performance object drop-down, and click the All Counters option button right below it. Then, choose the Select Instances For List option button and select the pagefile.sys entry, as shown in Figure D.

Figure D


When you see the Add Counters dialog box, you'll select the Paging File object and choose both the % Usage and % Usage Peak counters.

As you can see, this adds the % Usage and % Usage Peak counters to the Page File Monitor snap-in. These counters will present the current page file usage and the peak page file usage as percent values. I'll discuss these counters in more detail in a moment. For now, just click the Add button followed by the Close button.

To continue with the configuration procedure, select the Counter Logs item beneath the Performance Logs And Alerts snap-in. Then, click the New Log Settings button on the toolbar. When you see the New Log Settings dialog box, name the log Percentages Log and click OK.

You'll then see the log configuration dialog box, which has three tabs. On the General tab, click the Add Objects button. When you see the Add Objects dialog box, select Paging File from the Performance Objects list and click the Add button. Then, click the Close button.

You'll then need to specify a time interval for the logging process. While the default interval is set at 15 seconds, you'll probably want to use a larger interval, such as 15 minutes.

Next, select the Log Files tab and change the Log File Type setting to Text File (Tab Delimited). Leave all of the other settings as they are.

Now, select the Schedule tab and select the Manually option button in the Start Log panel. Leave all of the other settings as they are.

To complete the configuration procedure, click OK. Then, press [Ctrl]S to save your page file monitoring console and all of the configuration settings.

Monitoring the page file
Now that you've created and configured your page-file monitoring console, you can use it to track your page file usage. To begin, I suggest that you restart your system in order to clear the page file and begin your monitoring process with a clean slate. Once your system is up and running, access your Page File Console.

Starting a log
Of course you'll want to begin by starting a log. To do so, select the Counter Logs item beneath the Performance Logs And Alerts snap-in. Then, choose the Percentages Log and click the Start The Selected Log button on the toolbar. When you do, you'll see that the log icon changes from red to green to indicate that the log is running, as shown in Figure E.

Figure E


When the log file is collecting data, the icon is green.

Once you start the log, you should allow it to run for a sufficient amount of time in order to get a good reading of the average page file usage used throughout the day. However, keep in mind that, as with any monitoring operation, you really should run the Page File monitor for several days in order to accumulate a sufficient amount of data on which to base your page-file size decisions.

Now, while the log is collecting data, you can minimize your Page File Console or you can exit it. Either way, the log will continue collecting data until you actually stop it, which you do by selecting the Percentages Log and clicking the Stop The Selected Log button on the toolbar.

Current activity
If you want to keep an eye on the page file activity as you work, you can select Percentages in the Page File Monitor tree. When you do, you'll see that the monitor is already actively charting your page-file usage in the graph area. As you'll notice, the timer bar will be running very quickly. That's because, by default, the sampling interval is set at 1 second and the graph is set to use a default time period, called the Duration, of 1 minute 40 seconds. As such, you'll want to change the sampling interval.

To do so, click the Properties button on the toolbar. When you see the System Monitor Properties dialog box, locate the seconds text box on the General tab and change the value to something more appropriate.

For example, if you select a sampling interval of 15 seconds, the Duration of the data collection will extend to 25 minutes. Now, choose the Graph tab, and then select the Vertical Grid check box. Then click OK. Doing so will make the graph easier to analyze, as shown in Figure F.

Figure F


When monitoring the current activity, you'll get a better view of what is happening if you extend the sampling interval and enable the vertical grid.

As you can see, when I maximized the Page File Console window, each minute is now demarcated by a vertical bar, making it easy to follow the page file usage for the time period.

Viewing a log
At the end of the day, you can stop the log and view the data that it captured. To view the data, select the Log Viewer in the Page File Monitor tree. Then, click the View Log Data button on the toolbar. When you see the System Monitor Properties dialog box, the Source tab will be selected, and you'll click the Add button. Then, select the log file you want to view.

When you return to the Source tab, click the Time Range button. Then, drag the slider to set the time range you want to view. As you can see in Figure G, I've selected the total range for the period that I logged the page file usage.

Figure G


Once you load a log file into the Log Viewer, you can specify the time range that you want to view.

To continue, click the Data tab and then click the Add button to access the Add Counter dialog box. Once you do so, add the Paging File counters, as I explained earlier. Then click OK. When you do, you'll see a graph that represents the page file usage data that you logged, as shown in Figure H.

Figure H


When you load the log file into the Log Viewer, you can see the page file usage over the course of the specified time period.

Analyzing the graphs
As you can see in the example graphs shown in both Figures F and H, the graph ranges from 0 to 100 percent. In the case of these examples, the green line represents the % Usage Peak and the red line indicated the % Usage. As the page file size grows, both lines will climb together. As the size of the page file is reduced, the red line will dip while the green line remains at the same level.

As long as the % Usage Peak doesn't consistently reach or hover around 90 percent, your paging file is adequate. In fact, an ideal situation is to have the % Usage Peak hover around 70 percent. At that percentage, the majority of the file is being used and there's still room for heavier usage.

Analyzing the data
When you look at the example graphs shown in both Figures F and H, you'll see that the Maximum text box at the bottom of the graph shows the highest % Usage Peak value. If you wish to find the actual size of the page file, you can convert that percentage value into megabytes. To do so, you'll use the following formula:
Page File Size / 100 * Maximum Value = Actual Size

For example, on my test system, the page file size is set to 766 MB and the log file shows a value of 26 percent. So, applying the formula, I'd see that the maximum size of the page file during this time period was 199 MB. The formula being applied looks like:
766 / 100 = 7.66 * 26 = 199.16 MB

If this were to represent a typical day as far as computer usage goes, I'd have to say that the 766 MB is definitely wasting disk space that could be used for other purposes. I'd then recommend that you reduce the page file to a more appropriate size.

About

Greg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry.

0 comments

Editor's Picks