WCF Web服务崩溃..需要知道内存转储的原因

时间:2012-11-29 13:34:06

标签: wcf

我们最近在我们的生产环境中遇到了一个WCF Web服务崩溃的问题。我们在崩溃期间进行了内存转储,当我们使用windbg调试时,我们得到了以下堆栈跟踪

  

* *异常对象:000000000a1e5db8异常类型:System.ObjectDisposedException消息:无法访问   处置对象。 InnerException:enter code here   * * StackTrace(生成):          System_ServiceModel_ni!System.ServiceModel.Channels.CommunicationObject.ThrowIfClosed()+ 0xfb2737   System_ServiceModel_ni!System.ServiceModel.Channels.ServiceChannel.CleanupChannelCollections()+ 0×37   System_ServiceModel_ni!System.ServiceModel.Channels.ServiceChannel.OnAbort()+ 0x78   System_ServiceModel_ni!System.ServiceModel.Channels.CommunicationObject.Abort()+ 0x28e   System_ServiceModel_ni!System.ServiceModel.Channels.ServiceChannel + SessionIdleManager.TimerCallback()+ 0x6c   System_Runtime_DurableInstancing_ni!System.Runtime.IOThreadScheduler + ScheduledOverlapped.IOCallback(UInt32的,   UInt32,System.Threading.NativeOverlapped *)+ 0x71   System_Runtime_DurableInstancing_ni!System.Runtime.Fx + IOCompletionThunk.UnhandledExceptionFrame(UInt32的,   UInt32,System.Threading.NativeOverlapped *)+ 0xdbc70   mscorlib_ni!System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32的,   UInt32,System.Threading.NativeOverlapped *)+ 0x96 * * StackTraceString:    HResult:80131622 StackTraceString:HResult:   80131622 **

有人可以在发生这种情况时更深入地了解此异常。

WCF Web服务使用.net framework 4.0在Windows 2008服务器上运行。

其他细节:

ConcurrencyMode = Multiple
InstanceContextMode = PerSession

我们的网络服务会调用其他几个wcf服务。绑定&这些行为信息如下。

 <behavior name="NAME">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceThrottling maxConcurrentSessions="1000" maxConcurrentCalls="1000" maxConcurrentInstances="10`enter code here`00"/>
      <dataContractSerializer maxItemsInObjectGraph="655360"/>
    </behavior>    
        <binding name="NAME" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="50" maxBufferPoolSize="524288" maxBufferSize="10485760" maxConnections="150" maxReceivedMessageSize="10485760">
            <readerQuotas maxDepth="32" maxStringContentLength="10485760" maxArrayLength="10485760" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
            <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
            <security mode="None">
                <transport clientCredentialType="Windows" protectionLevel="None" />
            </security>
        </binding>

1 个答案:

答案 0 :(得分:0)

这种情况正在发生,因为您的服务代码以某种方式创建了一个条件,即再次访问已处置的WCF ServiceChannel实例。目前尚不清楚这是否发生在您的服务用于调用另一个WCF服务的WCF服务代理中,或者该服务用于响应客户端请求的通道。要正确处理代理实例,请查看"by design" behavior of the Dispose method上的这篇好文章。

您应该详细介绍服务配置,例如InstanceContextModeConcurrencyMode设置以及serviceModel配置,以获得更好的答案。