public void AddDataPoint() { long bytes = 0; if (m_bOnlySaveAfterBaseLineSet == false) { bytes = GC.GetTotalMemory(true); m_Writer.WriteLine("{0}\t{1}\t{2}", bytes, MemoryUsage.TotalMemoryUsage(), DateTime.Now.ToString("HH:mm:ss.fff")); } else if (MemoryUsage.BaseLineSet) { bytes = GC.GetTotalMemory(true) - MemoryUsage.BaseLineMemoryUsage; m_Writer.WriteLine("{0}\t{1}\t{2}", bytes, MemoryUsage.TotalMemoryUsage(), DateTime.Now.ToString("HH:mm:ss.fff")); } if (bytes == m_nLastUsage + 16384) { } m_nLastUsage = bytes; m_nDataPointCount++; }
public static String MemoryUsageAsString() { long bytes = GC.GetTotalMemory(true); return(String.Format("{0}\t{1}\t{2}", bytes, MemoryUsage.TotalMemoryUsage(), DateTime.Now.ToString("HH:mm:ss.fff"))); }