| 459 | } |
| 460 | |
| 461 | void 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 | |
| 494 | void Window::createPeerAndFrameBuffers() { |
| 495 | // TODO: This computation needs to be revised. It only takes into account |
nothing calls this directly
no test coverage detected