OutOfMemoryException on Save with big files

Jul 28, 2011 at 1:52 PM
Edited Jul 28, 2011 at 2:22 PM

Hi,

I'm using the build 1.9.1.5 and ZipFile throws OutOfMemoryException when I try to zip a folder containing 1013MB of files. (there is no inner zip file)

This is the callstack:

Exception=System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.IO.Compression.FastEncoderWindow..ctor()
   at System.IO.Compression.FastEncoder..ctor(Boolean doGZip)
   at System.IO.Compression.Deflater..ctor(Boolean doGZip)
   at System.IO.Compression.DeflateStream..ctor(Stream stream, CompressionMode mode, Boolean leaveOpen, Boolean usingGZip)
   at System.IO.Compression.DeflateStream..ctor(Stream stream, CompressionMode mode, Boolean leaveOpen)
   at ionic.utils.zip.ZipEntry.get_CompressedStream()
   at ionic.utils.zip.ZipEntry.WriteHeader(Stream s, Byte[] bytes)
   at ionic.utils.zip.ZipEntry.Write(Stream s)
   at ionic.utils.zip.ZipFile.Save()

I'm running under Windows Server 2003, 32 bits. With 2BG of ram.

This is the code I use:

 using (ZipFile zip = new ZipFile(zipFullFileName))
 {
    zip.AddDirectory(folder, true); // recurses subdirectories
    zip.Save();
 }

zipFullFileName refert to the Temp directory of Windows: C:\Windows\Temp\MyZipFile.zip

folder contains 1GB of files. folder is also in the Temp directory of Windows.

I can't see where I can change the compressionLevel as seen in other post.

Does 1GB is supported?

Is it a known issue?

 

Pierre-Luc

Jul 28, 2011 at 6:14 PM

Copied to Issue tracker.

Coordinator
Jul 29, 2011 at 6:13 AM

You are not using DotNetZip v1.9.1.5.  The callstack you showed is impossible to achieve with v1.9.1.5.

This is also why you cannot find the way to change the compression level.

I think you are actually using v1.5 or v1.6.   

Please try your code again with v1.9.1.5, and I'm sure you'll find success.