1

I am using eclipse in windows 7. When I set the -Xmx argument larger than 1500m, the following error occurs:

Error occurred during initialization of VM
Could not reserve enough space for object heap

Both eclipse and jdk are 64 bit version. The physical memory of my machine is 4g. Here is eclipse.ini file:

-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms400m
-Xmx3840m

I thought under 64 bit java I could use more than 1.5g memory, but eclipse keeps throw the above error. Any ideas?

cheng

cheng
  • 2,106
  • 6
  • 28
  • 36
  • 4
    Physical memory of your machine is 4G and you are trying to set max VM memory to 3840m ? Which is approximately equal to 4G ! – Rakesh May 10 '12 at 06:59

1 Answers1

2

If your machine has 4G of RAM it does not mean that all of it is available to for the usage. The available RAM will always be less than 4 GB as the native OS and other applications running your machine will use some of the RAM. Quick way to find out the available RAM is

  1. Open Notepad (you mentioned you are on windows 7.)
  2. Click on Help -> About
  3. It shows the physical memory available at the bottom.

There are no straight forward rules for choosing the heap size. It always involves tuning. An optimum value is arrived after some iterations. Check this post on the same forum.

Community
  • 1
  • 1
Santosh
  • 17,667
  • 4
  • 54
  • 79