This page contains information to help you configure Eclipse and Scala IDE, to increase performances and ease-of-use.
The default Eclipse heap configuration is often inadequate for the Scala IDE. It is strongly recommended to edit the
eclipse/Eclipse.app/Contents/MacOS/eclipse.ini on Mac osX) file and add the following lines to increase various heap limits and virtual machine options:
--launcher.XXMaxPermSize 256m -vmargs -Xms256m -Xmx1024m -XX:PermSize=64m -Xss1M -server -XX:+DoEscapeAnalysis
On recent Oracle JVM, the following might also be beneficial:
As is the following on Oracle 64-bits JVM:
Scala IDE uses AOP to tweak the Eclipse JDT, so JDT weaving has to be enable. Otherwise, Scala files would be managed as Java files.
It is set in the
JDT Weavingsection of Scala Setup Diagnostics dialog . JDT Weaving should be checked (and disabled, to prevent accidental changes). If it is not the case, click to enable it.
When the memory usage nears the limit, the Garbage Collector activity increases (when the compiler runs, ...) and system slows down. It is good to keep a eye on the heap status. It is possible by enabling
Show heap statusin the
Garbage Collection activity and swap can be really bad for performance. It can trigger Eclipse freezes and general system slow down.
Monitoring what is happening is the best option to keep a healthy system:
- to monitor CPU and swap, use your native system monitor (some of the other system monitors are big resource users themselves).
- to monitor Garbage Collector activity, use visualvm on the eclipse instance. It is a profiling tool provided with jdk 1.6.x. It is possible also to get a feel of the memory usage with the heap status bar Optional Preferences in Eclipse.
Depending of the problem, the memory allocated to the JVM can be increased, or some of the other application closed (like the web browser, or some flash application, ...).