Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Help changing OSX Eclipse Java Heap allocation

I need to increase the heap allocation but I think I am missing a step, I follow this instructions http://wiki.eclipse.org/Eclipse.ini but the ini file is different from mine, this is what I get

-startup
../../../plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx_1.1.2.R36x_v20101019_1345
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
-vmargs
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx1536m
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=256m

I change line -Xmx1536m but still get the out of memory problem, any ideas what else I need to setup? I have the latest 64bit Eclipse IDE and running on OSX 10.6.7

Thanks

like image 463
Ricardo Sanchez Avatar asked Apr 14 '11 09:04

Ricardo Sanchez


2 Answers

In your comments you clarified that you're trying to increase the memory for an application you're running in Eclipse. What you've been trying increases the memory for Eclipse itself. To increase the memory for an application you're running in Eclipse to 1536m follow these steps:

  1. Go to Run > Run Configurations...
  2. Select your Java Application
  3. Go to the Arguments tab
  4. Add -Xmx1536m to the your VM arguments
like image 139
WhiteFang34 Avatar answered Sep 22 '22 17:09

WhiteFang34


It is possible to increase heap size allocated by the JVM in eclipse directly In eclipse IDE goto

Run---->Run Configurations---->

Enter

-Xmx1g

(It is used to set the max size like Xmx256m or Xmx1g...... m-->mb g--->gb)

like image 33
Karthik Reddy Avatar answered Sep 23 '22 17:09

Karthik Reddy