scala.MatchError: java.lang.StackOverflowError (of

2019-07-20 15:41发布

I had a project that was developed using play scala 2.0 and it was working fine and i had a need to upgrade the version to 2.3.8 . So i migrated my application version by following this link https://www.playframework.com/documentation/2.3.x/Migration23 and i am able to run the code in newer version in my machine where i have 8 GB RAM and jdk 1.7.0_25 but when i run the code from some other machines with 4 GB RAM it throws the following error enter image description here

Even it is breaking in some systems with 8 GB and jdk 1.8 i am getting confused whether the issue is due to jdk or memory or an issue in play 2.3.8 Can somebody help me in getting this issue resolved

Attached link to my complete stacktrace

Thanks in advance

2条回答
祖国的老花朵
2楼-- · 2019-07-20 15:44

Encountered the same problem after searching for long on this issue. Try starting your application with this command

"activator clean -Xms1g -Xmx2g run"

if it doesn't work try increasing 1g and 2g to 2g and 3g resp.

Edit: If, you want to avoid specifying parameters every time you run the application. you can add this into build.sbt file as follows:

javaOptions ++= Seq(-Xms1G, "-Xmx2G")
查看更多
女痞
3楼-- · 2019-07-20 15:50

Since it's a stackoverflow exception, bumping up the stack size did the trick for me:

export SBT_OPTS=-Xss4m

You can try adjusting the number to see what works. I'm still not clear on the root cause as it repros on both Java 7 and Java 8, and have seen the error pop up at compile time as well.

查看更多
登录 后发表回答