CapableObjects forum



WCF Service System.InsufficientMemoryException

Posted By ryan_denn 2013-02-13 20:14:07
Add to Favorites0
Author Message
ryan_denn
 Posted 2013-02-13 20:14:07
Supreme Being

Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)

Group: Forum Members
Last Active: 2013-03-05 09:36:54
Posts: 58, Visits: 195
I have a WCF Service that works fine on my Windows 7 Desktop. But on Windows Server 2003 it throws an exception: "System.InsufficientMemory
Exception: Insufficient memory avaliable to complete the operation."

Can anybody help?

Here is an xml error trace:

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131075</EventID><Type>3</Type><SubType Name="Error">0</SubType><Level>2</Level><TimeCreated SystemTime="2013-02-13T17:10:42.7671250Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" /><Execution ProcessName="Manager.PServerWindowsService" ProcessID="164" ThreadID="8" /><Channel/><Computer>UA</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"><TraceIdentifier>http://msdn.microsoft.com/en-ZA/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier><Description>Throwing an exception.</Description><AppDomain>Manager.PServerWindowsService.exe</AppDomain><Exception><ExceptionType>System.InsufficientMemoryException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Insufficient memory avaliable to complete the operation.</Message><StackTrace> at System.ServiceModel.Channels.HttpOutput.ListenerResponseHttpOutput.ListenerResponseOutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
at System.ServiceModel.Channels.HttpRequestContext.OnReply(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestContextBase.Reply(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Reply(MessageRpc&amp;amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage9(MessageRpc&amp;amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage8(MessageRpc&amp;amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage7(MessageRpc&amp;amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage6(MessageRpc&amp;amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp;amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc&amp;amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&amp;amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp;amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&amp;amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&amp;amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp;amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&amp;amp; rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext)
at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)
at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)
at System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.Runtime.InputQueue`1.AsyncQueueReader.Set(Item item)
at System.Runtime.InputQueue`1.EnqueueAndDispatch(Item item, Boolean canDispatchOnThisThread)
at System.Runtime.InputQueue`1.EnqueueAndDispatch(T item, Action dequeuedCallback, Boolean canDispatchOnThisThread)
at System.ServiceModel.Channels.SingletonChannelAcceptor`3.Enqueue(QueueItemType item, Action dequeuedCallback, Boolean canDispatchOnThisThread)
at System.ServiceModel.Channels.HttpChannelListener.HttpContextReceived(HttpRequestContext context, Action callback)
at System.ServiceModel.Channels.SharedHttpTransportManager.OnGetContextCore(IAsyncResult result)
at System.ServiceModel.Channels.SharedHttpTransportManager.OnGetContext(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.ListenerAsyncResult.WaitCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
</StackTrace><ExceptionString>System.InsufficientMemoryException: Insufficient memory avaliable to complete the operation. ---&amp;gt; System.Net.HttpListenerException: Insufficient system resources exist to complete the requested service
at System.Net.HttpResponseStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.ServiceModel.Channels.BytesReadPositionStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.ServiceModel.Channels.HttpOutput.ListenerResponseHttpOutput.ListenerResponseOutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
--- End of inner exception stack trace ---</ExceptionString><InnerException><ExceptionType>System.Net.HttpListenerException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Insufficient system resources exist to complete the requested service</Message><StackTrace> at System.Net.HttpResponseStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.ServiceModel.Channels.BytesReadPositionStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.ServiceModel.Channels.HttpOutput.ListenerResponseHttpOutput.ListenerResponseOutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)</StackTrace><ExceptionString>System.Net.HttpListenerException (0x80004005): Insufficient system resources exist to complete the requested service
at System.Net.HttpResponseStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.ServiceModel.Channels.BytesReadPositionStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.ServiceModel.Channels.HttpOutput.ListenerResponseHttpOutput.ListenerResponseOutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)</ExceptionString><NativeErrorCode>5AA</NativeErrorCode></InnerException></Exception></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>524340</EventID><Type>3</Type><SubType Name="Error">0</SubType><Level>2</Level><TimeCreated SystemTime="2013-02-13T17:10:42.7671250Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" /><Execution ProcessName="Manager.PServerWindowsService" ProcessID="164" ThreadID="8" /><Channel/><Computer>UADWEB</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"><TraceIdentifier>http://msdn.microsoft.com/en-ZA/library/System.ServiceModel.ServiceOperationExceptionOnReply.aspx</TraceIdentifier><Description>Replying to an operation threw a exception.</Description><AppDomain>Manager.PServerWindowsService.exe</AppDomain><Source>System.ServiceModel.Dispatcher.ImmutableDispatchRuntime/43660463</Source><Exception><ExceptionType>System.InsufficientMemoryException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Insufficient memory avaliable to complete the operation.</Message><StackTrace> at System.ServiceModel.Channels.HttpOutput.ListenerResponseHttpOutput.ListenerResponseOutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at ...

ryan_denn
 Posted 2013-02-18 09:11:55
Supreme Being

Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)

Group: Forum Members
Last Active: 2013-03-05 09:36:54
Posts: 58, Visits: 195
Anybody?
ryan_denn
 Posted 2013-02-19 05:17:00
Supreme Being

Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)

Group: Forum Members
Last Active: 2013-03-05 09:36:54
Posts: 58, Visits: 195
I am completely lost here.

The Persistence Service (Windows Service, not IIS) that throws the error only throws it on Windows Server 2003 32bit.
It works fine on a 64bit Windows 7 Desktop using the same database.

The service itself seems to use a maximum of 499MB ram at peak, and the server does have available free ram.

The only information I have managed to find is, quote: "Try enabled bassicHTTP and/or Configuring the service to stream."

However I am not sure how to configure this in the Windows Persistence Service, or or the Windows Client.
HansKarlsen
 Posted 2013-02-20 00:39:42
Supreme Being

Supreme Being - (9 911 reputation)Supreme Being - (9 911 reputation)Supreme Being - (9 911 reputation)Supreme Being - (9 911 reputation)Supreme Being - (9 911 reputation)Supreme Being - (9 911 reputation)Supreme Being - (9 911 reputation)Supreme Being - (9 911 reputation)Supreme Being - (9 911 reputation)

Group: Administrators
Last Active: 2 days ago @ 00:47:56
Posts: 513, Visits: 2 932
I do not recongnise the out of memory exception - I get the wibe that you have recurssion? Like if your service somehow calls itself?

I agree that it seems strange that you get different behavoir on different types of machines - makes me think of patches and servicepacks?

WCF is very flexible - and as such there are a lot of mistakes to be done in the config. I have found that turning on logging and simplifying the bindings until they work gets the job done - then start to elaborate back with the settings you need, like security etc.
ryan_denn
 Posted 2013-02-20 10:24:56
Supreme Being

Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)

Group: Forum Members
Last Active: 2013-03-05 09:36:54
Posts: 58, Visits: 195
I don't understand how the service could be calling itself... It's just the PServerWindowsService that was built by the Eco template.
HansKarlsen
 Posted 2013-02-20 12:48:53
Supreme Being

Supreme Being - (9 911 reputation)Supreme Being - (9 911 reputation)Supreme Being - (9 911 reputation)Supreme Being - (9 911 reputation)Supreme Being - (9 911 reputation)Supreme Being - (9 911 reputation)Supreme Being - (9 911 reputation)Supreme Being - (9 911 reputation)Supreme Being - (9 911 reputation)

Group: Administrators
Last Active: 2 days ago @ 00:47:56
Posts: 513, Visits: 2 932
No - I do not see that either... But if you get out of mem it seems likely that the mem is eaten by recursion - where would it else go?
ryan_denn
 Posted 2013-02-20 14:42:12
Supreme Being

Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)Supreme Being - (1 459 reputation)

Group: Forum Members
Last Active: 2013-03-05 09:36:54
Posts: 58, Visits: 195
I am going to do some more digging and see exactly how much memory the persistence server is using

Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top