Advanced Setup

This page contains information to help you configure Eclipse and Scala IDE, to increase performances and ease-of-use.

Eclipse Configuration

The default Eclipse heap configuration is often inadequate for the Scala IDE. It is strongly recommended to edit the eclipse/eclipse.ini (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:

-XX:+UseConcMarkSweepGC

As is the following on Oracle 64-bits JVM:

-XX:+UseCompressedOops

Required Preferences

  • JDT Weaving

    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 Weaving section of Scala Setup Diagnostics dialog [2]. JDT Weaving should be checked (and disabled, to prevent accidental changes). If it is not the case, click to enable it.

    ../_images/advancedsetup-jdtweaving-01.png

Optional Preferences

  • Heap Status

    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 status in the General section [1].

    ../_images/advancedsetup-heapstatus-01.png

Performance

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, ...).