Exemple #1
0
 public static HeapState GetHeapStateAfter()
 {
     gcCount               = HeapUtility.GetTotalCollectionCount();
     totalMemory           = HeapUtility.GetTotalAllocatedMemory();
     lastHeapState.GCCount = gcCount;
     lastHeapState.TotalMemoryAllocated = totalMemory;
     return(lastHeapState);
 }
Exemple #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);
        }
Exemple #3
0
 public static void ResetBeforeHeapState()
 {
     _before = HeapUtility.GetHeapStateBefore();
 }