diff --git a/datafusion/common/src/utils/memory.rs b/datafusion/common/src/utils/memory.rs index c68640d0fab1..b842c7e21fd4 100644 --- a/datafusion/common/src/utils/memory.rs +++ b/datafusion/common/src/utils/memory.rs @@ -142,10 +142,9 @@ pub fn estimate_memory_size(num_elements: usize, fixed_size: usize) -> Result /// In the above case, `get_record_batch_memory_size` will return the size of /// the buffer, instead of the sum of `col1` and `col2`'s actual memory size. /// -/// Note: The current [`RecordBatch::get_array_memory_size`] will double count -/// the buffer memory size if multiple arrays within the batch are sharing the -/// same `Buffer`. This method provides a temporary fix until the issue is -/// resolved: +/// Note: [`RecordBatch::get_array_memory_size`] double counts the buffer +/// memory size if multiple arrays within the batch are sharing the same +/// `Buffer`, while this function counts each `Buffer` exactly once. pub fn get_record_batch_memory_size(batch: &RecordBatch) -> usize { RecordBatchMemoryCounter::new().count_batch(batch) }