Invalid maximum heap size
Asked Answered
U

2

16

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.

Uredium answered 22/3, 2017 at 10:30 Comment(1)
Seriously? 1.5? Anyway, there is no dependency to the jdk’s actual location. This jdk is a 32 bit jdk, thus doesn’t support 5GB heaps and never did, not at this location and not at its old location.Indian
C
18

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

Continuation answered 23/3, 2017 at 6:37 Comment(0)
O
4

I just encountered the problem and solved it by downloading the windows 64-bit JAVA.

Please check whether your windows version is 32-bit or 64-bit, and download the right version of JAVA.

Oconnor answered 3/9, 2018 at 8:55 Comment(2)
I am using 64bit version of java and still getting this error, any reason you know?Nonunion
@NisargPatil, it's possible to execute Java with an argument containing -X options separated by spaces. Then Java will fail to parse this argument.Wilbert

© 2022 - 2024 — McMap. All rights reserved.