override public void Run(OutfileReader reader, string [] args) { Table table; table = new Table(); table.AddRow("SUMMARY", ""); table.AddRow("", ""); table.AddRow("Filename:", reader.Filename); table.AddRow("Allocated Bytes:", Util.PrettySize(reader.TotalAllocatedBytes)); table.AddRow("Allocated Objects:", reader.TotalAllocatedObjects); table.AddRow("GCs:", reader.Gcs.Length); table.AddRow("Resizes:", reader.Resizes.Length); table.AddRow("Final heap size:", Util.PrettySize(reader.LastResize.NewSize)); table.AddRow("", ""); table.AddRow("Distinct Types:", reader.Types.Length); table.AddRow("Backtraces:", reader.Backtraces.Length); table.SetAlignment(1, Alignment.Left); Console.WriteLine(table); }
public override void Run(OutfileReader reader, string [] args) { Table table; table = new Table (); table.AddRow ("SUMMARY", ""); table.AddRow ("", ""); table.AddRow ("Filename:", reader.Filename); table.AddRow ("Allocated Bytes:", Util.PrettySize (reader.TotalAllocatedBytes)); table.AddRow ("Allocated Objects:", reader.TotalAllocatedObjects); table.AddRow ("GCs:", reader.Gcs.Length); table.AddRow ("Resizes:", reader.Resizes.Length); table.AddRow ("Final heap size:", Util.PrettySize (reader.LastResize.NewSize)); table.AddRow ("", ""); table.AddRow ("Distinct Types:", reader.Types.Length); table.AddRow ("Backtraces:", reader.Backtraces.Length); table.SetAlignment (1, Alignment.Left); Console.WriteLine (table); }
public override void Run(OutfileReader reader, string [] args) { Table table; table = new Table (); table.Separator = " | "; Resize [] resizes; resizes = reader.Resizes; Gc [] gcs; gcs = reader.Gcs; int i_resize = 0; int i_gc = 0; long heap_size = 0; while (i_resize < resizes.Length || i_gc < gcs.Length) { Resize r = null; if (i_resize < resizes.Length) r = resizes [i_resize]; Gc gc = null; if (i_gc < gcs.Length) gc = gcs [i_gc]; if (i_resize != 0 || i_gc != 0) table.AddRow ("", "", ""); string timestamp, tag, message; if (r != null && (gc == null || r.Generation <= gc.Generation)) { timestamp = string.Format ("{0:HH:mm:ss}", r.Timestamp); if (r.PreviousSize == 0) { tag = "Init"; message = String.Format ("Initialized heap to {0}", Util.PrettySize (r.NewSize)); } else { tag = "Resize"; message = String.Format ("Grew heap from {0} to {1}\n" + "{2} in {3} live objects\n" + "Heap went from {4:0.0}% to {5:0.0}% capacity", Util.PrettySize (r.PreviousSize), Util.PrettySize (r.NewSize), Util.PrettySize (r.TotalLiveBytes), r.TotalLiveObjects, r.PreResizeCapacity, r.PostResizeCapacity); } heap_size = r.NewSize; ++i_resize; } else { timestamp = String.Format ("{0:HH:mm:ss}", gc.Timestamp); if (gc.Generation >= 0) { tag = "GC " + gc.Generation; message = String.Format ("Collected {0} of {1} objects ({2:0.0}%)\n" + "Collected {3} of {4} ({5:0.0}%)\n" + "Heap went from {6:0.0}% to {7:0.0}% capacity", gc.FreedObjects, gc.PreGcLiveObjects, gc.FreedObjectsPercentage, Util.PrettySize (gc.FreedBytes), Util.PrettySize (gc.PreGcLiveBytes), gc.FreedBytesPercentage, 100.0 * gc.PreGcLiveBytes / heap_size, 100.0 * gc.PostGcLiveBytes / heap_size); } else { tag = "Exit"; message = String.Format ("{0} live objects using {1}", gc.PreGcLiveObjects, Util.PrettySize (gc.PreGcLiveBytes)); } ++i_gc; } table.AddRow (timestamp, tag, message); } table.SetAlignment (1, Alignment.Left); table.SetAlignment (2, Alignment.Left); Console.WriteLine (table); }
override public void Run(OutfileReader reader, string [] args) { Table table; table = new Table(); table.Separator = " | "; Resize [] resizes; resizes = reader.Resizes; Gc [] gcs; gcs = reader.Gcs; int i_resize = 0; int i_gc = 0; long heap_size = 0; while (i_resize < resizes.Length || i_gc < gcs.Length) { Resize r = null; if (i_resize < resizes.Length) { r = resizes [i_resize]; } Gc gc = null; if (i_gc < gcs.Length) { gc = gcs [i_gc]; } if (i_resize != 0 || i_gc != 0) { table.AddRow("", "", ""); } string timestamp, tag, message; if (r != null && (gc == null || r.Generation <= gc.Generation)) { timestamp = string.Format("{0:HH:mm:ss}", r.Timestamp); if (r.PreviousSize == 0) { tag = "Init"; message = String.Format("Initialized heap to {0}", Util.PrettySize(r.NewSize)); } else { tag = "Resize"; message = String.Format("Grew heap from {0} to {1}\n" + "{2} in {3} live objects\n" + "Heap went from {4:0.0}% to {5:0.0}% capacity", Util.PrettySize(r.PreviousSize), Util.PrettySize(r.NewSize), Util.PrettySize(r.TotalLiveBytes), r.TotalLiveObjects, r.PreResizeCapacity, r.PostResizeCapacity); } heap_size = r.NewSize; ++i_resize; } else { timestamp = String.Format("{0:HH:mm:ss}", gc.Timestamp); if (gc.Generation >= 0) { tag = "GC " + gc.Generation; message = String.Format("Collected {0} of {1} objects ({2:0.0}%)\n" + "Collected {3} of {4} ({5:0.0}%)\n" + "Heap went from {6:0.0}% to {7:0.0}% capacity", gc.FreedObjects, gc.PreGcLiveObjects, gc.FreedObjectsPercentage, Util.PrettySize(gc.FreedBytes), Util.PrettySize(gc.PreGcLiveBytes), gc.FreedBytesPercentage, 100.0 * gc.PreGcLiveBytes / heap_size, 100.0 * gc.PostGcLiveBytes / heap_size); } else { tag = "Exit"; message = String.Format("{0} live objects using {1}", gc.PreGcLiveObjects, Util.PrettySize(gc.PreGcLiveBytes)); } ++i_gc; } table.AddRow(timestamp, tag, message); } table.SetAlignment(1, Alignment.Left); table.SetAlignment(2, Alignment.Left); Console.WriteLine(table); }