增加Scala的JVM堆大小? [英] Increase JVM heap size for Scala?
问题描述
我有一个Scala数据处理工具,它失败了 java.lang.OutOfMemoryError
异常。该工具需要使一对夫妇通过一个大数据文件(我正在工作的一个超过700MB),所以如果整个东西都可以存储在内存是方便的。
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 (the one I'm working on is over 700MB), so it would be convenient if the entire thing could be stored in memory.
我使用scala转轮从命令行或从Bash脚本运行该工具。如何增加JVM堆大小?我试过传递 -Xmx1024m
,但它不能识别这个参数。我使用的是每晚构建的Scala 2.8.0(r18678)。
I run the tool from the command line or from a Bash script using the "scala" runner. How do I increase the JVM heap size for this? I've tried passing -Xmx1024m
, but it does not recognize this argument. I'm using a nightly build of Scala 2.8.0 (r18678).
推荐答案
JAVA_OPTS环境变量用于指定选项传递给java命令。有关详细信息,请参见 Scala手册页 。
The JAVA_OPTS environment variable is used to specify the options passed to the java command. See the Scala manpage for details.
这篇关于增加Scala的JVM堆大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!