Skip to content

TcpClient/Socket objects disposed but still exist in memory #263

@sungam3r

Description

@sungam3r

Memory dump of our running app shows something like this:

11

Both TcpClient and Socket objects have already been disposed, but still in memory referenced by TcpClientAdapter. TcpClientAdapter has private TcpClient / Socket field (depends of rabbitmq-dotnet-client version) which closed (disposed) in TcpClientAdapter.Close() method. We can consider this situation as memory leak with non-growing memory overhead.

12

It's annoying to have those broken and unused objects (with all inner object trees, e.g. byte arrays or ManualResetEvents) in memory and in profiler reports. These objects prevent from investigation real memory leaks.

Please, consider to break reference to TcpClient / Socket in TcpClientAdapter after Close() call.
Maybe, it's better to break reference a bit higher in call stack, e.g. SocketFrameHandler class.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions