Skip to content

Commit

Permalink
[native] Let API report correct query memory reservations
Browse files Browse the repository at this point in the history
  • Loading branch information
tanjialiang committed Mar 20, 2024
1 parent 7543c0a commit b4e92d8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions presto-native-execution/presto_cpp/main/PrestoServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1093,10 +1093,6 @@ void PrestoServer::populateMemAndCPUInfo() {

// Fill global pool fields.
poolInfo.maxBytes = nodeMemoryGb * 1024 * 1024 * 1024;
// TODO(sperhsin): If 'current bytes' is the same as we get by summing up all
// child contexts below, then use the one we sum up, rather than call
// 'getCurrentBytes'.
poolInfo.reservedBytes = pool_->currentBytes();
poolInfo.reservedRevocableBytes = 0;

// Fill basic per-query fields.
Expand All @@ -1111,6 +1107,7 @@ void PrestoServer::populateMemAndCPUInfo() {
poolInfo.queryMemoryAllocations.insert(
{queryId, {protocol::MemoryAllocation{"total", bytes}}});
++numContexts;
poolInfo.reservedBytes += bytes;
});
RECORD_METRIC_VALUE(kCounterNumQueryContexts, numContexts);
cpuMon_.update();
Expand Down

0 comments on commit b4e92d8

Please sign in to comment.