WCFサービスコールを使用して大きなデータをデータベースに保存しようとしています。私はサービスを呼び出すことができません。 ITSは、エラーをスロー:268435456バイトのマネージメモリバッファの割り当てに失敗しました。利用可能なメモリの量が少なくなる可能性があります。
は268435456バイトのマネージメモリバッファの割り当てに失敗しました。
<!--
Place limits on the amount of data that can be received in one go.
This helps to protect the server from attack and abuse.
-->
<binding name="primaryBinding"
maxReceivedMessageSize="6000000"
maxBufferSize="6000000"
maxBufferPoolSize="12000000">
<readerQuotas maxArrayLength="6000000"
maxStringContentLength="6000000" />
<!--
Set the security mode. Apply at:
- Transport layer
- Message layer
-->
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName" />
</security>
</binding>
</basicHttpsBinding>
</bindings>
スタックトレース:
Exception no: 0
次の例外: メッセージ:
使用可能なメモリの量が低いpublic async Task<int> UploadExportPackage(DTO.Upload.UploadPackage package)
{
int result = await serviceProxy.UploadResultsAsync(package);
return result;
}
サーバー側の設定も可能
268435456バイトの管理メモリバッファの割り当てに失敗しました。使用可能なメモリの量が少なくなる可能性があります。
スタックトレース: サーバースタックトレース: 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で (メッセージメッセージ、BUFFERMANAGER BUFFERMANAGER、のInt32 initialOffset、のInt32 maxSizeQuota)System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoderで 。 WriteMessage(メッセージメッセージ、Int32 maxMessageSize、BufferManagerバッファマネージャ、Int32 messageOffset)System.ServiceModel.Channels.HttpOutput.SendAsyncResult.Send() でSystem.ServiceModel.Channels.HttpOutput.SendAsyncResult.SendWithoutChannelBindingToken() でSystem.ServiceModel.Channels.HttpOutput.SerializeBufferedMessage(メッセージメッセージ、ブールshouldRecycleBuffer) ででSystem.ServiceModel.Channels.HttpOutput.BeginSendCore(HttpResponseMessage httpResponseMessage、のTimeSpanタイムアウト、AsyncCallbackでSystem.ServiceModel.Channels.HttpOutput.SendAsyncResult..ctor(httpOutput httpOutput、HttpResponseMessage httpResponseMessage、ブールsuppressEntityBody、のTimeSpanタイムアウト、AsyncCallbackコールバック、オブジェクト状態) System.ServiceModel.Channels.HttpChannelFactory 1.HttpRequestChannel.HttpChannelAsyncRequest.SendWebRequest() at System.ServiceModel.Channels.HttpChannelFactory
1.HttpRequestChannel.HttpChannelAsyncRequest.BeginSendRequest(メッセージのメッセージ、のTimeSpanタイムアウト)でコールバック、オブジェクト状態) System.ServiceModel.Security.ApplySecurityAndSendAsyncResultで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.Channels.RequestChannel.BeginRequestで(メッセージのメッセージ、のTimeSpanタイムアウト、AsyncCallbackコールバック、状態オブジェクト) 1.Begin(Message message, SecurityProtocolCorrelationState correlationState) at System.ServiceModel.Channels.SecurityChannelFactory
1.SecurityRequestChannel.BeginRequest(メッセージのメッセージ、のTimeSpanタイムアウト、AsyncCallbackコールバック、オブジェクト状態) System.ServiceModel.ChannelsでSystem.ServiceModel.Dispatcher.RequestChannelBinder.BeginRequest(メッセージのメッセージ、のTimeSpanタイムアウト、AsyncCallbackコールバックオブジェクト状態) でSystem.ServiceModel.Channels.ServiceChannel.SendAsyncResult.FinishEnsureOpen(IAsyncResultインター結果、ブーで.ServiceChannel.SendAsyncResult.StartSend(ブールcompletedSynchronously) System.ServiceModel.Channels.ServiceChannelでSystem.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartEnsureOpen(ブールcompletedSynchronously) でcompletedSynchronously) を傾きます。System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.BeginでSystem.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartEnsureInteractiveInitでSendAsyncResult.FinishEnsureInteractiveInit(IAsyncResultインター結果、ブールcompletedSynchronously) () ()System.ServiceModel.Channels.ServiceChannelで 。 System.ServiceModel.Channels.ServiceChannel.BeginCall(ServiceChannelチャネル、ProxyOperationRuntimeオペレーション、Object [] ins、AsyncCallbackコールバック)で、BeginCall(Stringアクション、Boolean oneway、ProxyOperationRuntimeオペレーション、Object [] ins、TimeSpanタイムアウト、AsyncCallbackコールバック、Object asyncState) 、Object asyncState) at System.Threading.Tasks.TaskFactory 1.FromAsyncImpl[TArg1,TArg2,TArg3](Func
6 beginMethod、Func 2 endFunction, Action
1 endAction、TArg1 arg1、TArg2 arg2、TArg3 arg3、オブジェクト状態、TaskCreationOptions creationOptions) System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.CreateGenericTask(ServiceChannelチャネル、ProxyOperationRuntime動作、オブジェクト[におけるSystem.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.CreateGenericTaskで [T](ServiceChannelチャネル、ProxyOperationRuntime動作は、[]のInputParametersオブジェクト) ]のInputParameters)System.ServiceModelでSystem.ServiceModel.Channels.ServiceChannelProxy.InvokeTaskServiceでSystem.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.CreateTask(ServiceChannelチャネル、IMethodCallMessage methodCallで、ProxyOperationRuntime動作) (IMethodCallMessage methodCallで、ProxyOperationRuntime動作) で。 Channels.ServiceChannelProxy.Invoke(IMessageメッセージ)
例外r RossendaleClient8でSystem.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessageがreqMsg、IMessageがretMsg)で System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(のMessageData & msgData、のInt32型)で :[0]でethrown RossendaleClient8.DAL.RossendaleServiceClient.d__13.MoveNextでRossendaleClient8.DAL.RR.RossendaleServiceClient.UploadResultsAsyncで.DAL.RR.IRossendaleService.UploadResultsAsync(UploadPackageパッケージ) (UploadPackageパッケージ) ()
次に例外: メッセージ:
タイプ 'System.OutOfMemoryException'の例外スローされる。
スタックトレース:System.Runtime.Fx.AllocateByteArray(のInt32サイズ)
データを小さなチャンクに分割し、複数の送信をサービスに行う必要があります。 – Kevin
@ケビンは、全体の多くを送信する方法はありません?それは約200mbです。 – user1800674
サーバにメモリを追加することがあります。しかし、これは本当に問題を解決するとは思わない。ちょうどそれが起こるまでどれくらいの時間をプッシュします。 – Kevin