Page 1 of 1

Decompressing very large files with unknown output size

Posted: Sat Feb 23, 2013 5:55 pm
by finale00
How do I work with these files?

My memory usage goes boom when it runs into a file that's like several hundred MB's and once it's done memory usage drops back to like nothing.

What are some techniques I can use?

Re: Decompressing very large files with unknown output size

Posted: Sat Feb 23, 2013 10:16 pm
by shakotay2
finale00 wrote:What are some techniques I can use?
(just a transitory remembrance, didn't use it for a long time:)
maybe "memory mapping" the file could help?

(In WinAPI the function's called CreateFileMapping())

Re: Decompressing very large files with unknown output size

Posted: Sun Feb 24, 2013 7:25 pm
by Dinoguy1000
Can you decompress them in chunks? If so, there's no reason to do the whole file in one shot.

Re: Decompressing very large files with unknown output size

Posted: Sun Feb 24, 2013 10:20 pm
by finale00
lol you're right; and the code (I copied off the examples that came with the library) is already decompressing about one MB at a time and writing to a memory stream...