scala.MatchError: java.lang.StackOverflowError (of class java.lang.StackOverflowError)

廉价感情. 提交于 2019-12-11 02:42:32

问题


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

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


回答1:


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.




回答2:


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")


来源:https://stackoverflow.com/questions/29250004/scala-matcherror-java-lang-stackoverflowerror-of-class-java-lang-stackoverflow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!