System.InsufficientMemoryException: Insufficient winsock resources available to complete when working with WCF
Some times when calling API's or web services we will get memory leakage exceptions in .Net like blow
EXCEPTION: System.InsufficientMemoryException: Insufficient winsock resources available to complete socket connection initiation. ---> System.Net.Sockets.SocketException: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full 10.7.162.159:808
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
So, it seems some where in the api's or web service or wcf program logic, network related objects used and those are not disposed hence causing the above mentioned exception.
What exactly happening when you use network streams open is, your computer might have limited connections and you are creating and not disposing then after reaching max connections in memory then future request can't make hit and throws memory exception.
if we can properly dispose the objects after utilization then we didn't get the above issues.
EXCEPTION: System.InsufficientMemoryException: Insufficient winsock resources available to complete socket connection initiation. ---> System.Net.Sockets.SocketException: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full 10.7.162.159:808
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
So, it seems some where in the api's or web service or wcf program logic, network related objects used and those are not disposed hence causing the above mentioned exception.
What exactly happening when you use network streams open is, your computer might have limited connections and you are creating and not disposing then after reaching max connections in memory then future request can't make hit and throws memory exception.
if we can properly dispose the objects after utilization then we didn't get the above issues.
Comments
Post a Comment