The statistics file includes running totals, the most recent value (last datum), count (n), average (mean), minimum and maximum values for the counters. I've included an example file at the end of this post. For counters where a given column is not relevant, a hyphen (-) is logged.I will use the following format to describe each counter.Counter nameBrief description of the counterDiscussion of the contents of relevant columns (total, last datum, n, mean, min, max)Any additional comments relating to the counterGarbage Collector CountersToday's counters relate to memory usage and the .NET Compact Framework Garbage Collector. From version 1 to version 2, the Garbage Collector counters have been refined a great deal. The version 2 counters provide significantly more detailed insight into application memory usage and make identifying memory related performance issues much easier.For information on the .NET Compact Framework Garbage Collector, please see Steven Pratschner's post: An Overview of the .NET Compact Framework Garbage Collector.Peak Bytes Allocated (native + managed)The maximum number of bytes in use by the .NET Compact Framework including both native and managed memory.total: The largest number of bytes used at any time during the runtime of the applicationManaged Objects AllocatedThe count of all managed objects that have been allocated (including unused objects).total: Running total of managed objects allocatedManaged Bytes AllocatedThe count of bytes allocated for managed objects.total: Running total of bytes allocatedlast datum: The size of the most recent allocationn: The number of allocationsmean: The average size of the allocationsmin: The smallest number of bytes allocatedmax: The largest number of bytes allocatedManaged String Objects AllocatedThe count of string objects that have been allocated.total: Running total of managed string objectsBytes of String Objects AllocatedThe count of bytes allocated for managed string objects.total: Running total of bytes allocatedGarbage Collections (GC)The number of times the Garbage Collector ran during the run time of your application.total: Running total of collectionsBytes Collected By GCThe count of bytes collected by the Garbage Collector.total: Running total of bytes collected by the Garbage Collectorlast datum: The size of the most recent collectionn: The number of collectionsmean: The average size of the collectionsmin: The size of the smallest collectionmax: The size of the largest collectionManaged Bytes In Use After GCThe number of bytes allocated to live objects after the Garbage Collector has run.last datum: The number of managed bytes in use after the most recent collectionn: The number of collectionsmean: The average number of bytes in use after the collectionsmin: The fewest number of bytes in use after a collectionmax: The largest number of bytes in use after a collectionTotal Bytes In Use After GCThe number of bytes (managed and native) in use after the Garbage Collector has runlast datum: The number of bytes in use after the most recent collectionn: The number of collectionsmean: The average number of bytes in use after the collectionsmin: The fewest number of bytes in use after a collectionmax: The largest number of bytes in use after a collectionGC CompactionsThe number of times the Garbage Collector has compacted the heap.total: Running total of heap compactions by the Garbage CollectorCode PitchingsThe number of times the Garbage Collector has pitched Just-In-Time (JIT) compiled code.total: Running total of code pitchingsCalls to GC.CollectThe number of times the application has called the GC.Collect() methodtotal: Running total of calls to GC.Collect()For a detailed discussion of the issues surrounding GC.Collect(), please see Scott Holden's post: The perils of GC.Collect.GC Latency Time (ms)The time (in milliseconds) that the Garbage Collector has taken to run.total: Running total of time spent in collectionlast datum: The time it took for the most recent collection to completen: The number of garbage collectionsmean: The average time spent in collectionsmin: The shortest time it took to perform a collectionmax: The longest time it took to perform a collectionPlease note that the latency time of the Garbage Collector includes collection of managed objects which are no longer in scope and the compaction (if necessary) of the GC Heap.Pinned ObjectsThe number of pinned objects that were encountered by the Garbage Collector.total: Running total of pinned objectsPinned objects are objects whose locations in memory cannot change. A good example of such an object is a memory buffer that is being used to communicate between managed and unmanaged (native) code. Pinned objects cannot be moved by the Garbage Collector during heap compaction.Objects Moved by CompactorThe count of objects that were moved by the Garbage Collector during a compaction.total: Running total of objects moved during compactionObjects Not Moved by CompactorThe count of objects that cannot be moved or were not moved by the Garbage Collector during a compaction.total: Running total of objects not moved during compactionObjects might not be moved for a number of reasons. Some objects cannot be moved (this is rare). Other objects are not moved because they are in a portion of the heap which does not need to be compacted.Objects FinalizedThe number of objects for which a finalizer has been run.total: Running total of finalized objectsMore information on the Finalize method can be found in the .NET Programmers Reference on MSDN. A good discussion on implementing finalization in your objects can be found in the Implementing Finalize and Dispose to Clean Up Unmanaged Resources article (also on MSDN).Boxed Value TypesThe number of value types that have been boxed.total: Running total of boxed value typesA good reference on boxing of value types can be found in the C# Programmers Reference on MSDN. Scott Holden also has a nice discussion on The cost of value types in the .NET Compact Framework.Process HeapThe number of bytes in use by the .NET Compact Framework Common Language Runtime's default heap.last datum: The current number of bytes in the heapn: The number of allocations in the heapmean: The average number of bytes in the heapmin: The smallest number of bytes in the heap (throughout the runtime of the application)max: The largest number of bytes in the heap (throughout the runtime of the application)The Process Heap contains memory allocated by the .NET Compact Framework's Common Language Runtime that does not fit into the other heaps (Short Term, JIT, App Domain, GC).Short Term HeapThe number of bytes in use by the .NET Compact Framework Common Language Runtime's short term heap.last datum: The current number of bytes in the heapn: The number of allocations in the heapmean: The average number of bytes in the heapmin: The smallest number of bytes in the heap (throughout the runtime of the application)max: The largest number of bytes in the heap (throughout the runtime of the application)The Short Term Heap contains memory allocated by the .NET Compact Framework Common Language Runtime for short lived (temporary) use.JIT HeapThe number of bytes in use by the .NET Compact Framework Just-In-Time (JIT) compiler's heap.last datum: The current number of bytes in the heapn: The number of allocations in the heapmean: The average number of bytes in the heapmin: The smallest number of bytes in the heap (throughout the runtime of the application)max: The largest number of bytes in the heap (throughout the runtime of the application)The JIT heap contains the native code generated when the .NET Compact Framework Just-In-Time compiler compiles a managed method. JIT compilation occurs whenever a managed method is executed for the first time (or the first time a method is executed after a code pitching).App Domain HeapThe number of bytes in use by the .NET Compact Framework Common Language Runtime's App Domain heap.last datum: The current number of bytes in the heapn: The number of allocations in the heapmean: The average number of bytes in the heapmin: The smallest number of bytes in the heap (throughout the runtime of the application)max: The largest number of bytes in the heap (throughout the runtime of the application)The App Domain Heap contains the dynamic representation of metadata used by the .NET Compact Framework Common Language Runtime's assembly loader.GC HeapThe number of bytes in use by the .NET Compact Framework's Garbage Collector heap.last datum: The current number of bytes in the heapn: The number of allocations in the heapmean: The average number of bytes in the heapmin: The smallest number of bytes in the heap (throughout the runtime of the application)max: The largest number of bytes in the heap (throughout the runtime of the application)The GC Heap contains memory allocated by applications and the .NET Compact Framework.Example statistics fileI have highlighted the counters discussed here with a yellow background.
In the next part of this series, I will talk about the .NET Compact Framework v2's JIT Compiler performance counters.Take care,-- DK[Edit: post titles]Disclaimer(s):This posting is provided "AS IS" with no warranties, and confers no rights.