OpenMCDF icon indicating copy to clipboard operation
OpenMCDF copied to clipboard

Large memory consumption

Open ras254 opened this issue 7 years ago • 0 comments

Hi I tried to unpack a large msdf file (about 500 Mb) and got large memory consumption (about 6-8 Gb). I think what this because a new byte[] operation take place many times.

Can you made some changes like this: Sector.cs - add function

       public void GetData(byte[] buffer, int offset, int length)
        {
            if (IsStreamed)
            {
                stream.Seek((long)size + (long)this.id * (long)size, SeekOrigin.Begin);
                stream.Read(buffer, offset, Math.Min(size, length));
            }
        }

And use it at the StreamView.cs (function int Read(byte[] buffer, int offset, int count)) instead of sectorChain[secIndex].GetData() function

Thanks

ras254 avatar Aug 04 '17 12:08 ras254