We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Running the following example, with "-Xmx512m" will cause a java.lang.OutOfMemoryError: Java heap space within a minute:
java.lang.OutOfMemoryError: Java heap space
import akka.actor.ActorSystem import akka.stream.ActorMaterializer import akka.stream.scaladsl.{Sink, Source} import com.crobox.clickhouse.ClickhouseClient import com.typesafe.config.ConfigFactory import scala.concurrent.Future import scala.concurrent.duration._ object MemoryLeakApp extends App { implicit val system = ActorSystem("memory") implicit val materializer = ActorMaterializer() import system.dispatcher val size = 1024 * 1024 val clickhouseClient = new ClickhouseClient(ConfigFactory.parseString( """ |crobox.clickhouse.client { | connection { | type = "single-host", | host = "localhost", | port = 8123 | } |} """.stripMargin).withFallback(ConfigFactory.defaultReference())) def execute(): Unit = { val source = Source.fromFutureSource(Future { s"SELECT * FROM system.numbers LIMIT $size" }.map(query => clickhouseClient.queryWithProgress(query) )).mapMaterializedValue(_.flatten) Sink.ignore.runWith(source).foreach(response => println("Received response with", response.length) ) } system.scheduler.schedule(0.seconds, 1.seconds)({execute()}) }
Somehow using the Source.fromFutureSource with .mapMaterializedValue(_.flatten) causes the issue to appear...
Source.fromFutureSource
.mapMaterializedValue(_.flatten)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Running the following example, with "-Xmx512m" will cause a
java.lang.OutOfMemoryError: Java heap space
within a minute:Somehow using the
Source.fromFutureSource
with.mapMaterializedValue(_.flatten)
causes the issue to appear...The text was updated successfully, but these errors were encountered: