Solution preventing java.lang.OutOfMemoryError: PermGen space in scala
Today i was trying to build my fabricator library and faced with this nasty "java.lang.OutOfMemoryError: PermGen space"
error. Here i would like to write down a simple solution for unix users :
-
If you're a Mac user and have installed sbt via brew ( recommend you to do it), then all you need to do is :
- Create
~/.sbtconfig
file - Add
export SBT_OPTS="-XX:+CMSClassUnloadingEnabled -XX:PermSize=512M -XX:MaxPermSize=1024M"
to it. - Restart your sbt and it should work fine now
- Create
In case if you are linux user, you can simply add this export line into your ~/.bash_profile
file.