-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Milestone
Description
Experienced on Akka.Net 1.3.2. On Windows 10 64-bit
Steps to recreate:
- Open Tcp connections
- Close all Tcp connections (stop all Tcp connection actors)
Even though all actual Sockets are being closed and disposed, some SocketAsyncEventArgs instances are not being disposed. They contain reference to IActorRef so the ActorCell instance is also not getting GC'ed.
I debugged through source code and found out that when opening connection, TcpOutgoingConnection acquires 3 SocketAsyncEventArgs instances from PreallocatedSocketEventAgrsPool, however when connection closes, only 2 instances are getting released.
Also if an InvalidOperationException exception occurs during release, the SocketAsyncEventArgs instance will probably never get neither back to the pool nor get disposed because the connection actor is already stopped.