101

I have following setup, but when I put 1024 and replace all 512 with 1024, then eclipse won't start at all. How can I have more than 512M memory for my eclipse JVM?

-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
com.springsource.sts.ide
--launcher.XXMaxPermSize
512M
-vm
C:\Program Files (x86)\Java\jdk1.6.0_18\bin\javaw 
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms512m
-Xmx512m
-XX:MaxPermSize=512m
1
  • After trying one of the answers here, how to check how much is Eclipse taking? (e.g. you may have edited the wrong eclipse.ini file)
    – golimar
    May 4, 2021 at 15:41

7 Answers 7

123

I've had a lot of problems trying to get Eclipse to accept as much memory as I'd like it to be able to use (between 2 and 4 gigs for example).

Open eclipse.ini in the Eclipse installation directory. You should be able to change the memory sizes after -vmargs up to 1024 without a problem up to some maximum value that's dependent on your system. Here's that section on my Linux box:

-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=512m
-Xms512m
-Xmx1024m

And here's that section on my Windows box:

-vmargs
-Xms256m
-Xmx1024m

But, I've failed at setting it higher than 1024 megs. If anybody knows how to make that work, I'd love to know.

EDIT: 32bit version of juno seems to not accept more than Xmx1024m where the 64 bit version accept 2048.

EDIT: Nick's post contains some great links that explain two different things:

  • The problem is largely dependent on your system and the amount of contiguous free memory available, and
  • By using javaw.exe (on Windows), you may be able to get a larger allocated block of memory.

I have 8 gigs of Ram and can't set -Xmx to more than 1024 megs of ram, even when a minimal amount of programs are loaded and both windows/linux report between 4 and 5 gigs of free ram.

6
  • 6
    Where do you put in this info? Aug 20, 2013 at 1:47
  • 6
    @Imray, you'll need to add (or replace) these settings to your eclipse.ini file. The location depends on your platform. For Windows, it's located in the same folder as the Eclipse app. For OS X, you'll need to "Show Package Contents" on the Eclipse app, then edit Contents/MacOS/eclipse.ini in a text editor. Not sure about Linux... exercise left to the reader? :-)
    – sherb
    Aug 29, 2013 at 19:15
  • 6
    It's helpful to know the meaning of the options: all -X options after -vmargs are passed directly to the JVM, so run 'java -X' to get documentation. -Xms sets the initial heap, and -Xmx sets the maximum size the heap can grow to. PermSize is the area where class/method objects are stored, separate from the heap.
    – jfritz42
    Mar 14, 2014 at 18:59
  • Please note that -XX:MaxPermSize=512m doesn't need to be set for Java 8. See stackoverflow.com/questions/18339707/…. Aug 10, 2015 at 19:35
  • 1
    Here is where elcipse.ini may be located in Linux or Ubuntu stackoverflow.com/a/14898134/457687
    – Vlad
    Aug 15, 2016 at 19:38
38

Here is how i increased the memory allocation of eclipse Juno:

enter image description here

I have a total of 4GB on my system and when im working on eclipse, i dont run any other heavy softwares along side it. So I allocated 2Gb.

The thing i noticed is that the difference between min and max values should be of 512. The next value should be let say 2048 min + 512 = 2560max

Here is the heap value inside eclipse after setting -Xms2048m -Xmx2560m:

enter image description here

3
  • Note - don't forget the lowercase m (like I did). Otherwise works great!
    – Ben
    Aug 13, 2013 at 2:07
  • What is this theme for eclipse coloring ? Sep 25, 2013 at 7:57
  • 3
    I am using Carboon Color Theme, you can download it here: link
    – Ibn Saeed
    Sep 30, 2013 at 3:13
6

Care and feeding of Eclipse's memory hunger is a pain...

More or less, keep trying smaller amounts til it works, that's your max.

0
4

I don't think you need to change the MaxPermSize to 1024m. This works for me:

-startup
plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms256m
-Xmx1024m
-XX:PermSize=64m
-XX:MaxPermSize=128m
1
  • 8
    um ... could we all get some comments along with the downvotes, please? My answer may not be correct, but it'd help me to know why.
    – elduff
    Apr 9, 2010 at 20:09
4

You can copy this to your eclipse.ini file to have 1024M:

-clean -showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Xms512m
-Xmx1024m
-XX:PermSize=128m
-XX:MaxPermSize=256m 
2

Configuring this worked for me: -vmargs -Xms1536m -Xmx2048m -XX:MaxPermSize=1024m on Eclipse Java Photon June 2018

Running Windows 10, 8 GB ram and 64 bit. You can extend -Xmx2048 -XX:MaxpermSize= 1024m to 4096m too, if your computer has good ram.Mine worked well.

1

While working on an enterprise project in STS (heavily Eclipse based) I was crashing constantly and STS plateaued at around 1GB of RAM usage. I couldn't add new .war files to my local tomcat server and after deleting the tomcat folder to re-add it, found I couldn't re-add it either. Essentially almost anything that required a new popup besides the main menus was causing STS to freeze up.

I edited the STS.ini (your Eclipse.ini can be configured similarly) to:

--launcher.XXMaxPermSize 1024M -vmargs -Xms1536m -Xmx2048m -XX:MaxPermSize=1024m

Rebooted STS immediately and saw it plateau at about 1.5 gigs before finally not crashing

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.