-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[native]Update Prestissimo to report the actual used task memory #22833
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
@@ -654,8 +654,8 @@ TEST_P(PrestoExchangeSourceTest, slowProducer) { | |||
auto queue = makeSingleSourceQueue(); | |||
auto exchangeSource = makeExchangeSource(producerAddress, useHttps, 3, queue); | |||
|
|||
size_t beforePoolSize = pool_->currentBytes(); | |||
size_t beforeQueueSize = queue->totalBytes(); | |||
const size_t beforePoolSize = pool_->usedBytes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const auto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why auto here?
size_t beforePoolSize = pool_->currentBytes(); | ||
size_t beforeQueueSize = queue->totalBytes(); | ||
const size_t beforePoolSize = pool_->usedBytes(); | ||
const size_t beforeQueueSize = queue->totalBytes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
size_t deltaPool = pool_->currentBytes() - beforePoolSize; | ||
size_t deltaQueue = queue->totalBytes() - beforeQueueSize; | ||
EXPECT_EQ(deltaPool, deltaQueue); | ||
const size_t deltaPoolBytes = pool_->usedBytes() - beforePoolSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
7116c80
to
36ceb0c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from my end. @tanjialiang pleast take another look if auto
is a blocker. Otherwise lets accept and land it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiaoxmeng
Thank you for the change!
Let's update the PR description to explain what we are trying to achieve.
Also, left few questions, because it is not clear why we making these changes.
const auto currentBytes = task->pool()->usedBytes(); | ||
prestoTaskStats.userMemoryReservationInBytes = currentBytes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we get 'currentBytes' from 'veloxTaskMemStats'?
they are both received from the pool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stats() still use currentBytes(), and I will switch to use usedBytes in stats() after deprecate currentBytes.
@@ -1199,7 +1199,7 @@ protocol::NodeStatus PrestoServer::fetchNodeStatus() { | |||
(int)std::thread::hardware_concurrency(), | |||
cpuLoadPct, | |||
cpuLoadPct, | |||
pool_ ? pool_->currentBytes() : 0, | |||
pool_ ? pool_->usedBytes() : 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the diff between currentBytes and usedBytes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currentBytes is deprecated. I will remove from velox later.
Changes to report the cumulative bytes using usedBytes from non-leaf pool instead of reserved bytes so as to track the actual memory usage better.
Changes to report the cumulative bytes using usedBytes from non-leaf pool instead of
reserved bytes so as to track the actual memory usage better.