-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak in HikariCP connection pool #913
Comments
Just in case - the message I'm getting along with OOM:
|
It seems the problem was in http4s I'm leaving the issue open as I don't know whether the issue is in http4s (unlikely as |
I think this PR into cats-effect might have fixed it: typelevel/cats-effect#568. Will try to reproduce with both versions. |
@chuwy any updates on that? |
Was about to make an issue but I also have a leak, not sure if its entirely related though https://github.com/mdedetrich/task-doobie-memory-leak |
@darek1024, sorry for delay - not yet. My problem went away once I removed |
@mdedetrich based on this (monix/monix#912) Task also doesn't yet use |
The leak happens even when you don't use |
Which implementation do you use? I assume that only IO from cats-effect-2.0.0 and ZIO don't suffer from it. |
In the repository which I linked to, I just used |
Closing this as it's probably not an issue anymore. Please reopen if that's not true |
I'm testing my RESTful service built on top of http4s and doobie and encountering cryptic (as always) OOM.
It suspect it happens with any load, but below results are were produced with stress-testing via apache benchmark (
ab -n 1000000 -c 800
from the same host).Memory dump, couple of minutes after launch:
The
connectionEC
is the only object in memory that looks slightly (yet) suspicious. Working queue has 778 elements.I dump memory every 5 minutes and see more or less the same picture.
connectionEC
is always on the first line, but never significantly above 3M. Until ~1hr later I get the OOM and heap produced with-XX:+HeapDumpOnOutOfMemoryError
shows following picture:Basically it filled my heap with... something
doobie
ish inside somethingIO
ish (sorry, not very faimiliar with cats-effect internals).I think this particular setup was poorly configured: small 1CPU/2GB machine, 16 threads in connection pool, 5
maximumPoolSize
(which looks too big), fairly heavy load and heavy DB response (~400Kb over the network), but other benchmarks have shown similar results.I'm running this doobie 0.7.0 (same problem was with 0.6.0), http4s-blaze 0.20.1 NIO1. Here's the pool initialization code: https://github.com/snowplow-incubator/iglu-server/blob/release/0.6.0/src/main/scala/com/snowplowanalytics/iglu/server/storage/Storage.scala#L95-L116 (in case I miss somethiing very obvious).
This looks suspciciously similar to #824 / http4s/http4s-okhttp-client#3, except that I'm not using http4s client.
The text was updated successfully, but these errors were encountered: