Hello @Eugene.Shashkov
If there will be option to dispose the stream right away after use, and then the reference to a stream instance will be released right after that, that should cover all our needs.
That will minimize the number of streams that stay in memory at the moment in time and that is exactly what we need.
@Eugene.Shashkov I have briefly tested the CloseEntrySource setting, and the behavior is the stream is closed right away, but still not disposed and released until the Archive instance itself is disposed. This way there’s still a possibility for resource leak depending on stream implementation, for example if any internal buffers are not dereferenced upon close (e.g. MemoryStream.Close does not dereference it’s buffer, and it’s memory only released when the stream instance is collected by GC).
This implementation should be good enough in our case though.
Worst case we can wrap the stream into a lightweight wrapper that would fully dispose and dereference the wrapped stream upon close. In this case there will be no significant memory leak, we will just hold to a bunch of shell stream references, which is not too bad.
Thank you. We will work on integration of this into our code in some time.