Scala debugging under IntelliJ is terribly slow

I am currently browsing a relatively small Scala program (Apache Kafka) with IntelliJ 10.5.4 and simultaneously running several other Java applications in another project. While Java applications work fine, Scala debugging is very slow, a simple “Make Project” takes only 2 minutes, and even basic cursor keystrokes take up to a second to think on the screen.

I used IntelliJ before, while working simultaneously with 6 applications in several projects, and it generally has no problems. Hardware is also not a problem, it all works on a very recent Macbook Pro (256 GB SSD, 8 GB RAM, quad-core i7), in Java 1.6.0_31.

Are there any tips / tricks for making Scala decent work when debugging in IntelliJ? Alternatively, what do people out there use for debugging Scala?

+3
source share
4 answers

TL; DR

re: compilation time, is FSC enabled ? This greatly facilitates the time.

re: general slowness, you probably need to tweak the JVM settings . Scala may be more memory intensive, so you may need to increase the value -Xmxto spend less time collecting garbage. Or lower it if it is too high. Or change the garbage collector. For reference, here are mine:

<key>VMOptions</key>
<string>-ea -Xverify:none -Xbootclasspath/a:../lib/boot.jar -XX:+UseConcMarkSweepGC </string>
<key>VMOptions.i386</key>
<string>-Xms128m -Xmx512m -XX:MaxPermSize=250m -XX:ReservedCodeCacheSize=64m</string>
<key>VMOptions.x86_64</key>
<string>-Xms128m -Xmx800m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=64m -XX:+UseCompressedOops</string>

Actually figuring it out

, , , , . , Activity Monitor, , , . , , , . SSD, -, , .

IDEA, YourKit Java Profiler. - , , IDEA .

, , Scala , Java IntelliJ. , -Xmx, . , , , , , . , , , , -Xmx .

+2

, List. intellij scala, , intellij .

, Ctrl + shift + F8.

+1

Eclipse from http://scala-ide.org/download/current.html has worked very well for me since version 2.0.1.

My stuff is currently based on maven, and projects are merging Java and Scala. I can easily debug language boundaries.

0
source

All Articles