Increase JVM heap size for Scala?

前端 未结 5 1100
醉酒成梦
醉酒成梦 2020-11-27 12:37

I have a Scala data processing tool which is failing with a java.lang.OutOfMemoryError exception. The tool needs to make a couple passes over a large data file

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-27 13:14

    Based on Joe's suggestion, I looked at the scala program, which is a Bash script that calls java with various Scala specific arguments. It allows extra command line arguments to be passed to Java through the JAVA_OPTS environment variable. So you can increase the heap size like this:

    JAVA_OPTS="-Xmx2g" scala classname arguments...
    

提交回复
热议问题