88

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?

3
  • 7
    Looking back on this question now, I'd have to say that I'd be delighted if I could get my eclipse memory usage down to 400MB. Right now I'm struggling to get it down to 1GB (plus another 300MB if you include a copy of Tomcat for actually running my projects...). Commented Sep 7, 2017 at 14:12
  • 7
    I am writing this comment from the future (2018) and Eclipse is taking 10 GB on my current project. Commented Mar 23, 2018 at 14:36
  • 2
    I just got back from year 2030 and Eclipse is taking up 5 terabytes before loading a project. Commented Sep 11, 2020 at 17:16

10 Answers 10

94

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.

Sign up to request clarification or add additional context in comments.

7 Comments

Didn't work for me. Still at 900-930MB. I mean wtf could it be doing.
Great answer. 1 plug-in down, about 50 others that I've never heard of/never use to go. (Note to self, start using IntelliJ)
2016 and still facing this issue. I mean 1GB of my Ram space is occupied by eclipse. Turning off the spell checker plugin din't help either.
2017 and my Eclipse is now using 1.7GB of RAM with almost no additional plugins. There has to be an end to this madness.
This was very usefull advice thank you. I've been working on large LATEX / R documents, with lots of text and unchecking Enable spelling has reduced heap size a lot !
|
25

Checking General -> Show heap status will enable this

Eclipse heap status bar

in the bottom bar. This way you can manually run the garbage collector whenever you want by clicking on the trash can. It's not a fix, more like a workaround, but it helped reduce massively my RAM / CPU usage.

2 Comments

This helped me identify that the allocated 4GB of RAM to eclipse, was not in fact being used, even though the OS showed that 4GB was in use. I reduced the amount of RAM allocated to eclipse to help free up RAM for other applications.
As Sping Tool Suit derived from eclipse So this also work with STS
13

Remove +UseG1GC option from eclipse.ini. I've read from here that It is only used for araound 6GB heap memory.

4 Comments

Yes, this worked for me. I replaced -XX:+useG1GC with -XX:+UseSerialGC and the memory issue disappeared. Sounds like a bug in G1GC.
Switching to -XX:+UseSerialGC cut out > 300mb. thumbs up
this is the best answer, i guess. work for me and eclipse feels smoother than before. Just make sure to make backup from original eclipse.ini file. thumbs up
From 700+MB to 380MB by changing this. Thanks
11

In Eclipse Luna 4.4.1 Was trying to cut my memory usage in Eclipse. I managed to shave mine from 600mb to 300mb. I did the following:

  • Turned off the plugins activated on startup that I wasn't using. Windows > Preferences > General > Startup and Shutdown

  • Closed projects I wasn't working on at the time.

Found the hints/tips here : http://blog.elijaa.org/2010/09/20/tricks-to-speed-up-eclipse-php-helios-pdt-2-2/

Comments

9

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

1 Comment

MaxPermSize is no longer there
8

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

16 Comments

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.
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.
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: 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?
@Nate: That was the direct question, but very often on Stack Overflow it's more useful to look at the problem than the question. If someone's concatenating values in SQL and forgetting some quotes, the direct answer to the question would be to add in the quotes, but the solution to the problem is parameterized SQL. If the OP is concerned about 400MB, then it seems to me that a general lack of memory for a developer machine is the wider problem.
|
7

My Eclipse is taking over 800MB resident, and 2GB virtual (part of it swapped out perhaps). Java can be a hog, it's giving Java bad press all the time.

However, there is a little something that many people don't know: the incremental garbage collector. -Xincgc The side effect is that it hands memory back to the system from time to time. By default Java just takes and takes, and when it doesn't need memory anymore, it keeps it for itself. The incgc is a different strategy where it becomes more reasonable to assume that memory can be handed back the system without running into trouble. This can however affect performance.

There are many garbage collection settings. You can also have multiple threads handle GC. The parallel GC does that. Not sure if that one hands memory back, don't think so.

3 Comments

And how to change the garbage collector option for Eclipse?
Things have changed. The default GC in Java 8 now, is a generational garbage collector that also hands back memory to the system. You no longer want to mock with it...
In my case java 8 is happy to keep over 3GB when actual usage is less than 0.5GB, so unfortunately I do need to mock with it.
3

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.

Comments

2

You can try the 64bit version of Eclipse with the 64bit version of JDK on Windows 7. Those both caused some odd issues with the 3rd party Framework I have to work with. The 32-bit of JRockit (free now) from Oracle seems to be faster and be a little better on memory. This is my Eclipse.ini settings:

This is my eclipse inn

-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222
-nosplash
org.eclipse.platform
--launcher.XXPermSize
512m
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
-vm
C:/Program Files (x86)/Java/jrockit-jdk1.6.0_31-R28.2.3-4.1.0/jre/bin
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xquickstart
-XX:+AggressiveHeap
-XX:+AggressiveOpts
-XX:+UseParallelOldGC
-XX:ParallelGCThreads=2
-XX:ThreadPriorityPolicy=1
-Xverify:none
-Xms1100m
-Xmx1100m

I switched to the 32 bit JRockit JDK which seems a little faster for Eclipse. I turn off and don't install more than I need. For each separate type of app development (Android, J2EE, just Spring, ...) I have different Eclipse installations. Hard drive space is cheap. Then I can have just the plugins I need for each one. I would never want all the Android tools loading if I wasn't using them. STS is also good for just the Spring stuff and I have one just for OpenShift Cloud work.

2 Comments

I'm a bit confused, as you first have --launcher.XXMaxPermSize 512m and then --launcher.XXMaxPermSize 256m (and a couple of duplicate lines, i.e. defaultAction, and then nosplash together with showsplash ). Does it use the first configuration found ?
it shouldn't have the 2nd one in there. i checked again and don't have that in my current one. Also if you are using JDK 8 different parameters
1

Try disabling your eclipse plugins. Eclipse was hogging half of my of my memory when I had the saros plugin open.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.