To have a better experience with Scala-IDE, this page try to collect information to help you configure eclipse, and avoid some Troubleshooting
The default Eclipse heap configuration is often inadequate for the Scala IDE. It is strongly recommended that you edit your eclipse/eclipse.ini
to add the following lines increasing various heap limits and VM options:
--launcher.XXMaxPermSize
256m
-vmargs
-Xms256m
-Xmx1024m
-XX:PermSize=64m
-Xss1M
-server
-XX:+DoEscapeAnalysis
The configuration above specifies a 1Gb maximum heap size. If the machine you are running the Scala IDE on has sufficient physical memory (eg. > 3GB) then specifying -Xmx2048m for a 2Gb heap might be beneficial.
If you are using a recent Oracle JVM you might also find it beneficial to add,
-XX:+UseConcMarkSweepGC
and if you are using the Oracle 64 bit JVM you should also add,
-XX:+UseCompressedOops
The ScalaIDE use AOP to tweak JDT, so you need to enable JDT weaving, else scala files are managed as java file. So check if it enabled (else Click to ENABLE
)
Window > Preferences > JDT Weaving
|| JDT Weaving is currently ENABLED
Display heap status, when eclipse is near the limit, GC activity increase (when scalac runs,...) and the system slow down
Window > Preferences > General || [x] Show heap status
Limit the number of open editors
Window > Preferences > General > Editors || [x] Close editors automatically || Number of opened editors before closing: 12
Lot of content assistant require information provide by compiler (Types,...), as Scala-IDE is build over JDT, java content assistant are enabled for scala files. Disable auto-activation (on typing instead of explicit calls) can reduce number of freeze,...
Window > Preferences > Java > Editor > Content Assist || [ ] Enable auto-activation
But you should have completion (enable Word Proposals if you don't want to know several shortcuts)
Window > Preferences > Java > Editor > Content Assist > Advanced || [X] Java Proposals || [X] Template Proposals || [X] Word Proposals
GC activity and swap are killer : freeze eclipse,... full system.
So monitor and tweak when possible (may be, close your browser, flash apps,...).
jvisualvm
(a profiling tool provide with jdk 1.6.0) to your eclipse instance (see wip_tuning for some screenshot of GC activity that freeze eclipse). Or smell itvia heap memory usage, you can
show heap status
(see above if there is enough free memory, then gc will not consume CPU ).