Problem
How do I troubleshoot high memory usage and memory performance issues?
Solution
Use Windows Task Manager to monitor memory
- Press CTRL+ALT+DELETE and select Task Manager.
- Click the Performance tab.
- Monitor the following over time:
- Under Physical Memory (K), check to see if the Available value decreases. If so, you might have a memory leak.
- Under Kernel Memory (K), observe changes in Paged and Non-paged memory to identify if it is a kernel paged or non-paged memory leak.
- If you identify a leak, click the Processes tab, and select View.
- Select Columns and enable the following:
- Page Faults
- Virtual Memory Size
- Paged Pool
- Non-paged Pool
- Handle Count
- Thread Count.
- In the Processes tab, click Mem Usage to bring the process using the most memory on the top.
NOTE: If you identify a process using high memory and not releasing it, use the following information to help troubleshoot the issue. You might also be requested to provide a process dump to help identify the cause.
PoolMon and PerfMon
For a more in depth and accurate analysis, run PoolMon and PerfMon at the same time.
For a more in depth and accurate analysis, run PoolMon and PerfMon at the same time.
PoolMon
IMPORTANT: This applies if you want to use PoolMon on Windows XP or earlier. You must enable Gflags.exe to enable pool tagging. Pool tagging is permanently enabled on Windows Server 2003 and later.
IMPORTANT: This applies if you want to use PoolMon on Windows XP or earlier. You must enable Gflags.exe to enable pool tagging. Pool tagging is permanently enabled on Windows Server 2003 and later.
- If you are using XP, enable pool tagging as follows. If you are using Windows 2003 or later, skip to Step 2.
- Enable pool tagging by using a dialog box:
- Click Start, Run, and type Gflags.
- In the dialog box, enable Enable Pool Tagging.
- Restart your computer.
- Enable pool tagging by using the command line:
- Click Start, Run, type cmd, and press ENTER.
- Type the following command and press ENTER:
gflags /r +ptg
- Restart your computer.
- Enable pool tagging by using a dialog box:
- Prepare to run PoolMon:
- Poolmon.exe is contained in Microsoft Windows Driver Kit (WDK). You can download the WDK from http://www.microsoft.com/download/en/details.aspx?id=11800.
- Install PoolMon on the computer you want to test, following the Microsoft product instructions.
- This example outlines a procedure for using PoolMon to detect a memory leak:
- Click Start, Run, type cmd, and press ENTER.
- Navigate to the PoolMon directory.
- Type the following command and press ENTER:
IMPORTANT: To obtain the most accurate results, follow the instructions below accurately. Starting PoolMon changes the data, therefore you must let it run until it reaches a steady state and the data is reliable.
poolmon -b -p -r -n <filename>.log
Let PoolMon run for at least few hours, sometimes it might need to run for few days.
- Stop PoolMon, wait for a 30 minutes, and then restart PoolMon.
IMPORTANT: Repeat this every 30 minutes for at least two hours.
- To be able to take multiple snapshots over time the below script can assist:
@ECHO off
:LOOP
ECHO %DATE %TIME% >>filename.log
Poolmon -b -p -r -n filename.log
Ping -n seconds 127.0.0.1 >NULL
GOTO LOOP
NOTE: for the seconds, McAfee recommends every 15 minutes.
- When data collection is complete, examine the following values for each tag, and note any that continually increase:
- Diff (allocations minus free bytes)
- Bytes (number of bytes allocated minus number of bytes freed)
- Examine the allocations that were increasing, and determine whether the bytes are now freed. Allocations that have still not been freed, or have continued to increase in size are the likely cause.
For more details on PoolMon usage, see http://msdn.microsoft.com/en-us/library/ff547083(v=vs.85).aspx.
PerfMon
PerfMon offers several methods to save captured data. However, McAfee uses Microsoft Binary Performance Log (BLG) format to troubleshoot performance issues.
PerfMon offers several methods to save captured data. However, McAfee uses Microsoft Binary Performance Log (BLG) format to troubleshoot performance issues.
Windows 7 users
- Click Start, Run, type cmd, and press ENTER.
- Type the following command and press ENTER:
perfmon
- Click Data Collector Sets, User Defined.
- Right-click User Defined, select New, and select Data Collector Set.
- Type a name (for example, McAfee <date_timestamp>), select Create manually, and click OK.
- Under Create data logs, only select Performance counter, and click Next.
- Click Add. In the next page from the drop-down list, select Processor, select <All instances>, and click Add.
- Select Memory from the drop-down list and select <All instances>, then click Add.
- Select Process from the drop-down list, and select <All instances> from the next drop-down list.
- Click Add, OK, Next, Next, then select Start this data collector set now, then click Finish.
Wait for the data to run long enough to capture the information and collect the log while reproducing the issue.- Right-click User Defined, select and right-click the <log name> and click Stop.
- Retrieve the log from C:\Perflogs\Admin\examplename\computername_date-time\DataColletor01.blg.
Windows XP users
- Click Start, Run, type cmd, and press ENTER.
- Type the following command and press ENTER:
perfmon
- Click Performance Logs and Alerts.
- Right-click Counter logs, and select New Log Settings.
- Type a name (for example, McAfee <date_timestamp>) and click OK.
- Click Add Objects, select Processor, and click Add.
- Select Memory, and click Add, Close, Add counters.
- Under Performance Object,, select process from the drop-down list.
- Select All counters and select All instances, Add, Close.
- Select Apply and click OK to continue.
Wait for the data to run long enough to capture the information and collect the log while reproducing the issue.- Click the Stop icon on the menu bar.
- Retrieve the log from C:\perflogs\logs.blg
No comments:
Post a Comment