Forum Discussion

flixenblomqvist's avatar
flixenblomqvist
Copper Contributor
Sep 17, 2025

TCP'connections not closed when using MSappproxy

Hi,

 

We are currently having issues with TCP connections just keep filling up on the server side, that will eventually result in out of memory so that we will have to do a hard shutdown. 

 

We are seeing this in the error logs: Object was GCed but not disposed. 

 

Any suggestions? 

1 Reply

  • hi flixenblomqvist​ Here are things you might check or try:

    a.Make sure the Application Proxy Connector is on the latest version, as older versions might have bugs in resource cleanup.

    b.Enable detailed logging on the connector host. Check for which types of objects are getting GC’d but not disposed  e.g., TcpClient, HttpClient, Stream objects. That helps identify where leaks are.

    c.Inspect your backend / application logic: ensure all network/socket/stream objects are disposed properly. Use using(...) or .Dispose() in all paths, including exception handling.

    d.Review connector configuration for idle timeouts or maximum connection limits. Ensure idle TCP connections are closed automatically after reasonable idle periods.

    e.Monitor with tools (e.g. netstat, Performance Monitor, or process utilities) to see counts of ESTABLISHED, CLOSE_WAIT,TIME_WAIT connections. If CLOSE_WAIT is high, it’s often due to the local side not closing sockets.

    f.As a workaround, plan a scheduled recycle of the connector service or host, if cleanup isn’t fast enough under load, while you identify root cause.

    g.If after investigating, still encountering high connection buildup, collect connector/system,.NET-level diagnostics and raise with Microsoft support — there may be a patch or configuration you are missing.

Resources