akka / akka-http

The Streaming-first HTTP server/module of Akka
https://doc.akka.io/libraries/akka-http/current/
Other
1.34k stars 594 forks source link

ChildRestartStats consumes too much memory and leads to OutOfMemory at last. #2848

Closed jilen closed 4 years ago

jilen commented 4 years ago

Version: 10.1.10 Screenshot from 2019-12-03 10-46-13

After several days my server goes OutOfMemory. Note, that I am using akka-http as http client.

jrudolph commented 4 years ago

Can you upload a memory dump somewhere and send us a link?

jrudolph commented 4 years ago

Why do you think it is related to akka-http (and not just Akka)?

jilen commented 4 years ago

Because this appears after I replace AsyncHttpClient with akka-http-client. Through I am not 100% sure. But it seems caused by auto retries. I've send the dump link via gmail.

jrudolph commented 4 years ago

Thanks, I got the dump. To set expectations I'm now on vacation so it might be a while until I can look into it.

johanandren commented 4 years ago

Feels like it possibly could be related to akka/akka#27948

jrudolph commented 4 years ago

@jilen, seems like you are creating lots of ActorMaterializer without shutting them down after use. The best practice is to only create one instance of ActorMaterializer and pass that around. Once you upgrade to Akka 2.6.x, this won't be a concern any more because you don't have to create a materializer yourself any more and can just pass in the actorsystem instead.

jilen commented 4 years ago

@jrudolph Exactly! Thanks for your help.