@@ -194,7 +194,7 @@ struct Stats {
194194 foreachAC (allocationClassStats, [&](auto pid, auto cid, auto stats) {
195195 auto [allocSizeSuffix, allocSize] = formatMemory (stats.allocSize );
196196 auto [memorySizeSuffix, memorySize] =
197- formatMemory (stats.activeAllocs * stats. allocSize );
197+ formatMemory (stats.totalAllocatedSize () );
198198 out << folly::sformat (" pid{:2} cid{:4} {:8.2f}{} memorySize: {:8.2f}{}" ,
199199 pid, cid, allocSize, allocSizeSuffix, memorySize,
200200 memorySizeSuffix)
@@ -206,15 +206,9 @@ struct Stats {
206206
207207 // If the pool is not full, extrapolate usageFraction for AC assuming it
208208 // will grow at the same rate. This value will be the same for all ACs.
209- double acUsageFraction;
210- if (poolUsageFraction[pid] < 1.0 ) {
211- acUsageFraction = poolUsageFraction[pid];
212- } else if (stats.usedSlabs == 0 ) {
213- acUsageFraction = 0.0 ;
214- } else {
215- acUsageFraction =
216- stats.activeAllocs / (stats.usedSlabs * stats.allocsPerSlab );
217- }
209+ auto acUsageFraction = (poolUsageFraction[pid] < 1.0 )
210+ ? poolUsageFraction[pid]
211+ : stats.usageFraction ();
218212
219213 out << folly::sformat (
220214 " pid{:2} cid{:4} {:8.2f}{} usageFraction: {:4.2f}" , pid, cid,
0 commit comments