Update: Although this is an old article written for Windows 7, it still works on Windows 8 and Windows 10.
Whenever the computer is lagging or some application is taking too long to respond, we usually fire up task manager and look under the Performance tab or under Processes to check on processor utilization or the amount of free memory available. The task manager is ideal for real-time analysis of CPU and memory utilization. It even displays a short history of CPU utilization in the form of a graph. You get a small time-window, about 30 seconds or so, depending on how large the viewing area is.
However, 30 seconds is rather short to make any meaningful analysis of the performance of a process or the system as a whole. Some users lament that there is no data logging feature in Task Manager to plot CPU usage over a longer time duration. Truth is, the task manager isn’t meant to be used as a performance analysis tool. For this purpose there is another more powerful tool called Performance Monitor. It is a part of Windows and it has the ability to record CPU and memory utilization and a host of other parameters for a long period of time.
To launch Performance Monitor, press Win+R on your keyboard and in the Run dialog box type perfmon and press Enter.
To get an immediate and real-time view of CPU utilization, click on Performance Monitor on the left-hand Console Tree. The color scheme of the graph is different (red over white), but it is the same graph you can see under Task Manager.
To enable logging you have to create a new Data Collector Set. On the navigation panel on the left, expand Data Collector Set and right click on User Defined. From the New menu click Data Collector Set.
Give a name to the set that you can recognize later, and choose the radio button Create manually. Click Next.
Under type of data, choose Create Data Log and check the box Performance counter. Click Next.
Here I want to add a quick note on the different types of data log available and what each of them does.
- Performance counters are measurements of system state or activity. This option polls the requested parameters at specified time intervals and records the data returned.
- Event trace data only logs the event when something happens. The data is collected from trace providers, which are components of the operating system or of individual applications that report actions or events.
- Configuration information is collected from key values in the Windows registry. Windows Performance Monitor can record the value of a registry key at a specified time or interval.
Now is the time to choose the performance counters which you would like to log. Click on the Add button and choose one of the many available counters. You can log processor utilization, processor idle time or interrupt time, memory usage, USB activity and dozens of other counters. In this example, we chose Processor Time.
Adjust the poll interval. 5 seconds should do.
At this step, you can either click the Finish button or progress though the next few steps where you can specify the location of the log file or configure the Data Collector Set to run as a specific user.
Once the data set is created, run it. The Data Collector Set will start recording data from the chosen performance monitor, in our case, CPU utilization. Reports aren’t available when the data set is running. After you stop it, you can see your report under the Reports directory in the navigation panel.
Here is our CPU utilization graph recorded over a period of 3 minutes.
Aside from CPU utilization you can record memory usage, disk activity, network activity, system events, and several other things.
This is absolutely fantastic. I've been looking all over for a resource monitoring tool and this works just great. Thanks
I'm usually troubleshooting linux boxes and was looking for something like sar. Having this right out the box in Win7 is great. Thanks for the article, helped loads!
how to monitor multiple instances of IE 8 in Perfmon? IE 8 creates a new process every time a tab is created. will the new process will be automatically monitored?
I'm not sure about IE8's multiple processes monitoring. Why don't you try it out and report your findings here?
But I don't think processor time tells the CPU usage as I'm doing performance test. I googled it and somebody said there is a calculation between processor time and CPU usage.
Hi, How to view CPU Usage for a particular application instance or object
You will find that information in Resource Monitor. See this
Great. I finally found this useful article.
Thanks, Nice and straight to point tutorial.
Just wanted to second what everyone else is saying that this is a fantastic tutorial that exactly explained what I was looking for.
this is nice for cpu usage analysis on Windows 7 without other external tools.
You mentioned that we can see reports only when the collection is stopped? It means every time we have to stop it to see reports? This somehow does not sound user friendly.
Even though I've specified over all duration as 53 weeks, the data collection seems to be stopping at random; not able to trace why it had stopped. appreciate any support in this regard.
I'm using it right now
Thanks for this info, I have been using Linux for quite long time and use top cmd output to log the CPU, mem, swap, app usage, hdd I/o usage. But wonder how to log the data on windows to collect this info.
This is great. Thanks.
How we can use this to track the CPU performance for last 6 months ?
Currently its only capturing the current CPU utilization