Skip to main content

Performance Monitor (PerfMon) Guide: How to Test Desktop Application Performance

 

Performance Monitor (PerfMon) - Detailed Guide for Desktop Application Performance Testing  




1. What is Performance Monitor (PerfMon)? 

- Performance Monitor (PerfMon) is a built-in Windows tool that allows users to monitor system performance in real time and analyze performance metrics. It helps track system resources such as CPU, memory, disk usage, and network activity. 

- This tool is especially useful for diagnosing performance issues in applications, including desktop applications, by identifying resource consumption and bottlenecks. 

2. How Does Performance Monitor (PerfMon) Work? 

- PerfMon works by collecting system and application performance data using counters. These counters provide real-time data on various system resources such as: 

  • Processor Usage (CPU utilization, threads, and context switching) 

  • Memory Usage (RAM consumption, page faults, and working set) 

  • Disk Activity (Read/Write speed, disk queue length) 

  • Network Activity (Bandwidth usage, packet loss) 

  • Application-Specific Performance (Handles, Threads, GDI objects, private bytes) 

 

PerfMon can display this data in: 

 

  • Live Graphs (for real-time monitoring) 

  • Reports (for detailed analysis) 

  • Logs (for historical analysis) 

 

3. Can We Use PerfMon for Desktop Application Performance Testing? 

 

Yes! PerfMon is an effective tool for monitoring desktop application performance because it helps in: 
✅ Identifying CPU, memory, and disk usage of the application 
✅ Detecting memory leaks and resource consumption issues 
✅ Measuring application response times and efficiency 
✅ Analyzing performance trends over time 
✅ Finding bottlenecks in the system 

 

4. How to Measure Application Performance Using PerfMon? 

 

To measure the performance of a desktop application using PerfMon, follow these steps: 

 

Step 1: Open Performance Monitor 

 

  • Press Win + R, type perfmon, and press Enter 
  • The Performance Monitor window will open 


Step 2: Create a New Data Collector Set  

  • In the left panel, expand Data Collector Sets 
  • Right-click User Defined → Select New → Click Data Collector Set 
  • Enter a name (e.g., "AppPerformanceTest") and click Next 
  • Select Create manually (Advanced) and click Next 

Step 3: Add Performance Counters for Your Application 
  • In the Performance Monitor window, click Performance Monitor in the left panel 
  • Click the Green ‘+’ icon (Add Counters) 
  • Choose counters based on what you want to measure: 
  • Processor% Processor Time → Monitors CPU usage 
  • MemoryWorking Set - Private → Tracks RAM usage of the application 
  • ProcessHandle Count → Measures resource usage 
  • ProcessThread Count → Monitors number of active threads 
  • DiskDisk Read/Write Bytes/sec → Measures disk I/O 
  • NetworkBytes Sent/Received → Tracks network usage 
  • Click Add, then OK 

Step 4: Configure Data Logging (Optional - For Detailed Reports) 

  • In Data Collector Set, right-click your test set → Select Properties 
  • Go to the Stop Condition tab → Set the duration (e.g., 10 minutes) 
  • In the File Tab, select CSV format for logs 


Step 5: Start Performance Monitoring 

  • - Go to Performance Monitor 

  • - Right-click your Data Collector Set → Click Start 

  • - Launch your desktop application and perform test activities 

  • - After testing, return to PerfMon and Stop the Data Collector 




Step 6: Analyze Performance Data 

  • - Go to ReportsUser Defined → Select your test 

  • - Review CPU, memory, disk, and network usage graphs 

  • - Identify performance bottlenecks such as high CPU usage, memory leaks, or disk slowdowns 




Key Metrics to Observe in Performance Monitoring (PerfMon) Reports:  

When analyzing PerfMon (Performance Monitor) reports, it's crucial to focus on key performance indicators (KPIs) to identify performance bottlenecks, memory leaks, high CPU usage, or inefficient resource management. Below is a detailed breakdown of the key metrics to observe and their significance. 

1. CPU Usage (Processor Performance) 

Counters to Monitor: 

  • Processor → % Processor Time 

  • Process → % Processor Time (specific to your app) 

  • Processor → Processor Queue Length 

What to Look For: 

  • % Processor Time: Should ideally be below 80% for smooth performance. If it's consistently high, the app may be CPU-intensive. 

  • Processor Queue Length: If >2 per CPU core, it means the processor is overloaded. 

  • CPU Spikes: Sudden spikes indicate inefficient processing, excessive loops, or unoptimized background tasks. 

Possible Issues: 

  • High CPU usage = Inefficient algorithms, infinite loops, excessive background tasks 

  • CPU spikes = Poorly optimized queries, real-time calculations, or excessive logging 


2. Memory Usage (RAM Consumption) 

Counters to Monitor: 

  • Process → Working Set - Private (Memory used by the application) 

  • Memory → Available MBytes (Remaining system memory) 

  • Memory → Page Faults/sec (Swapping between RAM and disk) 

What to Look For: 

  • High Working Set - Private: If it keeps increasing over time, there might be a memory leak. 

  • Available MBytes: Should not drop below 500MB, or the system may slow down. 

  • Page Faults/sec: High values indicate insufficient RAM or excessive swapping. 

Possible Issues: 

  • High RAM consumption = Memory leaks, improper garbage collection 

  • Low Available Memory = Application using more RAM than expected 


3. Disk Usage (Disk Read/Write Speed) 

