Compress large file using SharpZipLib causing Out Of Memory Exception
问题 I have a 453MB XML file which I'm trying to compress to a ZIP using SharpZipLib. Below is the code I'm using to create the zip, but it's causing an OutOfMemoryException . This code successfully compresses a file of 428MB. Any idea why the exception is happening, as I can't see why, as my system has plenty of memory available. public void CompressFiles(List<string> pathnames, string zipPathname) { try { using (FileStream stream = new FileStream(zipPathname, FileMode.Create, FileAccess.Write,