Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I reduce Eclipse Ganymede's memory use?

I use the recent Ganymede release of Eclipse, specifically the distro for Java EE and web developers. I have installed a few additional plugins (e.g. Subclipse, Spring, FindBugs) and removed all the Mylyn plugins.

I don't do anything particularly heavy-duty within Eclipse such as starting an app server or connecting to databases, yet for some reason, after several hours use I see that Eclipse is using close to 500MB of memory.

Does anybody know why Eclipse uses so much memory (leaky?), and more importantly, if there's anything I can do to improve this?

like image 758
Dónal Avatar asked Sep 18 '08 16:09

Dónal


People also ask

How do I make Eclipse use less memory?

Eclipse 3.4 can consume a lot more memory than the previous versions, courtesy the spellchecker plug-in. You can switch off the plug-in by going to Window -> Preferences -> General -> Editors -> Text Editors -> Spelling, and unchecking the box title 'Enable spell checking'.


1 Answers

I don't know about Eclipse specifically, I use IntelliJ which also suffers from memory growth (whether you're actively using it or not!). Anyway, in IntelliJ, I couldn't eliminate the problem, but I did slow down the memory growth by playing with the runtime VM options. You could try resetting these in Eclipse and see if they make a difference.

You can edit the VM options in the eclipse.ini file in your eclipse folder.

I found that (in IntelliJ) the garbage collector settings had the most effect on how fast the memory grows.

My settings are:

-Xms128m -Xmx512m -XX:MaxPermSize=120m -XX:MaxGCPauseMillis=10 -XX:MaxHeapFreeRatio=70 -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing 

(See http://piotrga.wordpress.com/2006/12/12/intellij-and-garbage-collection/ for an explanation of the individual settings). As you can see, I'm more concerned with avoiding long pauses during editting than actuial memory usage but you could use this as a start.

like image 129
GKelly Avatar answered Oct 02 '22 15:10

GKelly