C# Tutorials - Herong's Tutorial Examples - v3.31, by Dr. Herong Yang
Memory Report from Performance Console
This section provides a tutorial example on how to use Performance console in Control Panel to verify memory usage numbers reported by the System.Diagnostics.Process class.
Another way to verify memory usage numbers reported by the System.Diagnostics.Process class is use the Performance console in Control Panel.
1. Run the tutorial example program used in the previous section, LongSleep.exe.
Current process: System.Diagnostics.Process (LongSleep) Private Memory: 8740864 Virtual Memory: 89157632 Working Set: 5591040 Paged Memory: 8740864 Paged System Memory: 100228 Non-paged System Memory: 3988
2. Click "Start" > "Control Panel" > "Performance and Maintenance" > "Administrative Tools" > "Performance". The "Performance" console shows up.
3. Click the Add icon or press <Ctrl>-I, The "Add Counters" dialog box shows up.
4. Select "Process" in "Performance object:" field. Select "LongSleep" in "Select instances from list:". Check "All counters" checkbox. Click "Add" button and "Close" button.
5. Click the Report icon or press <Ctrl>-R.
Memory usage numbers reported for LongSleep are:
Process: LongSleep Page File Bytes: 8884224 Pool Nonpaged Bytes: 3860 Pool Paged Bytes: 100364 Private Bytes: 8884224 Virtual Bytes: 89227264 Working Set: 6045696
6. Compare the program output and the "Performance" console report, we can map "Performance" console values to System.Diagnostics.Process properties:
Performance console System.Diagnostics.Process Page File Bytes = ? Pool Nonpaged Bytes = Non-paged System Memory Pool Paged Bytes = Paged System Memory Private Bytes = Private Memory Virtual Bytes = Virtual Memory Working Set = Working Set
Table of Contents