txwyy123 commented on code in PR #26149:
URL: https://github.com/apache/datafusion/pull/26149#discussion_r4250592661
##########
datafusion/common/src/utils/memory.rs:
##########
@@ -410,6 +505,33 @@ fn count_unique_array_object_memory_size(
.sum::<usize>()
}
+/// Inverse of [`count_unique_array_object_memory_size`]: removes array
+/// identities from the tracked set and returns the released overhead.
+fn uncount_unique_array_object_memory_size(
Review Comment:
Good catch — fixed. Changed `counted_arrays` from `HashSet<usize>` to
`hashbrown::HashMap<usize, u32>` with the exact refcounting pattern you
suggested (increment on count, decrement on uncount, only recurse on 0→1 /
1→0). Added your repro test as `test_overhead_released_while_still_held`.
--
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]