Tutorials  /  Linux Basics

Optimizing Eclipse with eclipse.ini VM Arguments

Ccentron Redaktion · November 2024 ·3 min read ·Linux Basics, Tutorial

The eclipse.ini file is a key configuration file for controlling the startup settings of Eclipse. By adjusting this file, you can specify important VM arguments, such as which JDK Eclipse should use, as well as set memory options like permgen space, and define heap sizes through parameters like Xms and Xmx.

Locating the eclipse.ini File

The location of the eclipse.ini file varies depending on your operating system:

  • Windows: The file is typically found in the same directory as the eclipse.exe file.
  • Mac OS X: The file is located within the app package. Navigate to it by right-clicking on the Eclipse app, selecting “Show Package Contents,” and then opening the path Contents/Eclipse.

Here's a basic example of an eclipse.ini file layout:

Code
-startup
../Eclipse/plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.300.v20150602-1417
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.7
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=256m
-Xms256m
-Xmx1024m
-Xdock:icon=../Resources/Eclipse.icns
VM

Matching infrastructure at centron

No hardware needed to follow along: ccloud³ VMs with full root access start at €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

Important Notes on eclipse.ini Configuration

  1. Lines above -vmargs represent startup options for Eclipse, while anything below it is passed as JVM arguments.
  2. Make sure to place all VM-related settings (like the JDK path) above -vmargs, as anything after -vmargs is processed solely as JVM arguments.
  3. The --launcher.XXMaxPermSize parameter sets the maximum permgen space for the Eclipse launcher. Increasing this can help if Eclipse is struggling with memory during startup.

Setting the JVM with eclipse.ini VM Arguments

If you have multiple JDK versions installed, you can specify the one you want Eclipse to use by defining the -vm argument before -vmargs. Here’s how to set JDK 8 on Mac OS X, for example:

Code
-vm
/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin
-vmargs

On other operating systems, you would simply adjust the path to match the location of the JDK's bin directory.

Managing Permgen Space

If you encounter an OutOfMemoryError related to PermGen space, particularly when working on large projects or using Maven, you might need to increase permgen space. This can be done by adding -XX:MaxPermSize=512M in the eclipse.ini file.

Note: Starting from Java 8, there is no more PermGen space, so this setting is obsolete with JDK 8 and beyond.

Configuring Heap Space

To increase the maximum heap space available to Eclipse, you can edit the -Xmx parameter. For instance, to allocate 2 GB of heap memory, set the following:

Code
-Xmx2048m

This adjustment can resolve OutOfMemoryError issues caused by insufficient heap space, especially useful for resource-intensive projects.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Linux Basics
Teilen
Noch offene Fragen?

Our team will help you with your specific setup - in German or English, by people who run the platform themselves.

War dieses Tutorial hilfreich?

Your answer is stored anonymously and helps us improve our tutorials.

Kommentare

No comments yet - be the first to ask a question about this tutorial.

Sign in to comment

Comments are open to centron customers. Sign in to your account to ask a question about this tutorial.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren