Ejemplo n.º 1
0
        public GcProfiling()
        {
            collectionCountState = Profiler.New(GcCollectionCountKey);
            gen0Count = GC.CollectionCount(0);
            gen1Count = GC.CollectionCount(1);
            gen2Count = GC.CollectionCount(2);
            collectionCountState.Begin(gen0Count, gen1Count, gen2Count);

            gcMemoryState = Profiler.New(GcMemoryKey);
            memoryPeak = lastFrameMemory = GC.GetTotalMemory(false);
            gcMemoryState.Begin(lastFrameMemory, lastFrameMemory, memoryPeak);
        }