Log to file the memory usage (Private Bytes) of a process
Solution 1:
The Performance Monitor MMC console (perfmon.msc) supports background data collection.
-
Open the "Data Collector Sets → User Defined" branch. Right-click to create a new set.
-
Select "Create manually". In the next page, choose "Create data logs" and enable "Performance counter" logging.
-
Click "Add Counter" and select "Process → Private Bytes" from the available counters list. You'll be able to select from running process names as "instances" of the counter.
(Note that if you have multiple processes with the same basename, they'll have individual instances named "foo#2", "foo#3" etc.)
-
Apparently that's what the C:\PerfLogs directory is for.
-
Select "Start this data collector set now".
-
After some time, right-click the collector set (the whole set, not the specific collector) and choose "Latest Report". This should open a scrollable graph, similar to the live "Performance Monitor" view.
(I don't know how well this works, I literally just figured out how to use it 15 minutes ago.)