20

I have seen this question asked on here before but was unable to follow the answer which was given. I would like to monitor a processes CPU, Memory, and possibly GPU usage over a given time. The data would be useful if presented in a graph.

It would be nice if I could do this using Performance Monitor, but I am open to alternative solutions as well. I have tried using Performance Monitor and my problem is that I'm not sure which performance counters to use since there are so many. I've been looking at a Process, Processor, Memory, etc. but I'm not sure which counters within those categories will be of interest to me. My OS is Windows 7.

2
  • 1
    How about the graph column in Process Explorer? Commented Aug 7, 2012 at 1:28
  • I'll have a look at the CPU History column in Process Explorer. Does this program have something similar for Memory History, and GPU History though? Additionally, it may be useful to have something larger in size and more permanent. Commented Aug 7, 2012 at 5:14

2 Answers 2

14

To monitor memory on the system (or for specific processes):

  • Open Performance Monitor (control panel -> administrative tools)
  • Add Counters
  • Expand "Process"
  • Select "Private Bytes"
  • Select the processes to monitor in the "Instances of selected object" the hit Add, or just hit Add for the entire system
  • Ok

That's what I've found so far... however getting the graph to look reasonable still eludes me!

7
  • 1
    "Private Bytes" is virtual memory, not RAM, and only per-process private v.m. at that. Commented Mar 12, 2015 at 7:03
  • What's Process Monitor? There's no "Add Counters" in Activity Monitor, if you mean that! Commented May 6, 2015 at 15:06
  • 1
    @Noldorin ahhh sorry about that, I meant "Performance Monitor", I've edited the answer to reflect that... can't believe that mistake went unnoticed for that long! Commented May 11, 2015 at 6:40
  • You have to modify scale factor and on the graph min and max value to see the values inside the graph area. Commented Nov 25, 2019 at 14:19
  • Anyway to export to a log file? Commented May 12, 2020 at 17:13
0

So, @paul-carroll answered part of my question but the answer was incomplete.

When looking for a user-mode memory leak, the Private Bytes counter indicates the total amount of memory that a process has allocated, not including memory shared with other processes. The Virtual Bytes counter indicates the current size of the virtual address space that the process uses. Some memory leaks appear in the data file in the form of an increase in private bytes allocated. Other memory leaks show up in the form of an increase in the virtual address space. So you should monitor both Private Bytes and Virtual Bytes.

To monitor memory for specific processes:

  • Open Performance Monitor (press Win+r, type perfmon into Run, OK)
  • Select Performance Monitor on the left sidebar
  • Add Counters (green plus sign above the graph)
  • Expand "Process"
  • Select "Private Bytes"
  • Select the processes to monitor in the "Instances of selected object" then hit Add
  • Repeat for "Process" > "Virtual Bytes"

To monitor CPU usage:

  • Repeat "Process" > "%Processor Time"

To monitor GPU usage:

  • Add "GPU Process Memory" > "Dedicated Usage". You will need the process id, which you can get from Task Manager or Process Explorer.
  • OK

Note: the Private Bytes, Virtual Bytes, and %Processor Time numbers will differ from what you see in Task Manager, but they will agree with what you see in Process Explorer.

If the graph doesn't display the data to your liking, double-click an item in the table below the graph and change settings such as line width, scale, vertical minimum/maximum, etc.

You can also create a User Defined Data Collector Set to record the data and save it as a csv:

  • Right-click Performance Monitor in the left sidebar
  • New > Data Collector Set
  • Follow the wizard to name your set and select a save location
  • Leave it as and choose to either save or start and click Finish
  • To save as csv, use the left sidebar to go to Data Collector Sets > User Defined > YourDataSet
  • Double-click System Monitor Log and change Log format: from binary to Comma Separated
  • OK
  • Select YourDataSet in the left sidebar and press the green play button to start the Data Collector Set

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.