private static void UpdateCurrentMemoryUsage()
        {
            long currentMemoryUsage = MemoryDiagnosticsHelper.GetCurrentMemoryUsage();

            MemoryDiagnosticsHelper.currentMemoryBlock.Text = (string.Format("{0:N}", (currentMemoryUsage / 1024L)));
            int safetyBand = MemoryDiagnosticsHelper.GetSafetyBand(currentMemoryUsage);

            if (safetyBand == MemoryDiagnosticsHelper.lastSafetyBand)
            {
                return;
            }
            MemoryDiagnosticsHelper.currentMemoryBlock.Foreground = (MemoryDiagnosticsHelper.GetBrushForSafetyBand(safetyBand));
            MemoryDiagnosticsHelper.lastSafetyBand = safetyBand;
        }
 public static void Checkpoint(string text)
 {
     if (MemoryDiagnosticsHelper.recentCheckpoints == null)
     {
         return;
     }
     if ((long)MemoryDiagnosticsHelper.recentCheckpoints.Count >= 9L)
     {
         MemoryDiagnosticsHelper.recentCheckpoints.Dequeue();
     }
     MemoryDiagnosticsHelper.recentCheckpoints.Enqueue(new MemoryCheckpoint(text, MemoryDiagnosticsHelper.GetCurrentMemoryUsage()));
 }