Andrei Vasilev
Andrei Vasilev

Reputation: 607

How to increase heap space and debug in Eclipse

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

Upvotes: 3

Views: 4781

Answers (3)

Jags
Jags

Reputation: 837

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

Upvotes: 1

PurkkaKoodari
PurkkaKoodari

Reputation: 6809

  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.

Upvotes: 4

cafebabe1991
cafebabe1991

Reputation: 5176

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

Upvotes: 2

Related Questions