3

The issue is that running from cmd is not very good for debugging . I need to debug the code , so is there any way i could increase heap and debug in eclipse .

I tried increasing heap in control panel - > java -> view - > 6g

but still get the java out of memory in eclipse

3
  • 3
    Hint: there's a file called eclipse.ini in your installation directory.
    – devnull
    Commented Feb 24, 2014 at 17:53
  • The eclipse.ini settings change the heap space for Eclipse itself, the Run Configurations settings change the heap for programs you run from within Eclipse.
    – greg-449
    Commented Feb 24, 2014 at 19:02
  • @greg-449 you can do that at eclipse level - stackoverflow.com/questions/21995185/…
    – Jags
    Commented Mar 27, 2020 at 4:32

3 Answers 3

4
  1. Click the arrow next to the run button, and select Run Configurations...
  2. Select your application from the left list
  3. Go to Arguments
  4. In VM arguments add -Xmx6g -Xms2g
  5. Click Apply.

This will increase the heap size for that launch configuration to 6G.

2

Try changing in the eclipse.ini file. Here is an example configuration

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20120913-144807
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms512m
-Xmx1024m
-XX:+UseParallelGC
-XX:PermSize=256M
-XX:MaxPermSize=512M
1

You can change default jvm args which will apply to all Run/Debug configurations and you don't have to change individual configuration.

In eclipse go to Window -> Preference -> Java -> Installed JREs -> Edit default JRE. There add -XX:MaxPermSize=512m under Default VM arguments

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.