@@ -165,7 +165,7 @@ struct Stats {
165165 foreachAC ([&](auto pid, auto cid, auto stats) {
166166 auto [allocSizeSuffix, allocSize] = formatMemory (stats.allocSize );
167167 auto [memorySizeSuffix, memorySize] =
168- formatMemory (stats.activeAllocs * stats. allocSize );
168+ formatMemory (stats.totalAllocatedSize () );
169169 out << folly::sformat (" pid{:2} cid{:4} {:8.2f}{} memorySize: {:8.2f}{}" ,
170170 pid, cid, allocSize, allocSizeSuffix, memorySize,
171171 memorySizeSuffix)
@@ -177,15 +177,9 @@ struct Stats {
177177
178178 // If the pool is not full, extrapolate usageFraction for AC assuming it
179179 // will grow at the same rate. This value will be the same for all ACs.
180- double acUsageFraction;
181- if (poolUsageFraction[pid] < 1.0 ) {
182- acUsageFraction = poolUsageFraction[pid];
183- } else if (stats.usedSlabs == 0 ) {
184- acUsageFraction = 0.0 ;
185- } else {
186- acUsageFraction =
187- stats.activeAllocs / (stats.usedSlabs * stats.allocsPerSlab );
188- }
180+ auto acUsageFraction = (poolUsageFraction[pid] < 1.0 )
181+ ? poolUsageFraction[pid]
182+ : stats.usageFraction ();
189183
190184 out << folly::sformat (
191185 " pid{:2} cid{:4} {:8.2f}{} usageFraction: {:4.2f}" , pid, cid,
0 commit comments