The mscoree.stat file includes running totals, count (n), average (mean), minimum and maximum values for the above mentioned counters. I've included an example file below. For counters where count, mean, minimum and maximum data is not relevant (ex: Total Program Run Time) a value of zero (0) is logged.The sections below discuss each counter in the mscoree.stat file. I will use the following format for the discussions.Counter nameBrief description of the counterDiscussion of the contents of relevant columns (value, n. mean, min, max)Any additional comments relating to the counterExecution Engine CountersIn version 1 of the .NET Compact Framework, there are two Execution Engine counters: Execution Engine Startup Time and Total Program Run Time.Execution Engine Startup TimeTime to get to your application's entry point (Main).value: Time in millisecondsThis counter is not of use to application writers and has been removed from version 2 of the .NET Compact Framework.Total Program Run TimeTotal application run time, including Execution Engine startup.value: Time in millisecondsGarbage Collector CountersMany of the Garbage Collector counters are related to a collection type (simple, compact, full). For information on the .NET Compact Framework Garbage Collector, please see Steven Pratschner's post: An Overview of the .NET Compact Framework Garbage Collector. In the discussion below, substitute <type> with Simple, Compact or Full depending on which counters you are examining.Number Of <type> CollectionsThis counter reports the number of garbage collections (of the specified type) that occurred during your application's run time.value: Garbage collection countBytes Collected By <type> CollectionThe total number of bytes that were collected by the collections that occurred while your application ran. value: Running total of bytes collectedn: The number of collectionsmean: The average number of bytes collected during each collectionmin: The smallest amount of bytes collectedmax: The largest amount of bytes collectedBytes In Use After <type> CollectionThe total number of bytes in use, by managed objects, in your application, after garbage collection of the specified type occursvalue: Running total of bytes available after collectionn: The number of collectionsmean: The average number of bytes in use after collectionmin: The smallest amount of bytes in use after collectionmax: The largest amount of bytes in use after collectionThe value column is an accumulation of total bytes after collection, it is not of much use when diagnosing performance issues. This total is combined with the count of collections (n column) to compute the mean. For this counter, the mean, min and max columns provide the useful data.Time In <type> Collect The time spent in all collections of the specified type.value: Running total of the time (in milliseconds) spent in collectionsn: The number of collectionsmean: The average length of time to perform the collectionmin: The shortest length of time spent in collectionmax: The longest length of time spent in collectionThe following counters are related to the Garbage Collector as a whole, and not a specific collection type.GC Number Of Application Induced CollectionsThe number of garbage collections that occurred as a result of the application calling GC.Collect().value: The number of collectionsFor a detailed discussion of the issues surrounding GC.Collect(), please see Scott Holden's post: The perils of GC.Collect.GC Latency TimeThe time spent in all collections of all types.value: Running total of the time (in milliseconds) spent in collectionsn: The number of collectionsmean: The average length of time to perform the collectionmin: The shortest length of time spent in collectionmax: The longest length of time spent in collectionTotal Bytes In Use After CollectionThe total number of bytes in use, by managed objects, in your application, after garbage collection of any type occursvalue: Running total of bytes available after collectionn: Number of garbage collectionsmean: The average number of bytes in use after collectionmin: The smallest amount of bytes in use after collectionmax: The largest amount of bytes in use after collectionThe value column is an accumulation of total bytes after collection, it is not of much use when diagnosing performance issues. This total is combined with the count of collections (n column) to compute the mean. For this counter, the mean, min and max columns provide the useful data.Bytes AllocatedThe amount of memory allocated for managed objects, Just-In-Time compiled code and runtime data structures during the run time of your application.value: Running total of bytes allocatedn: Number of allocationsmean: Average allocation sizemin: Size of smallest allocationmax: Size of largest allocationPlease note that memory allocated by P/Invoke calls is not tracked as a part of this counter.Peak Bytes AllocatedThe maximum amount of memory allocated for managed objects, Just-In-Time compiled code and runtime data structures, at any time during the run time of your application.value: The largest number of bytes used by the applicationI find this to be one of the most useful performance counters. By tracking peak memory usage across multiple application runs (where the same scenario is performed), memory consumption related issues can be identified at a high level.Please note that memory allocated by P/Invoke calls is not tracked as a part of this counter. Number Of Objects AllocatedThe number of managed objects allocated by your application.value: Running total of allocated objectsThis counter includes object that have been disposed / collected.IL CountersThe counters in this section are related to the .NET Compact Framework's Just-In-Time (JIT) compiler.Bytes JittedThe pre-compile size of the IL code being Just-In-Time compiled.value: Running total of bytes compiledn: Number of compilationsmean: Average number of bytes in each compilationmin: Smallest number of bytes compiledmax: Largest number of bytes compiledNative Bytes JittedThe post-compile size of the IL code being Just-In-Time compiled.value: Running total of bytes compiledn: Number of compilationsmean: Average number of bytes in each compilationmin: Smallest number of bytes compiledmax: Largest number of bytes compiledNumber Of Methods JittedA count of methods which have been Just-In-Time compiled.value: Running total of compiled methodsBytes PitchedNumber of bytes removed from the code cache.value: Running total of removed bytesn: Number of times code was removed from the cachemean: Average size of the removed codemin: Size of smallest code removalmax: Size of largest code removalThis counter will show non-zero data only if the application has encountered extreme memory pressure.Number Of Methods PitchedNumber of jitted methods removed from the code cache.value: Running total of removed methodsn: Number of times code was removed from the cacheThis counter will show non-zero data only if the application has encountered extreme memory pressure.Number Of Exceptions Number of managed exceptions thrown while the application was running.value: Running total of thrown exceptionsNumber Of Calls Number of direct calls to managed methods.value: Running total of method callsIt is important to note that the calls collected in this counter do not include calls to virtual methods. Virtual method calls are collected in the Number Of Virtual Calls counter.Number Of Virtual CallsNumber of virtual calls to managed methods.value: Running total of method callsNumber Of Virtual Call Cache HitsNumber of virtual calls to methods which have been cached.value: Running total of virtual method calls from the cacheThe value in this counter will often be very close to the value of the Number Of Virtual Calls counter. Where these counter values differ is in the initial call (including re-calls after a method is pitched).The Number Of PInvoke CallsThe number of calls into native functions made (via P/Invoke) by your application.value: Running total of native function callsExample mscoree.stat fileThe following is an example mscoree.stat file that shows the data collected from a simple application. The garbage collections in this application were caused by moving it to the background (running a second application in the foreground).
mscoree.stat
Recommended readingFor anyone building applications on the .NET Compact Framework, I highly recommend the reading the following:.NET Compact Framework version 2.0 Performance and Working Set FAQ - by Roman BatoukovThis article (on the .NET Compact Framework Team weblog) is very thorough and covers many performance issues and how to avoid them. While the article specifically talks about version 2 of the .NET Compact Framework, many of its recommendations apply to version 1 as well.When Performance Matters and The Perils of GC.Collect (or when to use GC.Collect) - by Scott Holden.NET Compact Framework Advanced Memory Management - by Mike ZintelAn Overview of the .NET Compact Framework Garbage Collector - by Steven PratschnerI'll be posting on the .NET Compact Framework version 2 performance counters soon. Given the length of this post, and the larger number of counters in version 2, I will likely split the discussion into multiple (smaller) posts around counter categories.Take care,-- DK[Edit: post title]Disclaimer(s):This posting is provided "AS IS" with no warranties, and confers no rights.