C# Tutorials - Herong's Tutorial Examples - v3.32, by Herong Yang
Private/Virtual Memory and Working Set
This section describes 3 basic memory usage numbers of a running process: private memory, virtual memory and working set.
From the previous tutorial, we learned how to retrieve memory usage statics using methods and properties of the System.Diagnostics.Process class. Now let's try to understand first 3 memory usage numbers:
"Private Memory", returned by the "PrivateMemorySize64" property, representing the amount of RAM allocated privately to the process. In general, "Private memory" does not include any memory occupied by shared DLL files used by the process.
"Virtual Memory", returned by the "VirtualMemorySize64" property, representing the total virtual address space of the process.
"Working Set", returned by the "WorkingSet64" property, representing the portion of the "Virtual memory" that is currently resident in RAM and can be reference without a page fault.
Run the MemoryUsage.exe created from the previous example again, you will see:
Current process: System.Diagnostics.Process (MemoryUsage) Private Memory: 8744960 Virtual Memory: 89157632 Working Set: 5599232 Paged Memory: 8744960 Paged System Memory: 100228 Non-paged System Memory: 3988
Now we know how read those numbers:
Table of Contents
Logical Expressions and Conditional Statements
Visual C# 2010 Express Edition
C# Compiler and Intermediate Language
Compiling C# Source Code Files
MSBuild - Microsoft Build Engine
Using "Process" Class to Show Memory Usages
►Private/Virtual Memory and Working Set
Footprints of Private and Shared Memories
Memory Report from Windows Task Manager
Memory Report from Performance Console
System.Diagnostics.FileVersionInfo Class
WPF - Windows Presentation Foundation