Add tracking of memory allocation per operator#14191
Add tracking of memory allocation per operator#14191mbasmanova merged 8 commits intoprestodb:masterfrom
Conversation
|
cc @viczhang861 : Can this deprecate the tagged memory pool? 😃 (discussed in #14117) |
|
@wenleix Briefly went through change in this PR, it updates allocation when an operator completes. Tagged memory pool is updated whenever some bytes are reserved, which is more up-to-date (that is why tagged memory update is expensive but useful for debugging purpose). |
There was a problem hiding this comment.
- This is simpler to understand :)
!(trackOverallAllocation && THREAD_MX_BEAN_EX == null)
!(trackOperationAllocation && !trackOverallAllocation) - Move second check up
There was a problem hiding this comment.
@viczhang861 Changed to
this.trackOverallAllocation = trackOverallAllocation;
this.trackOperationAllocation = trackOperationAllocation;
if (trackOverallAllocation) {
checkArgument(THREAD_MX_BEAN_EX != null, "tracking allocation is not supported by this JVM");
}
else {
checkArgument(!trackOperationCpuTime, "tracking operation cpu time without tracking overall cpu time is not supported");
}
There was a problem hiding this comment.
Much better. I restarted a failed test.
0bf4e22 to
99bfadc
Compare
aweisberg
left a comment
There was a problem hiding this comment.
Everything looks good except for a nit regarding the naming "allocation timer enabled" and "per operator allocation timer enabled". The CPU version of this is a timer because it's measuring time.
This is tracking allocation bytes. I would suggest something like "tracking" or "measurement". Those aren't perfect either, but I can't think of anything better.
I think |
There was a problem hiding this comment.
nit: maybe better allocationTracker? The word timer is used for the CPU because the CPU utilization is measured in "time" units (e.g.: milliseconds)
There was a problem hiding this comment.
Currently Presto does not support any other VM's than Oracle JVM. How about just trying to cast ((com.sun.management.ThreadMXBean) THREAD_MX_BEAN) unconditionally inplace. In will throw a meaningful ClassCastException if for some very weird reson some other then com.sun.management.ThreadMXBean implementation is supplied.
There was a problem hiding this comment.
tracking operator allocations without ...
99bfadc to
8529410
Compare
8529410 to
6321132
Compare
|
@aweisberg @arhimondr Ariel, Andrii, thank you for reviews. Comments addressed. CC: @rschlussel |
aweisberg
left a comment
There was a problem hiding this comment.
Found a few more timer instances. Otherwise LGTM.
6321132 to
7caf111
Compare
|
@aweisberg Ariel, thank you for review. I renamed the remaining timers. |
|
LGTM! 🚢 it. |
Here is a snippet of the query JSON fetched from the coordinator featuring new fields: addInput/getOutput/finishAllocation