# Process Monitor



## FordGT90Concept (Jan 24, 2010)

*Process Monitor is no longer supported nor updated because of changes to Windows itself ("Error VSP1478: Performance counters are not supported on virtual or Hyper-V enabled machines. Please use a non-virtual machine or disable Hyper-V"). When this is the case, the processor graph won't load at all. Process Explorer by Sysinternals (owned by Microsoft) is probably the best substitute.*

This simple application records how many handles and how much memory an application is using every second.  You can type in a process name (for when the process will be started soon) or select an already running process from the drop down box.  Click start and it will start to monitor it; click stop to halt monitoring.







If the application closes, it will stop updating so you can see if the handle limit (default 10,000) or memory limit (2 GiB 32-bit, 4 GiB 32-bit Large Address Aware) is exceeded.  These are things you can address to perhaps stop it from crashing.

If you wish to to use a Process Identification number (PID), use # followed by the number wherever it requests a name (commandline or in the "Process" field).  For example, if you want it to monitor the PID 812, enter #812 and click start.


To increase the handle limit, you must increase the registry key:

```
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\USERProcessHandleQuota
```


Command line arguments:


Argument|Purpose|Example
process_name|Enters the given name in the Process dropdown box.|csrss
/s|Automatically starts monitoring the process named.  This will not work without providing a process name.|csrss /s

It requires .NET Framework 3.5 or newer to run.


