Aug 26, 2010 at 7:25 AM
Edited Aug 26, 2010 at 8:57 AM
I've read the other items related to out of memory errors on save that are related to memory streams (such as 67797), but I think my issue is different as I am using files, not memory streams. The error is intermittent and our application is deployed as
a Citrix published application (that is, it runs in a virtualised environment).
A typical stack trace recorded in our error log is as follows:
20100825_15:09:15.187 (thread=1): Exception Message: Exception of type 'System.OutOfMemoryException' was thrown.
20100825_15:09:15.203 (thread=1): Exception Stack trace:
at Ionic.Zlib.ParallelDeflateOutputStream.WorkItem..ctor(Int32 size, CompressionLevel compressLevel, CompressionStrategy strategy)
at Ionic.Zlib.ParallelDeflateOutputStream.Write(Byte buffer, Int32 offset, Int32 count)
at Ionic.Zlib.CrcCalculatorStream.Write(Byte buffer, Int32 offset, Int32 count)
at Ionic.Zip.ZipEntry._WriteEntryData(Stream s)
at Ionic.Zip.ZipEntry.Write(Stream s)
Our code looks like this:
using (ZipFile zipFile = new ZipFile(zippedFilenameFullpath))
foreach (string fileToZip in filesToZip)
zipFile.Comment = commentDateTime.ToString(JBSConstants.STRING_ZIP_COMMENT_DATE_TEMPLATE);
We were using version 126.96.36.199 but based on discussion item 80894 I have recently upgraded the application to 188.8.131.52 and added code to set ParallelDeflatethreshold to -1 immediately after the object is constructed (just before the foreach statement) but
it will take some time to get the software deployed into production and we haven't been able to reproduce the problem in our development and test environments - it only happens in production and only infrequently (we've not been able to 'make' it happen, only
respond to issues when users are affected).
I'll update this issue if the problem is fixed by 184.108.40.206 and the ParallelDeflatethreshold property, but I thought I'd raise it here in case there is anything that I've missed or anyone has ideas on other things to try.