Esempio n. 1
0
        private void UpdateSummary()
        {
            long heapCellHeaderOverheadSize = Statistics.SizeTotalHeader;
            long symbolicMatchMemorySize    = Statistics.StatsAllocated.TrackerSymbols.TypeSize;
            long otherMemorySize            = (Statistics.StatsAllocated.TypeSize - Statistics.StatsAllocated.TrackerSymbols.TypeSize);
            long freeSpaceSize  = Statistics.StatsFree.TypeSize;
            long totalCellCount = Statistics.StatsAllocated.TypeCount + Statistics.StatsFree.TypeCount;

            // 1ST GROUP
            iLV_Summary.Items[0].SubItems[1].Text = Statistics.StatsAllocated.TypeCount.ToString();
            iLV_Summary.Items[0].SubItems[2].Text = NumberFormattingUtils.NumberAsPercentageTwoDP(Statistics.StatsAllocated.TypeCount, totalCellCount) + " %";
            iLV_Summary.Items[1].SubItems[1].Text = Statistics.StatsFree.TypeCount.ToString();
            iLV_Summary.Items[1].SubItems[2].Text = NumberFormattingUtils.NumberAsPercentageTwoDP(Statistics.StatsFree.TypeCount, totalCellCount) + " %";

            // 2ND GROUP
            iLV_Summary.Items[2].SubItems[1].Text = symbolicMatchMemorySize.ToString();
            iLV_Summary.Items[2].SubItems[2].Text = NumberFormattingUtils.NumberAsPercentageTwoDP(symbolicMatchMemorySize, symbolicMatchMemorySize + otherMemorySize + freeSpaceSize) + " %";
            iLV_Summary.Items[3].SubItems[1].Text = otherMemorySize.ToString();
            iLV_Summary.Items[3].SubItems[2].Text = NumberFormattingUtils.NumberAsPercentageTwoDP(otherMemorySize, symbolicMatchMemorySize + otherMemorySize + freeSpaceSize) + " %";
            // (4) is a spacer
            iLV_Summary.Items[5].SubItems[1].Text = (symbolicMatchMemorySize + otherMemorySize).ToString();
            iLV_Summary.Items[5].SubItems[2].Text = NumberFormattingUtils.NumberAsPercentageTwoDP(symbolicMatchMemorySize + otherMemorySize, symbolicMatchMemorySize + otherMemorySize + freeSpaceSize) + " %";
            iLV_Summary.Items[6].SubItems[1].Text = freeSpaceSize.ToString();
            iLV_Summary.Items[6].SubItems[2].Text = NumberFormattingUtils.NumberAsPercentageTwoDP(freeSpaceSize, symbolicMatchMemorySize + otherMemorySize + freeSpaceSize) + " %";
            // (7) is a spacer
            iLV_Summary.Items[8].SubItems[1].Text = heapCellHeaderOverheadSize.ToString();
            iLV_Summary.Items[8].SubItems[2].Text = NumberFormattingUtils.NumberAsPercentageTwoDP(heapCellHeaderOverheadSize, symbolicMatchMemorySize + otherMemorySize + freeSpaceSize) + " %";

            // 3RD GROUP
            iLV_Summary.Items[10].SubItems[1].Text = (heapCellHeaderOverheadSize + symbolicMatchMemorySize + otherMemorySize).ToString();
            iLV_Summary.Items[10].SubItems[2].Text = "100.00 %";
        }
Esempio n. 2
0
        private void UpdateSelectionTotals()
        {
            bool atLeastOneValue = false;
            long total           = 0;

            foreach (XPTable.Models.Row row in iTable_SymbolMemory.SelectedItems)
            {
                TrackingInfo item = (TrackingInfo)row.Tag;
                //
                total          += item.AssociatedMemory;
                atLeastOneValue = true;
            }

            string totalValueAsString      = "[nothing selected]";
            string totalAsPercentageString = "";

            //
            if (atLeastOneValue)
            {
                int  allocCount;
                int  freeCount;
                long freeSpaceSize;
                long allocatedUnknownSize;
                long allocatedSymbolMatchSize;
                long totalHeapAllocatedMemory = TotalAllocatedMemory(out allocCount, out freeCount, out freeSpaceSize, out allocatedUnknownSize, out allocatedSymbolMatchSize);
                //
                totalValueAsString      = total.ToString();
                totalAsPercentageString = NumberFormattingUtils.NumberAsPercentageTwoDP(total, totalHeapAllocatedMemory) + " %";
            }
            //
            iLV_Summary.Items[9].SubItems[1].Text = totalValueAsString;
            iLV_Summary.Items[9].SubItems[2].Text = totalAsPercentageString;
        }
Esempio n. 3
0
        private void UpdateTable()
        {
            iTable.BeginUpdate();
            iTableModel.Rows.Clear();
            //
            long total = iDistribution.Total;

            foreach (DictionaryEntry entry in iDistribution)
            {
                uint   size                       = (uint)(entry.Key);
                uint   instanceCount              = (uint)entry.Value;
                uint   totalForSize               = size * instanceCount;
                double percentageDistribution     = ((double)(totalForSize) / ((double)total)) * 100.0;
                double percentageHeap             = ((double)(totalForSize) / ((double)TotalHeapSize)) * 100.0;
                string percentageTextDistribution = NumberFormattingUtils.NumberAsPercentageTwoDP(totalForSize, total) + " %";
                string percentageTextHeap         = NumberFormattingUtils.NumberAsPercentageTwoDP(totalForSize, TotalHeapSize) + " %";
                //
                XPTable.Models.Row row = new XPTable.Models.Row();
                //
                XPTable.Models.Cell cellSize = new XPTable.Models.Cell(size.ToString() + " bytes");
                cellSize.Tag = size;
                XPTable.Models.Cell cellInstanceCount = new XPTable.Models.Cell(instanceCount.ToString());
                cellInstanceCount.Data = instanceCount;
                XPTable.Models.Cell cellTotalForSize = new XPTable.Models.Cell(totalForSize.ToString());
                cellTotalForSize.Data = totalForSize;
                XPTable.Models.Cell cellPercentage = new XPTable.Models.Cell(percentageTextDistribution);
                cellPercentage.Tag = percentageDistribution;
                XPTable.Models.Cell cellPercentageOfHeap = new XPTable.Models.Cell(percentageTextHeap);
                cellPercentageOfHeap.Tag = percentageHeap;
                //
                row.Cells.Add(cellSize);
                row.Cells.Add(cellInstanceCount);
                row.Cells.Add(cellTotalForSize);
                row.Cells.Add(cellPercentage);
                row.Cells.Add(cellPercentageOfHeap);
                //
                iTableModel.Rows.Add(row);
            }
            //
            iTable.EndUpdate();
        }