2005-04-01 Ben Maurer <bmaurer@ximian.com>
* TypeGraphPlotter.cs: Use a unified threshold level. Partially fixes an issue with the graph not being the right size. * TypeTabulator.cs: Ditto. svn path=/trunk/heap-prof/; revision=42479
This commit is contained in:
Родитель
7064a87e3d
Коммит
3bb4661c90
|
@ -1,3 +1,10 @@
|
|||
2005-04-01 Ben Maurer <bmaurer@ximian.com>
|
||||
|
||||
* TypeGraphPlotter.cs: Use a unified threshold level. Partially
|
||||
fixes an issue with the graph not being the right size.
|
||||
|
||||
* TypeTabulator.cs: Ditto.
|
||||
|
||||
2005-03-28 Ben Maurer <bmaurer@ximian.com>
|
||||
|
||||
* ProfileReader.cs: Read summarized data.
|
||||
|
|
|
@ -121,6 +121,24 @@ class Plotter {
|
|||
|
||||
g.DrawLines (Pens.Black, line);
|
||||
}
|
||||
|
||||
#if DEBUG_GRAPH_SIZE
|
||||
{
|
||||
Point [] line = new Point [data.Count];
|
||||
|
||||
int j = 0;
|
||||
foreach (TimePoint tp in data) {
|
||||
|
||||
|
||||
int psize = tp.Data.TotalSize;
|
||||
line [j].X = tp.X;
|
||||
line [j].Y = ysize - checked ((int)((long)psize * (long) ysize / (long)Profile.MaxSize));
|
||||
j ++;
|
||||
}
|
||||
|
||||
g.DrawLines (Pens.Black, line);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -210,10 +228,10 @@ class TypeList {
|
|||
{
|
||||
int num = 0;
|
||||
|
||||
long threshold = p.MaxSize / 100;
|
||||
int cutoff = (int) (p.MaxSize * TypeTabulator.Threshold);
|
||||
|
||||
foreach (long l in p.Metadata.TypeMax)
|
||||
if (l > threshold)
|
||||
if (l >= cutoff)
|
||||
num ++;
|
||||
|
||||
Sizes = new long [num];
|
||||
|
@ -223,7 +241,7 @@ class TypeList {
|
|||
|
||||
num = 0;
|
||||
for (int i = 0; i < p.Metadata.TypeMax.Length; i ++) {
|
||||
if (p.Metadata.TypeMax [i] > threshold) {
|
||||
if (p.Metadata.TypeMax [i] >= cutoff) {
|
||||
Sizes [num] = p.Metadata.TypeMax [i];
|
||||
TypeIndexes [num] = i;
|
||||
num ++;
|
||||
|
|
|
@ -13,10 +13,9 @@ class TimeData {
|
|||
class TypeTabulator : ProfileReader {
|
||||
|
||||
const int DeltaT = 50;
|
||||
const double Threshold = .005;
|
||||
public const double Threshold = .01;
|
||||
|
||||
public ArrayList Data = new ArrayList ();
|
||||
public long [] TotalTypeSizes;
|
||||
public bool [] IsSizeLongEnough;
|
||||
|
||||
int [] current_type_data;
|
||||
|
@ -113,8 +112,9 @@ class TypeTabulator : ProfileReader {
|
|||
|
||||
public void Dump ()
|
||||
{
|
||||
long [] sizes = (long []) TotalTypeSizes.Clone ();
|
||||
long [] sizes = (long []) Profile.Metadata.TypeMax.Clone ();
|
||||
int [] indexes = new int [sizes.Length];
|
||||
int cutoff = (int) (Profile.MaxSize * Threshold);
|
||||
|
||||
for (int i = 0; i < indexes.Length; i ++)
|
||||
indexes [i] = i;
|
||||
|
@ -134,7 +134,7 @@ class TypeTabulator : ProfileReader {
|
|||
Console.WriteLine ("Total heap size {0}", d.TotalSize);
|
||||
|
||||
foreach (int ty in indexes) {
|
||||
if (!IsSizeLongEnough [ty])
|
||||
if (Profile.Metadata.TypeMax [ty] < cutoff)
|
||||
continue;
|
||||
|
||||
Console.WriteLine ("{0} ({2:p}) -- {1}", d.TypeData [ty], GetTypeName (ty), (double) d.TypeData [ty] / (double) d.TotalSize);
|
||||
|
@ -150,21 +150,9 @@ class TypeTabulator : ProfileReader {
|
|||
Split (end_t);
|
||||
int cutoff = (int) (Profile.MaxSize * Threshold);
|
||||
|
||||
TotalTypeSizes = new long [TypeTableSize];
|
||||
IsSizeLongEnough = new bool [TypeTableSize];
|
||||
|
||||
foreach (TimeData d in Data) {
|
||||
for (int i = 0; i < d.TypeData.Length; i ++) {
|
||||
TotalTypeSizes [i] += d.TypeData [i];
|
||||
|
||||
if (d.TypeData [i] > cutoff)
|
||||
IsSizeLongEnough [i] = true;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (TimeData d in Data) {
|
||||
for (int i = 0; i < d.TypeData.Length; i ++) {
|
||||
if (! IsSizeLongEnough [i]) {
|
||||
if (Profile.Metadata.TypeMax [i] < cutoff) {
|
||||
d.OtherSize += d.TypeData [i];
|
||||
d.TypeData [i] = 0;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче