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

Method CreateQueryMemTracker

be/src/runtime/mem-tracker.cc:219–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219MemTracker* MemTracker::CreateQueryMemTracker(const TUniqueId& id,
220 int64_t mem_limit, const string& pool_name, ObjectPool* obj_pool) {
221 if (mem_limit != -1) {
222 if (mem_limit > MemInfo::physical_mem()) {
223 LOG(WARNING) << "Memory limit " << PrettyPrinter::Print(mem_limit, TUnit::BYTES)
224 << " exceeds physical memory of "
225 << PrettyPrinter::Print(MemInfo::physical_mem(), TUnit::BYTES);
226 }
227 VLOG(2) << "Using query memory limit: "
228 << PrettyPrinter::Print(mem_limit, TUnit::BYTES);
229 }
230
231 MemTracker* pool_tracker =
232 ExecEnv::GetInstance()->pool_mem_trackers()->GetRequestPoolMemTracker(
233 pool_name, true);
234 MemTracker* tracker = obj_pool->Add(new MemTracker(
235 mem_limit, Substitute("Query($0)", PrintId(id)), pool_tracker, true, true, id));
236 return tracker;
237}
238
239MemTracker::~MemTracker() {
240 // We should explicitly close MemTrackers in the context of a daemon process. It is ok

Callers

nothing calls this directly

Calls 5

SubstituteFunction · 0.85
PrintIdFunction · 0.85
pool_mem_trackersMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected