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