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

Method reclaim

bolt/exec/Window.cpp:461–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459}
460
461void Window::reclaim(
462 uint64_t targetBytes,
463 memory::MemoryReclaimer::Stats& stats) {
464 BOLT_CHECK(canReclaim());
465 BOLT_CHECK(!nonReclaimableSection_);
466
467 if (!needSort_ && noMoreInput_) {
468 ++stats.numNonReclaimableAttempts;
469 // TODO Add support for spilling after noMoreInput().
470 LOG(WARNING)
471 << name()
472 << " Can't reclaim from window operator which has started producing output: "
473 << pool()->name()
474 << ", usage: " << succinctBytes(pool()->currentBytes())
475 << ", reservation: " << succinctBytes(pool()->reservedBytes());
476 return;
477 }
478 if (needSort_ && !noMoreInput_) {
479 LOG(INFO) << __FUNCTION__ << " enter sortSpill. Before spill: usedBytes = "
480 << pool()->currentBytes()
481 << ", reservedBytes = " << pool()->reservedBytes();
482 windowBuild_->sortSpill();
483 } else {
484 LOG(INFO) << "nomore input windowBuild->spill()";
485 windowBuild_->spill();
486 }
487
488 pool()->release();
489 LOG(INFO) << __FUNCTION__
490 << " after release usedBytes = " << pool()->currentBytes()
491 << ", reservedBytes = " << pool()->reservedBytes();
492}
493
494void Window::createPeerAndFrameBuffers() {
495 // TODO: This computation needs to be revised. It only takes into account

Callers

nothing calls this directly

Calls 8

succinctBytesFunction · 0.85
sortSpillMethod · 0.80
poolFunction · 0.50
nameMethod · 0.45
currentBytesMethod · 0.45
reservedBytesMethod · 0.45
spillMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected