简体   繁体   English

如何在 Intellij IDEA 中高速运行 scala 项目?

[英]How to run a scala project at high speed in Intellij IDEA?

How to run a scala project at high speed in Intellij IDEA?如何在 Intellij IDEA 中高速运行 scala 项目? I wrote a scala project that uses Figaro libraries, but when I run it in Intellij IDEA, the execution speed is slow and gives a "OutOfMemoryError: Java heap space" error.我写了一个使用 Figaro 库的 scala 项目,但是当我在 Intellij IDEA 中运行它时,执行速度很慢,并给出“OutOfMemoryError: Java heap space”错误。 I want to know how this problem can be solved?我想知道如何解决这个问题?

You should probably look into how are you allocating memory.您可能应该查看如何分配 memory。 If you have too many references to objects (specially larger ones) you wil run into this problem.如果您对对象的引用过多(特别是较大的对象),您将遇到此问题。

As a quick fix you can add -Xmx to the run configuration arguments to set the heap size to the max possible given the OS.作为快速修复,您可以将-Xmx添加到运行配置 arguments 以将堆大小设置为给定操作系统可能的最大值。 In windows I believe it's 2GB while the java default is much smaller.在 windows 我相信它是 2GB 而 java 默认值要小得多。

Anyways if you don't follow the first advice, you will run into this problem again.无论如何,如果您不遵循第一个建议,您将再次遇到此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM