maropu commented on a change in pull request #31340:
URL: https://github.com/apache/spark/pull/31340#discussion_r566097445



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/ObjectAggregationIterator.scala
##########
@@ -76,6 +82,11 @@ class ObjectAggregationIterator(
    */
   processInputs()
 
+  TaskContext.get().addTaskCompletionListener[Unit](_ => {
+    // At the end of the task, update the task's spill size.
+    spillSize.set(TaskContext.get().taskMetrics().memoryBytesSpilled - 
spillSizeBefore)

Review comment:
       Just a comment; I feel it would be nicer if we could inspect object 
`hashMap` memory size (non-spilled case), too, but it looks difficult to do so, 
right?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to