785 |
787 |
786 overAllMaxSize := overAllCount := 0. |
788 overAllMaxSize := overAllCount := 0. |
787 |
789 |
788 l := OrderedCollection new. |
790 l := OrderedCollection new. |
789 info doWithIndex:[:entry :i | |
791 info doWithIndex:[:entry :i | |
790 |line avgSz avgSzString maxSz instCount percent| |
792 |line avgSz avgSzString maxSz instCount percent allocRate memRate s1 s2| |
791 |
793 |
792 maxSz := entry maxByteSize. |
794 maxSz := entry maxByteSize. |
793 avgSz := entry averageSize asFixedPoint:1. |
795 avgSz := entry averageSize asFixedPoint:1. |
794 avgSz = maxSz ifTrue:[ |
796 avgSz = maxSz ifTrue:[ |
795 avgSzString := avgSz asInteger printString , ' '. |
797 avgSzString := avgSz asInteger printString , ' '. |
809 "/ percent < 0.0 ifTrue:[self halt]. |
811 "/ percent < 0.0 ifTrue:[self halt]. |
810 line := line , ((percent asFixedPoint:1) printStringLeftPaddedTo:accumMemoryUseLen). |
812 line := line , ((percent asFixedPoint:1) printStringLeftPaddedTo:accumMemoryUseLen). |
811 lastP := sumPercent := ((sumPercent + percent) min:100.0). |
813 lastP := sumPercent := ((sumPercent + percent) min:100.0). |
812 line := line , ((sumPercent asFixedPoint:1) printStringLeftPaddedTo:accumMemoryUseLen). |
814 line := line , ((sumPercent asFixedPoint:1) printStringLeftPaddedTo:accumMemoryUseLen). |
813 |
815 |
814 line := line , (entry instanceAllocationRate printStringLeftPaddedTo:countLen). |
816 allocRate := entry instanceAllocationRate. |
815 line := line , (entry memoryAllocationRate printStringLeftPaddedTo:bytesUsedSize). |
817 memRate := entry memoryAllocationRate. |
|
818 s1 := allocRate printString. |
|
819 s2 := memRate printString. |
|
820 allocRate > 0 ifTrue:[ |
|
821 s1 := s1 colorizeAllWith:(Color red). |
|
822 s2 := s2 colorizeAllWith:(Color red). |
|
823 ] ifFalse:[ |
|
824 allocRate < 0 ifTrue:[ |
|
825 s1 := s1 colorizeAllWith:(Color green darkened). |
|
826 s2 := s2 colorizeAllWith:(Color green darkened). |
|
827 ] |
|
828 ]. |
|
829 line := line , (s1 leftPaddedTo:countLen). |
|
830 line := line , (s2 leftPaddedTo:bytesUsedSize). |
816 |
831 |
817 l add:line. |
832 l add:line. |
818 |
833 |
819 overAllMaxSize := overAllMaxSize max:entry maxByteSize. |
834 overAllMaxSize := overAllMaxSize max:entry maxByteSize. |
820 overAllCount := overAllCount + instCount. |
835 overAllCount := overAllCount + instCount. |
1048 ! ! |
1067 ! ! |
1049 |
1068 |
1050 !MemoryUsageView class methodsFor:'documentation'! |
1069 !MemoryUsageView class methodsFor:'documentation'! |
1051 |
1070 |
1052 version |
1071 version |
1053 ^ '$Header: /cvs/stx/stx/libtool/MemoryUsageView.st,v 1.61 2012-11-04 22:12:51 cg Exp $' |
1072 ^ '$Header: /cvs/stx/stx/libtool/MemoryUsageView.st,v 1.63 2013-06-13 14:14:27 cg Exp $' |
1054 ! |
1073 ! |
1055 |
1074 |
1056 version_CVS |
1075 version_CVS |
1057 ^ '$Header: /cvs/stx/stx/libtool/MemoryUsageView.st,v 1.61 2012-11-04 22:12:51 cg Exp $' |
1076 ^ '$Header: /cvs/stx/stx/libtool/MemoryUsageView.st,v 1.63 2013-06-13 14:14:27 cg Exp $' |
1058 ! |
1077 ! |
1059 |
1078 |
1060 version_HG |
1079 version_HG |
1061 |
1080 |
1062 ^ '$Changeset: <not expanded> $' |
1081 ^ '$Changeset: <not expanded> $' |