How to prevent java.lang.OutOfMemoryError: PermGen space at Scala compilation?

前端 未结 8 1733
感动是毒
感动是毒 2020-12-02 07:36

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]          


        
8条回答
  •  情深已故
    2020-12-02 08:07

    Originally using a command like:

    java -jar /path/to/sbt-launch.jar test
    

    I got first OutOfMemoryError: PermGen space which I solved using -XX:MaxPermSize, and then OutOfMemoryError: Java heap space, to which -Xmx was the remedy.

    So in my case, a command like this worked:

    java -XX:MaxPermSize=256M -Xmx2048M -jar /path/to/sbt-launch.jar test
    

提交回复
热议问题