File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
compiler-rt/lib/scudo/standalone Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -1565,6 +1565,13 @@ bool SizeClassAllocator64<Config>::hasChanceToReleasePages(
1565
1565
if (DiffSinceLastReleaseNs < 2 * IntervalNs)
1566
1566
return false ;
1567
1567
} else if (DiffSinceLastReleaseNs < IntervalNs) {
1568
+ // `TryReleaseThreshold` is capped by (1UL << GroupSizeLog) / 2). If
1569
+ // RegionPushedBytesDelta grows to twice the threshold, it implies some
1570
+ // huge deallocations have happened so we better try to release some
1571
+ // pages. Note this tends to happen for larger block sizes.
1572
+ if (RegionPushedBytesDelta > (1ULL << GroupSizeLog))
1573
+ return true ;
1574
+
1568
1575
// In this case, we are over the threshold but we just did some page
1569
1576
// release in the same release interval. This is a hint that we may want
1570
1577
// a higher threshold so that we can release more memory at once.
You can’t perform that action at this time.
0 commit comments