We have a service that makes outgoing http requests using
Http().singleRequest(request)
We are experiencing memory leak with constantly increasing heap usage, retained, and a heap dump shows more than 14 million instances of akka.http.impl.engine.client.pool.NewHostConnectionPool$HostConnectionPoolStage$$anon$1$Slot
There are also 14,000+ instances of
akka.http.scaladsl.HttpsConnectionContext
indicating that somehow the connections are not freed.
Our service has probably made only a few hundred thousands http requests total, at most, and all to the same host.
Any advice how to avoid the memory leak? (or connection leak)
Akka config:
akka {
http {
host-connection-pool {
max-connections = 1024
max-open-requests = 2048
idle-timeout = 600 s
}
client {
idle-timeout = 8 s
connecting-timeout = 8s
}
}
}
We are using Scala 2.12, Akka 2.6.4, Akka Http 10.1.12
Previously we were on Akka 2.5.16, Akka Http 10.1.5, and we didn’t have this issue.