Counters to Monitor: 

  • Logical Disk → % Disk Time (Utilization of the disk) 

  • Logical Disk → Disk Read Bytes/sec & Disk Write Bytes/sec 

  • Process → IO Data Bytes/sec (I/O operations of the application) 

What to Look For: 

  • % Disk Time should not be consistently above 80%, or the disk is under heavy load. 

  • High Disk Read/Write Bytes may indicate excessive logging, database queries, or file handling. 

Possible Issues: 

  • Slow app loading time = High Disk Read/Write due to unoptimized file handling 

  • High disk usage = Unnecessary logging, inefficient database queries 


4. Network Performance (Bandwidth & Connectivity) 

Counters to Monitor: 

  • Network Interface → Bytes Sent/sec & Bytes Received/sec 

  • Process → IO Other Bytes/sec (Includes network traffic) 

  • TCPv4 → Connection Failures (Tracks dropped connections) 

What to Look For: 

  • High Bytes Sent/Received = Application is using too much bandwidth. 

  • Connection Failures should be close to zero to avoid connectivity issues. 

Possible Issues: 

  • Slow network performance = Too many requests, large file transfers 

  • Connection failures = Poor network handling, frequent API timeouts 


5. Thread & Handle Count (Application Stability) 

Counters to Monitor: 

  • Process → Thread Count 

  • Process → Handle Count 

What to Look For: 

  • Thread Count: Too many active threads (e.g., >200) can slow down the application. 

  • Handle Count: If it keeps increasing without dropping, it indicates a resource leak. 

Possible Issues: 

  • High thread count = Too many background processes running 

  • High handle count = Resource leak, inefficient process handling 


6. Application Response Time (Performance Delays) 

Counters to Monitor: 

  • System → Context Switches/sec (Tracks multi-threading efficiency) 

  • Processor → % Privileged Time (Time spent on OS-related tasks) 

  • Process → Elapsed Time (Total runtime of the application) 

What to Look For: 

  • High Context Switches/sec: If it is too high (>10,000 per second), it means too many processes are competing for CPU time. 

  • High Privileged Time: If the app is spending too much time in system-level operations, it may indicate inefficient API calls. 

Possible Issues: 

  • Slow UI response = Too many context switches or high privileged time 

  • High OS-level processing = Inefficient system interactions 


7. Garbage Collection (For .NET Applications) 

Counters to Monitor: 

  • .NET CLR Memory → % Time in GC (Time spent in garbage collection) 

  • .NET CLR Memory → Gen 0/1/2 Collections 

What to Look For: 

  • % Time in GC should be <5%: If it's high, garbage collection is consuming too much CPU time. 

  • Frequent Gen 2 Collections: Indicates memory pressure and possible memory leaks. 

Possible Issues: 

  • High GC time = Inefficient memory allocation, excessive object creation 

  • Frequent garbage collection = Too many short-lived objects 

 

Comments

Popular posts from this blog

Top Software Testing Trends In 2024

Watch out the Top Software Testing Trends that one should anticipate in the year 2024. 👉 Agile and DevOps Organizations have embraced Agile as a response to rapidly changing requirements and DevOps as a response to the demand for speed. DevOps involves practices, rules, processes, and tools that help to integrate development and operation activities to reduce the time from development to operations. DevOps has become a widely accepted solution for organizations which are looking at ways to shorten the software life cycles from development to delivery and operation. The adoption of both  Agile and DevOps  helps the teams to develop and deliver quality software faster, which in turn is also known as “Quality of Speed”. This adoption has gained much interest over the past five years and continues to intensify in the coming years too. 👉   Test Automation In order to implement DevOps practices effectively, software teams cannot ignore test automation as it is an essenti...

A Beginner’s Guide to Desktop Application Testing (With Examples)

  Starting with Desktop Application What is a Desktop App? A Desktop Application (Desktop App) is a software program designed to run on a personal computer (PC) or laptop within an operating system like Windows, macOS, or Linux. Unlike web applications that run in a browser, desktop apps are installed on a computer's local storage and run directly on the operating system. Types of Desktop Applications Standalone Applications – Work without an internet connection (e.g., MS Paint, Notepad). Client-Server Applications – Require internet or a network to function (e.g., Microsoft Outlook, Skype). Hybrid Applications – Work both online and offline with cloud integration (e.g., OneDrive, Dropbox). Examples of Desktop Applications Utility Software: CCleaner, PC Optimizer Productivity Apps: Microsoft Word, Excel Media Players: VLC, Windows Media Player Development Tools: Visual Studio, Eclipse What is Desktop Application Testing? Desktop Application Testing is the process of evaluati...

Continuous Testing in an Agile and DevOps world

 ✏ Continuous Testing....📝 👉 With the increase in the quality of software application and hardware platforms, new digital transformations are happening, creating a competitive advantage for organizations. Indeed, with both Agile and DevOps being integrated into businesses to stay up to speed, continuous integration (CI), continuous delivery (CD), and continuous testing (CT) have become the key elements in driving quality digital transformations. 👉 Continuous testing has thus become vital in software testing. Integrating code changes is essential in the software delivery life cycle and there is now pressure for enterprises to innovate and change. Agile and DevOps with continuous testing can offer the framework to address these requirements as well as deliver software quickly and with quality. ✏ Why have Continuous Testing ??👀 💡 Continuous Testing is a software testing type that involves testing the software at every stage of the software development life cycle. The goal is to e...