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
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...
You can pass options to the JVM via -J. E.g.,
scala -J-Xmx2g ...
As a hack you can edit the scala/bin/scala
file to edit the parameters for the java
command. Not pretty.
The JAVA_OPTS environment variable is used to specify the options passed to the java command. See the Scala manpage for details.
Edit JAVA_OPTS
.