I have noticed a strange behavior of my scala compiler. It occasionally throws an OutOfMemoryError when compiling a class. Here's the error message:
[info] Compiling 1 Scala source to /Users/gruetter/Workspaces/scala/helloscala/target/scala-2.9.0/test-classes... java.lang.OutOfMemoryError: PermGen space Error during sbt execution: java.lang.OutOfMemoryError: PermGen space
It only happens once in a while and the error is usually not thrown on the subsequent compile run. I use Scala 2.9.0 and compile via SBT.
Does anybody have a clue as to what might be the cause for this error? Thanks in advance for your insights.
To fix it, increase the PermGen memory settings by using the following Java VM options. -XX:PermSize<size> - Set initial PermGen Size. -XX:MaxPermSize<size> - Set the maximum PermGen Size. In the next step, we will show you how to set the VM options in Tomcat, under Windows and Linux environment.
lang. OutOfMemoryError: PermGen Space is a runtime error in Java which occurs when the permanent generation (PermGen) area in memory is exhausted. The PermGen area of the Java heap is used to store metadata such as class declarations, methods and object arrays.
OutOfMemoryError: Java heap space. 1) An easy way to solve OutOfMemoryError in java is to increase the maximum heap size by using JVM options "-Xmx512M", this will immediately solve your OutOfMemoryError.
Open eclipse. ini file, it is located in root eclipse directory. there you can change -Xms and -Xmx parameter to change permgen size. There you can change -XX:PermSize and -XX:MaxPermSize.
I use HomeBrew to install sbt on OS X. It supports a SBT_OPTS
argument which can be put in ~/.sbtconfig
file with export SBT_OPTS=-XX:MaxPermSize=256M
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With