I am trying to save some big data to a database through a WCF service call. I can not call the service. His mistake:
Unable to allocate a managed memory buffer of 268435456 bytes. Available memory may be low.
public async Task<int> UploadExportPackage(DTO.Upload.UploadPackage package)
{
int result = await serviceProxy.UploadResultsAsync(package);
return result;
}
Server side configuration:
<binding name="primaryBinding"
maxReceivedMessageSize="6000000"
maxBufferSize="6000000"
maxBufferPoolSize="12000000">
<readerQuotas maxArrayLength="6000000"
maxStringContentLength="6000000" />
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName" />
</security>
</binding>
</basicHttpsBinding>
</bindings>
Stack trace:
Exception no: 0
Next exception: Message:
Unable to allocate a managed memory buffer of 268435456 bytes. Available memory may be low.
:
: System.Runtime.Fx.AllocateByteArray( Int32) System.Runtime.InternalBufferManager.PooledBufferManager.TakeBuffer(Int32 bufferSize) System.ServiceModel.Channels.BufferManagerOutputStream.Init(Int32 initialSize, Int32 maxSizeQuota, Int32 effectiveMaxSize, BufferManager bufferManager) System.ServiceModel.Channels.BufferedMessageWriter.WriteMessage(Message message, BufferManager bufferManager, Int32 initialOffset, Int32 maxSizeQuota) System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.WriteMessage(Message message, Int32 maxMessageSize, BufferManager bufferManager, Int32 messageOffset) System.ServiceModel.Channels.HttpOutput.SerializeBufferedMessage( , Boolean shouldRecycleBuffer) System.ServiceModel.Channels.HttpOutput.SendAsyncResult.SendWithoutChannelBindingToken() System.ServiceModel.Channels.HttpOutput.SendAsyncResult.Send() System.ServiceModel.Channels.HttpOutput.SendAsyncResult..ctor(HttpOutput httpOutput, HttpResponseMessage httpResponseMessage, Boolean suppressEntityBody, - TimeSpan, AsyncCallback, ) System.ServiceModel.Channels.HttpOutput.BeginSendCore(HttpResponseMessage httpResponseMessage, - TimeSpan, AsyncCallback, ) System.ServiceModel.Channels.HttpChannelFactory 1.HttpRequestChannel.HttpChannelAsyncRequest.SendWebRequest()
at System.ServiceModel.Channels.HttpChannelFactory 1.HttpRequestChannel.HttpChannelAsyncRequest.BeginSendRequest( , - TimeSpan) System.ServiceModel.Channels.RequestChannel.BeginRequest( , - TimeSpan, AsyncCallback, ) System.ServiceModel.Channels.SecurityChannelFactory 1.RequestChannelSendAsyncResult.BeginSendCore(IRequestChannel channel, Message message, TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Security.ApplySecurityAndSendAsyncResult 1.OnSecureOutgoingMessageComplete( ) System.ServiceModel.Security.ApplySecurityAndSendAsyncResult 1.Begin(Message message, SecurityProtocolCorrelationState correlationState)
at System.ServiceModel.Channels.SecurityChannelFactory 1.SecurityRequestChannel.BeginRequest( , - TimeSpan, AsyncCallback, ) System.ServiceModel.Dispatcher.RequestChannelBinder.BeginRequest( , - TimeSpan, AsyncCallback, ) System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartSend(Boolean ) System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.FinishEnsureOpen( IAsyncResult, ) System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartEnsureOpen( ) System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.FinishEnsureInteractiveInit( IAsyncResult, ) System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartEnsureInteractiveInit() System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.Begin() System.ServiceModel.Channels.ServiceChannel.BeginCall(String action, Boolean oneway, ProxyOperationRuntime, Object [] ins, TimeSpan timeout, AsyncCallback, Object asyncState) System.ServiceModel.Channels.ServiceChannel.BeginCall( ServiceChannel, ProxyOperationRuntime, Object [] ins, AsyncCallback, asyncState) System.Threading.Tasks.TaskFactory 1.FromAsyncImpl[TArg1,TArg2,TArg3](Func 6 beginMethod, Func 2 endFunction, Action 1 endAction, TArg1 arg1, TArg2 arg2, TArg3 arg3, , TaskCreationOptionsOptions) System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.CreateGenericTask [T] ( ServiceChannel, ProxyOperationRuntime, Object [] inputParameters) System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.CreateGenericTask( ServiceChannel, ProxyOperationRuntime, Object [] inputParameters) System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.CreateTask( ServiceChannel, IMethodCallMessageCall, ProxyOperationRuntime) System.ServiceModel.Channels.ServiceChannelProxy.InvokeTaskService( IMethodCallMessageCall, ProxyOperationRuntime) System.ServiceModel.Channels.ServiceChannelProxy.Invoke( )
, [0]: System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData & msgData, Int32-) RossendaleClient8.DAL.RR.IRossendaleService.UploadResultsAsync( UploadPackage) RossendaleClient8.DAL.RR.RossendaleServiceClient.UploadResultsAsync( UploadPackage) RossendaleClient8.DAL.RossendaleServiceClient.d__13.MoveNext()
:
:
'System.OutOfMemoryException'.
: System.Runtime.Fx.AllocateByteArray( Int32)