kosiew commented on code in PR #24257:
URL: https://github.com/apache/datafusion/pull/24257#discussion_r3775188078


##########
datafusion/physical-expr-common/src/binary_view_map.rs:
##########
@@ -469,11 +469,14 @@ where
     }
 
     /// Return the total size, in bytes, of memory used to store the data in
-    /// this set, not including `self`
+    /// this set, not including `self` or input-array buffers.
     pub fn size(&self) -> usize {
-        let views_size = self.views.len() * size_of::<u128>();
-        let in_progress_size = self.in_progress.capacity();
-        let completed_size: usize = self.completed.iter().map(|b| 
b.len()).sum();
+        // All fields below own their allocations. Count retained capacity 
rather
+        // than used length because this value drives memory accounting.
+        let views_size = self.views.heap_size(&mut DFHeapSizeCtx::default());

Review Comment:
   Amended to use `allocated_size`.



-- 
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.

To unsubscribe, e-mail: [email protected]

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