diff --git a/pkg/util/mon/bytes_usage.go b/pkg/util/mon/bytes_usage.go index 45a41708b66b..906c5b446c37 100644 --- a/pkg/util/mon/bytes_usage.go +++ b/pkg/util/mon/bytes_usage.go @@ -571,8 +571,10 @@ func (b *BoundAccount) Grow(ctx context.Context, x int64) error { // Shrink releases part of the cumulated allocations by the specified size. func (b *BoundAccount) Shrink(ctx context.Context, delta int64) { if b.used < delta { - panic(fmt.Sprintf("%s: no bytes in account to release, current %d, free %d", - b.mon.name, b.used, delta)) + log.ReportOrPanic(ctx, &b.mon.settings.SV, + "%s: no bytes in account to release, current %d, free %d", + b.mon.name, b.used, delta) + delta = b.used } b.used -= delta b.reserved += delta