tags:

views:

1184

answers:

4

The memory usage of Eclipse 3.4 is through the roof to the point where it's becoming an issue.

I have a simple BlackBerry project loaded and the usage skyrockets to nearly 400 MB, sometimes higher. Is there something that can be done to bring it down?

+6  A: 

While you probably could tinker with the configuration, removing various plugins etc, it's likely to be more cost effective to buy more memory. How much do you currently have? I would consider a developer machine with less than 2GB of memory to be under spec, and I suspect many people would double that...

Jon Skeet
Couldn't agree more. 1GB of RAM is as little as $20-30. How much is your time worth? Getting a collection of plugins to work in Eclipse is hard work enough without fidding with it (arguably) unnecessarily.
cletus
I am maxed out at 2GB (it's an old laptop). The problem is that once the BlackBerry simulator is loaded, Visual Studio (web services) and Chrome (to look stuff up on the web), the laptop comes to a crawl. But Eclipse is by far the biggest offender. It was not so bad with the 3.3 or the 3.2 versions.
AngryHacker
If Eclipse is the biggest offender at 400MB and you've got 2GB, you shouldn't be running *that* short on memory. Is it definitely memory that's the problem here? Are you swapping?
Jon Skeet
Basically, the moment Commit Charge total comes within 200-300 MB of the Total Physical Memory, the laptop starts swapping. Noticed a question about peeps complaining of the same this: http://stackoverflow.com/questions/100161/is-eclipse-3-4-ganymede-memory-usage-significantly-higher-than-3-2
AngryHacker
The moment I kill Eclipse, the laptop comes back to its senses. Could be the BlackBerry plugin (which is basically the whole reason I am using Eclipse to begin with).
AngryHacker
Hmm... in that case it may be worth looking at removing other plugins such as Mylyn...
Jon Skeet
Throw hardware at a software problem... spoken like a true programmer :)
Jurily
@Jurily: It's a simple matter of efficiency. If you *can* put more memory in, it's usually a much better use of resources than trimming a few meg here and a few meg there.
Jon Skeet
Completely disagree. Developer machines should be *lower* spec than the intended end-user's machine by at least 50% (CPU and RAM) for exactly this reason.
finnw
@finnw: What makes you think that the workload of a developer machine is anything like the workload of the user's machine? Many applications don't need anything like as much in the way of resources as an IDE. You should certainly *test* your application on a low-spec machine, but that doesn't mean *developing* it on one. In fact, you're already apparently assuming a client-side app. If I'm developing a web app which is targeting mobile devices, should I develop on a mobile phone too?
Jon Skeet
+2  A: 

Modern versions of Eclipse do need quite a bit of RAM to do their thing. But should still run pretty fast on any modern machine.

Assuming you have enough physical memory (2GB is fine unless you have lots of other processes running, or you're using RAD), see this IBM article on Eclipse's memory usage for some tips on tweaking the settings. The two most common culprits are Xmx and/or MaxPermSize being set too low (Xmx defaults to 256M and MaxPermSize defaults to 64M).

You modify the values by passing command line arguments or tweaking the eclipse.ini in the Eclipse install location.

You should end up with something like this:

...
-vmargs
-Xms128m
-Xmx1024m 
-XX:MaxPermSize=128m
Rich Seller
+8  A: 

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'.

Of course, the tips offered to use larger heap sizes and better garbage collectors would do you good as well.

Vineet Reynolds
That did the trick.
AngryHacker
Good to know it worked.
Vineet Reynolds
A: 

If 400 Mb of RAM is a big issue for you, you might want to try another IDE. Eclipse stores a lot of state information, some or most of which you don't actually need. That's a design choice.

Right now, I have the same project open in both Eclipse and QtCreator: after a clean rebuild, Eclipse uses 156 Mb RAM, Qt Creator is happy with 66 Mb.

Jurily