MCPcopy Create free account
hub / github.com/bytedance/bolt / reclaim

Method reclaim

bolt/exec/HashJoinBridge.cpp:207–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207uint64_t HashJoinMemoryReclaimer::reclaim(
208 memory::MemoryPool* pool,
209 uint64_t targetBytes,
210 uint64_t maxWaitMs,
211 memory::MemoryReclaimer::Stats& stats) {
212 uint64_t reclaimedBytes{0};
213 pool->visitChildren([&](memory::MemoryPool* child) {
214 BOLT_CHECK_EQ(child->kind(), memory::MemoryPool::Kind::kLeaf);
215 // The hash probe operator do not support memory reclaim.
216 if (!isHashBuildMemoryPool(*child)) {
217 return true;
218 }
219 // We only need to reclaim from any one of the hash build operators
220 // which will reclaim from all the peer hash build operators.
221 reclaimedBytes = child->reclaim(targetBytes, maxWaitMs, stats);
222 return false;
223 });
224 return reclaimedBytes;
225}
226
227bool isHashBuildMemoryPool(const memory::MemoryPool& pool) {
228 return folly::StringPiece(pool.name()).endsWith("HashBuild");

Callers

nothing calls this directly

Calls 3

isHashBuildMemoryPoolFunction · 0.85
visitChildrenMethod · 0.45
kindMethod · 0.45

Tested by

no test coverage detected