public override void GarbageCollectionStart(uint collection, uint generation, ulong counter)
        {
            GcStatistics gcs = NewGcStatistics(collection);

            gcs.Generation   = generation;
            gcs.StartCounter = counter;
        }
        public override void GarbageCollectionResize(uint collection, ulong newSize)
        {
            GcStatistics gcs = NewGcStatistics(collection);

            gcs.NewHeapSize = newSize;
            gcStatistics.Add(gcs);
            currentGcStatistics = null;
        }
        public override void GarbageCollectionEnd(uint collection, uint generation, ulong counter)
        {
            GcStatistics gcs = GetGcStatistics(collection);

            gcs.EndCounter = counter;
            pendingGcStatistics.Remove(gcs);
            gcStatistics.Add(gcs);
            currentGcStatistics = null;
        }
        GcStatistics NewGcStatistics(uint collection)
        {
            GcStatistics result = new GcStatistics(this, collection);

            if (currentGcStatistics != null)
            {
                pendingGcStatistics.Add(currentGcStatistics);
            }
            currentGcStatistics = result;
            return(result);
        }
 public ProfilerEventHandler() : base(new LoadedElementHandler <LoadedClass, LoadedMethod, UnmanagedFunctionFromRegion, UnmanagedFunctionFromID, ExecutableMemoryRegion, HeapObject, HeapSnapshot> (new LoadedElementFactory()))
 {
     perThreadStacks   = new Dictionary <ulong, CallStack> ();
     stack             = null;
     stackTraceFactory = new StackTrace.Factory();
     unknownStatisticalHitsCollector = new UnknownStatisticalHitsCollector();
     gcStatistics             = new List <GcStatistics> ();
     pendingGcStatistics      = new List <GcStatistics> ();
     currentGcStatistics      = null;
     allocationSummaries      = new List <AllocationSummary> ();
     currentAllocationSummary = null;
     globalMonitorStatistics  = new GlobalMonitorStatistics();
 }
 GcStatistics GetGcStatistics(uint collection)
 {
     if ((currentGcStatistics != null) && (currentGcStatistics.Collection == collection))
     {
         return(currentGcStatistics);
     }
     else
     {
         foreach (GcStatistics gcs in pendingGcStatistics)
         {
             if (gcs.Collection == collection)
             {
                 GcStatistics result = gcs;
                 if (currentGcStatistics != null)
                 {
                     pendingGcStatistics.Add(currentGcStatistics);
                 }
                 currentGcStatistics = result;
                 return(result);
             }
         }
         return(NewGcStatistics(collection));
     }
 }
        public override void GarbageCollectionSweepEnd(uint collection, uint generation, ulong counter)
        {
            GcStatistics gcs = GetGcStatistics(collection);

            gcs.SweepEndCounter = counter;
        }
        public override void GarbageCollectionMarkStart(uint collection, uint generation, ulong counter)
        {
            GcStatistics gcs = GetGcStatistics(collection);

            gcs.MarkStartCounter = counter;
        }