function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AnirudhdaAnirudhda 

Unable to create project

Hi,

       I am trying to create a Force.com project in Eclipse Helios but I am getting an error as Unable to create project. Reason: OutOfMemoryError: Java heap space. 

 

My eclipse.ini settings are:

 

-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.2.R36x_v20101019_1345
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms512m
-Xmx1024m

 

 

gautam_singhgautam_singh

Hi,

 

 



Problem :-

You are probably allocating a lot of objects in a long (possibly infinite) loop, or you have a memory leak somewhere (e.g. storing object references in a list and forgetting to null them out when you're done with them).

The error is thrown when the garbage collector is unable to free up enough space to allow allocation to the requested object. So basically when a new object is to be created and there is not enough space in the heap, the jvm will invoke the garbage collector. If after the gc completion, there is still not enough space freed up, then the jvm throws an OutOfMemoryError: java heap. Heap space is occupied by instance variables only.

Also , The org that you are working on may have several, large managed packages installed. If you want to increase your heap space, you can use java -Xms<initial heap size> -Xmx<maximum heap size> on the command line. By default, the values are 32m and 128m.

Solution :-

All you need to do is to add the parameter “-Xmx1024m” to the “$ANT_OPTS” environment variable in your Ant shell script or batch file. (This parameter raises the maximum memory limit for your Java virtual machine to 1GB, instead of 128MB or whatever paltry amount the default is.) Try to give eclipse some more JVM memory.

 To expand Eclipse's memory allowance:

- Open the eclipse.ini file in the main Eclipse folder
- Increase the -Xmx property to 1200m (this is 1.2 Gigs of RAM).
- Note:  additional memory allowance up to 2 GB and beyond may require the 64-bit edition of Eclipse and JVM.

This may give you an TimeOut Message but You can click continue.Check This Blog for more details .


Important :

Click on the Star Icon aside if this post provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.

Thank You

carlos.wainbergcarlos.wainberg

This solution worked for me.

 

It just takes a some time to load if the project is large, so be patient people.