Open P47K0 opened 2 years ago
I don't use this healthcheck but what I can see from MS sources:
public void Close()
{
if (Logging.On)
Logging.Enter(Logging.Sockets, (object) this, nameof (Close), "");
this.Dispose();
if (!Logging.On)
return;
Logging.Exit(Logging.Sockets, (object) this, nameof (Close), "");
}
In general I see nothing to fix in tcp health check for now though I posted #1273 to use specific overloads.
Hi,
I experience a memory leak in one of my micro services. I already tried a lot to discover the origin. I recently commented out the TcpHealthCheck and it looks like the memory usage of my service is stable now.
Are you sure that the following line cleans up everything?
using (var tcpClient = new TcpClient(_options.AddressFamily))
In my code I also added a line to dispose the stream and I explicitly call close on the client. Here is a snippet of my code where I use and dispose a TcpClient:
Thanks in advance, Patrick