Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Out of memory in PlayFramework 2.0

How do I increase the memory available to the Play environment? I am running out of memory after a time while running tests.

In particular, I get this error:

java.lang.OutOfMemoryError: PermGen space

like image 747
John Kelvie Avatar asked Feb 01 '13 21:02

John Kelvie


2 Answers

By setting the environment variable "_JAVA_OPTIONS", you can pass in variables that play/sbt will use during normal use. I found that this helped me avoid PermGen space errors when running my dev and tests.

For example:

export _JAVA_OPTIONS="-Xms64m -Xmx1024m -Xss2m -XX:MaxPermSize=256m"

like image 118
Adam Lane Avatar answered Oct 27 '22 12:10

Adam Lane


I solved this problem by adding:

javaOptions ++= Seq("-Xmx2048M", "-Xms512M", "-XX:MaxPermSize=2048M")

in Build.scala to the settings.

like image 35
mhei Avatar answered Oct 27 '22 14:10

mhei