Closed MatthewSteeples closed 3 years ago
Hello, given @loic-sharma's comments, I think the best strategy will be to use temporary files to relieve mem pressure.
I'm a bit worried about losing seekability on the stream, but that might not actually be an issue.
Some investigation or memory profiling may be needed before making changes. My thought is that .NET metadata is taking up the memory. I agree though that it would be nice to get rid of the ref to the zip.
This should hopefully resolve (or at least reduce) the OutOfMemoryExceptions mentioned in #108, #96, and #48
The summary is
ZipArchive
onPackageData
isn't used anywhere so doesn't need to be kept in memoryHttpRequest
already results in aMemoryStream
so there's no need for it to be copied aroundMemoryStream
that was being created wasn't being disposed (but now all Http components are being disposed)I've tested it locally and it seems to load fine, but obviously this issue was only intermittent so not easily reproducible.
If you are considering accepting this PR before the end of October, it would be great if you could apply the label
hacktoberfest-accepted
as explained here, but I'm not going to be offended if not. This has been a great resource for us and I'm glad I can give back to it