Video Screencast Help

System.OutOfMemoryException Error

Created: 26 Sep 2012 • Updated: 27 Sep 2012 | 7 comments
This issue has been solved. See solution.

I'm getting this error for one workflow running on the server and only this one. I've checked the server and there's almost to 2 GB of RAM available and enough on the hard drive. There are other workflows running fine and seem unaffected. I know an IIS reset will probably fix it but is there anything else I can try before doing that as I hate having to do that because it affects all the other worklfows. I've already tried publishing the project again but that didn't work.

Comments 7 CommentsJump to latest comment

Aryanos's picture

 

Looking at the error log these two error come up but in the workflow there is no Zip component used for the first error.
 
System.Exception: Could not read in object  ---> System.Exception: Unable to extract Zip File ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.IO.MemoryStream.set_Capacity(Int32 value)
   at System.IO.MemoryStream.EnsureCapacity(Int32 value)
   at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at LogicBase.Framework.ZipArchiveMap.ReadIn(Stream compressedStream)
   --- End of inner exception stack trace ---
   at LogicBase.Framework.ZipArchiveMap.ReadIn(Stream compressedStream)
   at LogicBase.Framework.ZipArchiveMap..ctor(FileInfo info, Boolean readInExisting)
   at LogicBase.Framework.ObjectStorage.Deserialize(FileInfo fromFile)
   --- End of inner exception stack trace ---
   at LogicBase.Framework.ObjectStorage.Deserialize(FileInfo fromFile)
   at LogicBase.Core.AbstractOrchestrationProject.GetComponentModelPrivate(Model model, Type componentModelType)
   at LogicBase.Core.AbstractOrchestrationProject.GetComponentModelById(String id)
   at LogicBase.Core.Models.Workflow.WorkQueueItem.get_ComponentModel()
   at LogicBase.Core.Models.Workflow.WorkQueueItem.get_Component()
   at LogicBase.Core.Models.Workflow.WorkflowExecutionEngine.InternalProcessTimeoutsAndEscalations()
 
-----------------------------------------------------------------------------------------------------------------------------------------------------
System.Exception: Could not read in object  ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity)
   at System.Text.StringBuilder.GetNewString(String currentString, Int32 requiredLength)
   at System.Text.StringBuilder.Append(Char[] value, Int32 startIndex, Int32 charCount)
   at System.IO.StreamReader.ReadToEnd()
   at LogicBase.Framework.ObjectStorage.Deserialize(FileInfo fromFile)
   --- End of inner exception stack trace ---
   at LogicBase.Framework.ObjectStorage.Deserialize(FileInfo fromFile)
   at LogicBase.Core.AbstractOrchestrationProject.GetComponentModelPrivate(Model model, Type componentModelType)
   at LogicBase.Core.AbstractOrchestrationProject.GetComponentModelById(String id)
   at LogicBase.Core.Models.Workflow.WorkQueueItem.get_ComponentModel()
   at LogicBase.Core.Models.Workflow.WorkQueueItem.get_Component()
   at LogicBase.Core.Models.Workflow.WorkflowExecutionEngine.InternalProcessTimeoutsAndEscalations()

 

I like my beats fast and my bass down low

reecardo's picture

What version of WF are you running?

Aryanos's picture

WF 7.0.1313.28

Build Number 1313

I like my beats fast and my bass down low

AnaMan's picture

I think the size of physical RAM shouldn't be a problem (virtual memory should be able to manage with such problems) - more important is the processor and system architecture.

It could be also a problem with broken or extremaly large task messages stored in exchange queues. But usually so large messages are created when processes is using an extensive parallelism.
What kind of the operating system is installed on this machine: 32-bit or 64-bit? The problem with too large message objects is much more probable on 32-bit systems.

It also looks a bit like a some kind of memory leak problem in ICSharpCode.SharpZipLib.dll library providing ZIP decompression service but I rather doubt this is it.

Aryanos's picture

It's a Windows 2003 R2 SP 2 server and it's only 32-bits. I did an IIS reset and it's working now but there has to be a way to fix this without having to do an IIS reset all the time.

I like my beats fast and my bass down low

SOLUTION
AnaMan's picture

This is a bit strange for me what happens in this error. The exception is thrown during timeout processing when the task message is read and then engine tries to read and deserialize a process model which should be already loaded for currently running process.
I've noticed some problems when an application pool is set to recycle once a day. Then all processes have to load again into memory its models when first timeout must be serviced.

Maybe your process has one especially large model? Then sometimes can happen following scenario. During a time on machine where many different process are executed heap memory in .NET becames seriously fragmented. When worfklow engine tries to load something really big like this model the .NET CLR is unable to allocate large enough memory block.

Aryanos's picture

The really weird thing is that you couldn't open the form if you wanted to start a new workflow but the approval tasks, that open the same form with populated data worked so that was puzzling. One would expect that if you were to open a new form with no data present then it wouldn't be able to open an approval form with data present.

I like my beats fast and my bass down low