Ejemplo n.º 1
0
 public static HeapState GetHeapStateAfter()
 {
     gcCount               = HeapUtility.GetTotalCollectionCount();
     totalMemory           = HeapUtility.GetTotalAllocatedMemory();
     lastHeapState.GCCount = gcCount;
     lastHeapState.TotalMemoryAllocated = totalMemory;
     return(lastHeapState);
 }
Ejemplo n.º 2
0
        public static HeapState Execute(Action action)
        {
            ResetBeforeHeapState();

            action.Invoke();

            _after = HeapUtility.GetHeapStateAfter();

            _delta.GCCount = _after.GCCount - _before.GCCount;
            _delta.TotalMemoryAllocated = _after.TotalMemoryAllocated - _before.TotalMemoryAllocated;
            return(_delta);
        }
Ejemplo n.º 3
0
 public static void ResetBeforeHeapState()
 {
     _before = HeapUtility.GetHeapStateBefore();
 }