MCPcopy Create free account
hub / github.com/apache/impala / ReleaseMemory

Method ReleaseMemory

be/src/runtime/bufferpool/buffer-allocator.cc:469–481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467}
468
469void BufferPool::BufferAllocator::ReleaseMemory(int64_t bytes_to_free) {
470 int64_t bytes_freed = 0;
471 int current_core = CpuInfo::GetCurrentCore();
472 for (int i = 0; i < per_core_arenas_.size(); ++i) {
473 int core_to_check = (current_core + i) % per_core_arenas_.size();
474 FreeBufferArena* arena = per_core_arenas_[core_to_check].get();
475 // Free but don't claim any memory.
476 bytes_freed += arena->FreeSystemMemory(bytes_to_free - bytes_freed, 0, nullptr).first;
477 if (bytes_freed >= bytes_to_free) break;
478 }
479 VLOG(1) << "BufferAllocator::ReleaseMemory(): Freed "
480 << PrettyPrinter::PrintBytes(bytes_freed);
481}
482
483int BufferPool::BufferAllocator::GetFreeListSize(int core, int64_t len) {
484 return per_core_arenas_[core]->GetFreeListSize(len);

Callers

nothing calls this directly

Calls 4

PrintBytesFunction · 0.85
FreeSystemMemoryMethod · 0.80
getMethod · 0.65
sizeMethod · 0.45

Tested by

no test coverage detected