| 1038 | const auto targetIncrementBytes = std::max<int64_t>( |
| 1039 | incrementBytes * 2, |
| 1040 | currentUsage * spillConfig_->spillableReservationGrowthPct / 100); |
| 1041 | { |
| 1042 | memory::ReclaimableSectionGuard guard(nonReclaimableSection_); |
| 1043 | if (pool_.maybeReserve(targetIncrementBytes)) { |
| 1044 | return; |
| 1045 | } |
| 1046 | } |
| 1047 | LOG(WARNING) << "Failed to reserve " << succinctBytes(targetIncrementBytes) |
| 1048 | << " for memory pool " << pool_.name() |
| 1049 | << ", usage: " << succinctBytes(pool_.currentBytes()) |
| 1050 | << ", reservation: " << succinctBytes(pool_.reservedBytes()) |
| 1051 | << ", flatBytes: " << succinctBytes(flatBytes) |
| 1052 | << ", input numRows = " << input->size() |
| 1053 | << ", outOfLineBytes = " << outOfLineBytes; |
| 1054 | } |
| 1055 | |
| 1056 | void GroupingSet::ensureOutputFits() { |
| 1057 | // If spilling has already been triggered on this operator, then we don't need |
| 1058 | // to reserve memory for the output as we can't reclaim much memory from this |
| 1059 | // operator itself. The output processing can reclaim memory from the other |
| 1060 | // operator or query through memory arbitration. |
| 1061 | if ((isPartial_ && preferPartialSpill_ == false) || spillConfig_ == nullptr || |
| 1062 | hasSpilled()) { |
| 1063 | return; |
| 1064 | } |
| 1065 | |
| 1066 | // Test-only spill path. |
| 1067 | if (spillConfig_->testSpillPct > 0 && |
| 1068 | (folly::hasher<uint64_t>()(++spillTestCounter_)) % 100 <= |
| 1069 | spillConfig_->testSpillPct) { |
| 1070 | spill(RowContainerIterator{}); |
| 1071 | return; |
| 1072 | } |
| 1073 | |
| 1074 | const uint64_t outputBufferSizeToReserve = |
nothing calls this directly
no test coverage detected