Reputation: 1179
Unable to set java heap space using -Xmx
to 2GB
or more even though the RAM
size is 16GB
.
I encounter an error saying "
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit"
This is seen while starting a Jenkins server on my Win2008 x64 machine.
Please let me know if I could change any system parameter which will allow me to allocate more memory.
Thanks
Upvotes: 2
Views: 2542
Reputation: 1179
Found the fix with the help of clue given above by Neil.
Here is the full details:
Even though the machine is installed with JDK 1.7 x64 bit, Jenkins by default is not configured with this version available on the machine.
Jenkins has its own JRE bundled with the installer which is used by default.
To change it to a different JDK edit the Jenkins.xml file and modify the below value
<executable>jre\bin\java</executable>
to
<executable><jdk install path>\bin\java</executable>
This is now solved!!
Upvotes: 3
Reputation: 9
theoretical limit for maximum heap size on 32 bit JVM is 4GB and for 64 bit JVM its 2^64
For more detail Click here
Upvotes: 0
Reputation: 31
Use "java -version" to ensure that your java hotspot is a 64-bit server vm.
Upvotes: 0
Reputation: 1133
Run
java -version
and check you see
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
I expect you have a 32 bit version of java which is limited to 2 GB (as its not large address aware)
Upvotes: 3