Copilot commented on code in PR #534:
URL: https://github.com/apache/arrow-dotnet/pull/534#discussion_r4792599758
##########
src/Apache.Arrow/Memory/SharedMemoryHandle.cs:
##########
@@ -21,19 +21,48 @@ namespace Apache.Arrow.Memory
internal sealed class SharedMemoryHandle : IMemoryOwner<byte>
{
private SharedMemoryOwner _owner;
+ private readonly Memory<byte> _memory;
Review Comment:
The cached `_memory` keeps an array-backed allocation reachable even after
`Release()` clears `_owner`. With a managed allocator such as
`TestMemoryAllocator`, retaining a disposed buffer or batch now retains its
backing array—including the entire dictionary body—until that wrapper is
collected. Please clear the cached memory on release, or cache only the slice
coordinates and obtain memory from the live owner.
--
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]