Useful or not, from you.
playframework java.lang.OutOfMemoryError: Java heap space

we develop web app on play framework, -xmx4000m after the big amount of concurrency, app always OOM, what result in it!!!! i see there is 900+ thread, but 800+ is blocked. but i donot know how to resolve it. so what should i do to analyse this?

Play Version (2.6.x / etc)

API (Scala)

Operating System (Ubuntu 16)

JDK (OpenJDK 1.8.x)

2019-07-29 10:13:22,900 [ERROR] [or.default-dispatcher-50]  Uncaught error from thread [application-akka.actor.default-dispatcher-18]: Java heap space, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[application]
java.lang.OutOfMemoryError: Java heap space
2019-07-29 10:13:22,900 [ERROR] [or.default-dispatcher-50]  Uncaught error from thread [application-akka.actor.default-dispatcher-20]: Java heap space, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[application]
java.lang.OutOfMemoryError: Java heap space
2019-07-29 10:13:22,900 [ERROR] [or.default-dispatcher-50]  Uncaught error from thread [application-akka.actor.default-dispatcher-45]: Java heap space, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[application]
java.lang.OutOfMemoryError: Java heap space
	at java.util.Arrays.copyOfRange(Arrays.java:3664)
	at java.lang.String.<init>(String.java:207)
	at java.lang.StringBuilder.toString(StringBuilder.java:407)
	at akka.http.impl.engine.parsing.package$.build$1(package.scala:36)
	at akka.http.impl.engine.parsing.package$.asciiString(package.scala:37)
	at akka.http.impl.engine.parsing.HttpHeaderParser$.akka$http$impl$engine$parsing$HttpHeaderParser$$scanHeaderValue(HttpHeaderParser.scala:571)
	at akka.http.impl.engine.parsing.HttpHeaderParser$RawHeaderValueParser.apply(HttpHeaderParser.scala:546)
	at akka.http.impl.engine.parsing.HttpHeaderParser.parseAndInsertHeader$1(HttpHeaderParser.scala:174)
	at akka.http.impl.engine.parsing.HttpHeaderParser.parseHeaderValue(HttpHeaderParser.scala:188)
	at akka.http.impl.engine.parsing.HttpHeaderParser.parseHeaderLine(HttpHeaderParser.scala:131)
	at akka.http.impl.engine.parsing.HttpMessageParser.parseHeaderLines(HttpMessageParser.scala:135)
	at akka.http.impl.engine.parsing.HttpMessageParser.parseHeaderLines$(HttpMessageParser.scala:126)
	at akka.http.impl.engine.parsing.HttpRequestParser$$anon$1.parseHeaderLines(HttpRequestParser.scala:43)
	at akka.http.impl.engine.parsing.HttpRequestParser$$anon$1.parseMessage(HttpRequestParser.scala:77)
	at akka.http.impl.engine.parsing.HttpMessageParser.startNewMessage(HttpMessageParser.scala:110)
	at akka.http.impl.engine.parsing.HttpMessageParser.startNewMessage$(HttpMessageParser.scala:108)
	at akka.http.impl.engine.parsing.HttpRequestParser$$anon$1.startNewMessage(HttpRequestParser.scala:43)
	at akka.http.impl.engine.parsing.HttpRequestParser$$anon$1.$anonfun$parseMessage$1(HttpRequestParser.scala:85)
	at akka.http.impl.engine.parsing.HttpRequestParser$$anon$1.$anonfun$parseMessage$1$adapted(HttpRequestParser.scala:85)
	at akka.http.impl.engine.parsing.HttpRequestParser$$anon$1$$Lambda$1939/705078448.apply(Unknown Source)
	at akka.http.impl.engine.parsing.HttpMessageParser.$anonfun$continue$3(HttpMessageParser.scala:290)
	at akka.http.impl.engine.parsing.HttpMessageParser$$Lambda$1940/735588292.apply(Unknown Source)
	at akka.http.impl.engine.parsing.HttpMessageParser.run$1(HttpMessageParser.scala:68)
	at akka.http.impl.engine.parsing.HttpMessageParser.parseBytes(HttpMessageParser.scala:82)
	at akka.http.impl.engine.parsing.HttpMessageParser.parseBytes$(HttpMessageParser.scala:66)
	at akka.http.impl.engine.parsing.HttpRequestParser$$anon$1.parseBytes(HttpRequestParser.scala:43)
	at akka.http.impl.engine.parsing.HttpMessageParser.parseSessionBytes(HttpMessageParser.scala:64)
	at akka.http.impl.engine.parsing.HttpMessageParser.parseSessionBytes$(HttpMessageParser.scala:59)
	at akka.http.impl.engine.parsing.HttpRequestParser$$anon$1.parseSessionBytes(HttpRequestParser.scala:43)
	at akka.http.impl.engine.parsing.HttpRequestParser$$anon$1.onPush(HttpRequestParser.scala:54)
	at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:523)
	at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:409)
That's a useful answer
Without any help

Please add your Play version, sbt version, Java version, Windows or Linux, etc.? Thanks!