Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid maximum heap size

I have copied a jdk directory from another location. Since then, I get the following error message.

Your environment has been set.
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
Java HotSpot(TM) Client VM (build 1.5.0_22-b03, mixed mode, sharing)
PROPS=-Xms1024m -Xmx5096m -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djava.ext.dirs=..;.;..\lib;..\classes -Dfile.encoding=UTF-8
CLASSPATH=C:\Oracle\MIDDLE~1\patch_wls1211\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\PROGRA~1\Java\JDK15~1.0_2\lib\tools.jar;C:\Oracle\MIDDLE~1\WLSERV~1.1\server\lib\weblogic_sp.jar;C:\Oracle\MIDDLE~1\WLSERV~1.1\server\lib\weblogic.jar;C:\Oracle\MIDDLE~1\modules\features\weblogic.server.modules_12.1.1.0.jar;C:\Oracle\MIDDLE~1\WLSERV~1.1\server\lib\webservices.jar;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.1/lib/ant-all.jar;C:\Oracle\MIDDLE~1\modules\NETSFA~1.0_1/lib/ant-contrib.jar;
Invalid maximum heap size: -Xmx5096m
The specified size exceeds the maximum representable size.
Could not create the Java virtual machine.

Does this mean I will have to re-install the jdk, and not just copy any installation directory? I'm asking this and not trying it out myself because this exercise will have to be done in a client machine.

The current machine is a Windows 2008 server and has 12GB of RAM.

like image 881
AlwaysALearner Avatar asked Mar 22 '17 10:03

AlwaysALearner


People also ask

What is my maximum heap size?

The default maximum Java heap size is 256 MB.

What is the maximum heap size for 64 bit JVM?

For 64 bit platforms and Java stacks in general, the recommended Maximum Heap range for WebSphere Application Server, would be between (4096M - 8192M) or (4G - 8G).

How do you fix a heap error?

OutOfMemoryError: Java heap space. 1) An easy way to solve OutOfMemoryError in java is to increase the maximum heap size by using JVM options "-Xmx512M", this will immediately solve your OutOfMemoryError.


1 Answers

You are using 32 bit VM (Java HotSpot(TM) Client VM) which can be mapped to maximum 4G (Only 2 GB in reality) 2^32 address locations Maximum Java heap size of a 32-bit JVM on a 64-bit OS

Error message suggest you are using 5GB heap memory which is not supported on 32 bit architecture

Invalid maximum heap size: -Xmx5096m The specified size exceeds the maximum representable size.

Could not create the Java virtual machine.

You can modify the -Xmx parameter to use anythinng <=2g should work here

like image 108
Fairoz Avatar answered Oct 06 '22 02:10

Fairoz