CurtHagenlocher opened a new pull request, #534: URL: https://github.com/apache/arrow-dotnet/pull/534
### What's changed? A dictionary's buffers are views of its message body, but nothing owned the body. With the default allocator a finalizer reclaimed it later; with an allocator whose memory isn't released by a finalizer, it was never returned. A record batch already takes ownership of its body; this does the same for dictionaries. - The reader wraps a dictionary message's body in a new `MessageBody`, which counts references to it. Each buffer that views the body, including a buffer stored uncompressed in a compressed stream, holds its own reference to its slice of the body. - The reader releases its own reference once the dictionary is built, so the body is released along with the last buffer that views it. A compressed dictionary's body is released as soon as it has been decompressed. - A `SharedMemoryHandle` can now refer to a slice of its owner's memory, and keeps that slice when retained. A disposed handle throws `ObjectDisposedException` rather than `NullReferenceException`. Closes #532. ### Testing - `DictionaryReferenceTests`, `DictionaryReferencePythonTests` and the dictionary case in `FailurePathReleaseTests` now expect nothing to remain allocated once the reader and every batch are disposed. Before, they expected one allocation per dictionary message. - `DictionaryReferenceTests` adds a mode that writes a compressed stream in which every buffer is stored uncompressed. All suites pass on net462, net472 and net8.0. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 5.5 <[email protected]> -- 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]
