简体   繁体   中英

setting JVM heap size from sbt Console in IntelliJ

I get this error when running my app in intelliJ:

[error] (ABCThread-1) java.lang.OutOfMemoryError: Java heap space

Therefore, I am trying to set the heap size when i run my scala app from SBT Console / SBT Action:

I use the following : found here: Increase JVM heap size for Scala?

However i get the error:

scala>  -J-Xmx2g
<console>:12: error: object - is not a member of package scala
       scala -J-Xmx2g
             ^
<console>:12: error: not found: value J
       scala -J-Xmx2g
              ^
<console>:12: error: not found: value Xmx2g
       scala -J-Xmx2g
                ^

any idea? thnks

您应在其中输入VM参数

the position is where you should input the VM parameters if you use IDEA

1.Edit the VM Options field in the run/debug configuration of the app that you start. vmoptions file adjusts the memory used by IntelliJ, If I am not wrong, you are having a shortage of memory of JRE that is launched by IntelliJ to execute your app. Adjust the memory setting in VM options part of the Run/Debug configuration,for eg: https://imgur.com/2YjvDW9 config setting

2.If step-1 not solved your problem switch to 64-bit JDK for IntelliJ IDEA if you are not using currently.

Go to IntelliJ preferences > Build,Execution,Deployement > compiler . You'll find an option to set heap size as Build process heap size(Mbytes): . Change it to some higher value. It may solve the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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