Version History:
1.0.4 - Fixed a minor bug where Max Cores could exceed the number of cores in the machine.
1.0.3 - Added Processor graph/stats and ability to directly input a PID (via #134).
1.0.2 - Added launch arguments (detailed above).
1.0.1 - Displays the start time of monitor and how long the monitor observed the process on stopping.
1.0.0 - Original release.


----------



## MRCL (Jan 24, 2010)

You da man, man! This is just what I need.


----------



## Kreij (Jan 24, 2010)

Good Job Ford 

You can also download SysInternals Process Monitor if you need more in-depth information.


----------



## FordGT90Concept (Jan 24, 2010)

Heh, I could display all that info about a specific process.  The reason why I don't is because that requires querying the Main Module which is a drag on performance when performance is important (gotta keep those graphs running ).

I haven't found an app that does what this does (finds maximum memory usage and maximum handles over a period of time).


----------



## Kreij (Jan 24, 2010)

Yes, there are definitely advantages to having light weight apps and utilities that have very specific functionality.


----------



## W1zzard (Jan 24, 2010)

am i missing something ?


----------



## FordGT90Concept (Jan 24, 2010)

When the app terminates, that number isn't stored, nor the trends leading up to it.  If an application closes because it requested 2+ GiB you can only guess that is in fact what happened.  Unless, of course, this is running at the same time watching it.


----------



## Mussels (Jan 25, 2010)

sweet little app.


Yse w1zzy, we know about task manager  this gives you a timeline/graph


----------



## FordGT90Concept (Feb 5, 2010)

1.0.1 released.  It displays how long the process monitor was observering a process on stop/close.


----------



## regexorcist (Feb 5, 2010)

I know my system is different, but I use Conky
which provides all the functionality you want
including any customization and it's very light on resources. 

Both Conky and Gkrellm are very popular system monitors
in the Linux world.
http://conky.sourceforge.net/screenshots.html
http://www.lynucs.org/?gkrellm


----------



## FordGT90Concept (Feb 5, 2010)

That doesn't graph memory usage (or handles for that matter) nor keep record of the highest memory usage observed.


----------



## regexorcist (Feb 5, 2010)

You miss the point
I graphs or lists percentages or actual numbers
of ANYTHING you want
It has 2 pages of variables
and functions and executes your own scripts


----------



## FordGT90Concept (Feb 5, 2010)

This works with two clicks (or type and one click), no thinking/programming required.


----------



## regexorcist (Feb 5, 2010)

very good, but mine runs when the system is brought up.
no clicking 

Yes there is initial configuration which can be difficult 
but with flexibility come configuration.


----------



## regexorcist (Feb 5, 2010)

either way, monitoring the system is very important.
good app.


----------



## FordGT90Concept (Feb 5, 2010)

regexorcist said:


> very good, but mine runs when the system is brought up.
> no clicking


Stick it in Startup and it will start with the system.  I should add a flag to pre-specify an application to monitor...


Edit: Done, see original post for details.


----------



## Mussels (Feb 10, 2010)

I've used the tool from this thread over here, to fix a problem with Sins of a solar empires latest expansion pack. I've linked to here, and I'm linking from here back to there so that all threads involved get some attention.


----------



## FordGT90Concept (Feb 14, 2010)

I'm pondering adding a new feature to this app:

While the Process Monitor is running, it would monitor CPU usage per core, formulate a score for each core, and figure out how many cores are actually needed to run the application.  Because the CPU usage is based on the performance of the entire system, the user must make sure nothing is loading the system to 100% while playing the game.  The purpose of this feature would be tell how many cores the game needs to operate smoothly.  This information is valuable in setting WCG and F@H to how many cores they should be using.  That way, you can contribute as much as possible to those projects while not interfering with your game performance.

Anyone think this would be a valuable feature?


----------



## Mussels (Feb 14, 2010)

just make it spit out min/max/avg for each core - be very useful for testing games multithreading capabilities.


----------



## FordGT90Concept (Feb 14, 2010)

I think I would do both.  Instead of a graph, show a ListView with the current/min/max and on the left, show min/max core/CPU usage.

The reason I can't do an average is because it would have to have a limited scope (how limited depends on the hardware).  If it isn't limited, it would eventually crash and/or be forced to restart averaging.


----------



## Mussels (Feb 14, 2010)

average over the last 5 minutes, at 10-20 second intervals?


----------



## FordGT90Concept (Feb 14, 2010)

That should work except I'd probably average it every second.  It is just a simple division operation (total percentage / total seconds).


----------



## Mussels (Feb 14, 2010)

i'm just thinking its a great way to tell if a game supports multithreading, and if so, is it crippled - EG supreme commander, it was multithreaded... but one thread had the AI on it, and that thread would just choke and die long before the others - holding performance back.


----------



## FordGT90Concept (Feb 14, 2010)

Wait...let me clear something up:  There is Process CPU time which tells you how much time a processor spent on a given process.  This only tells you overall CPU use, not by core (an average of all cores).

There is also load percentages per core.  It tells you how burdened each core is but it doesn't tell you what process is burdening that given core.

Which is more valuable to you?  Both?


I guess the point I am trying to make is that the most accurate way to tell how many cores a given process is using is to take total process time and compare it to the number of cores.  I could graph that...


----------



## Mussels (Feb 14, 2010)

FordGT90Concept said:


> Wait...let me clear something up:  There is Process CPU time which tells you how much time a processor spent on a given process.  This only tells you overall CPU use, not by core (an average of all cores).
> 
> There is also load percentages per core.  It tells you how burdened each core is but it doesn't tell you what process is burdening that given core.
> 
> ...



is it possible to tell the load a process is having on the cores? Say, you run a game and it uses 100% of core 1, but only 5-10% of the rest of your cores


----------



## FordGT90Concept (Feb 14, 2010)

Not that that I am aware of.  The OS and all other background tasks make it impossible to know how much of the app is landing on any given core.  All that is known is how much of the total CPU power is being consumed by the app.  From that, I can only guestimate how many cores the process actually needs.


----------



## Mussels (Feb 14, 2010)

bummer.


----------



## FordGT90Concept (Feb 14, 2010)

It's still pretty accurate though.  A lot of simple threads can sit on a single core while the other core be 100% loaded.  For example, if you have a quad-core, one core is 100% loaded, one core is 3% loaded, one core is 50% loaded, and another core is 25% loaded (100 + 3 + 50 + 25 = 178; 178/400 = 0.445), you would see 44.5% CPU usage.  That means that even though you have 4 cores, the process only needs 2.

I think this is what I'll do because just like hitting the max thread limit or the 2 GiB wall, it will best show if the CPU is the bottleneck or not.


----------



## Espera (Feb 14, 2010)

I was using your program and noticed a few duplicates in the drop down list, I think I saw 3 "pen tablet" services running. I'm running windows XP 32bit


----------



## FordGT90Concept (Feb 14, 2010)

That's because 3 pen tablet executables are running. XD

Similarly, you could see multiple csrss processes and numerous svchost processes.  Because that is an inherent problem with how the OS works, I'll allow process IDs to be entered into the "Process" field...

I'll get 1.0.3 up soon (Processor load + PID)...


----------



## Espera (Feb 14, 2010)

alright, thanks


----------



## FordGT90Concept (Feb 14, 2010)

1.0.3 uploaded.

If you want to use a PID, just enter #PID.  For example, #123.

As you can see in the picture, it estimates max number of cores used by the process and average number of cores used by the process in addition to keeping track of the normal stuff (minimum processor usage, maximum processor usage, and current processor usage).


In averaging, if the monitor runs for a very long time (years) it will eventually have to reset the average counter.  It will do this automatically and without a message.


----------



## trickson (Feb 23, 2010)

Nice . But funny thing while monitoring the everest_bench.dll file it showed Max Cores used : 5/4 cores  I stopped and restarted the tool and so far it reads 4/4 now .


----------



## FordGT90Concept (Feb 23, 2010)

Oops.  I bet Everest was using 100% CPU which could cause the ceiling to return 4 + 1.  In any event, I added a bit of code so max cores will never exceed core count.  It will be fixed in the next release, whenever that may be.


----------



## FordGT90Concept (Feb 25, 2010)

FYI, 1.0.4 is up and it should prevent max cores from ever exceeding the number of cores on the system.


----------

