JDK-8149088 : Differences in the availability of memory between JRE and JDK.
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 8u71
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_8
  • CPU: x86
  • Submitted: 2016-01-31
  • Updated: 2016-06-17
  • Resolved: 2016-04-20
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
JRE 1.8.0.71 (but we weal with it half a year, so how old is current version, maybe it was in previous versions too); JDK several 1.8 and 1.7 versions.

ADDITIONAL OS VERSION INFORMATION :
Not OS specific, tested on multiple OS including Windows 7 64bit, Windows 8 64bit...

EXTRA RELEVANT SYSTEM CONFIGURATION :
Tested on several machines (at least 8) including several laptops and several PCs.

A DESCRIPTION OF THE PROBLEM :
If installed JRE only, it assign only 300MB; and it does not allow to assign (-Xmx) more than 1.2GB - much less than the size of RAM is (8GB on 64bit OS).
If installed JDK, memory management behaves correctly, it assign 25% of RAM; and it can be assigned (-Xmx parameter) whole RAM [even 15x more than the RAM size is].

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run "java -Xmx3G -jar [any .jar file]" on machine with JRE only

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Automatically assign 25% of RAM and allow to assign whole RAM
ACTUAL -
Automatically assigned 300MB (25% of 1.2GB) and allowed to assign 1.2GB

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Stadard errors if too much memory assigned like:
Error occurred during initialization of VM
Unable to allocate ---KB card tables for parallel garbage collection for the requested ---KB heap. /*** OR ***/ Unable to allocate ---KB bitmaps for parallel garbage collection for the requested ---KB heap.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.



REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
java -Xmx6G -jar [any .jar file]
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Uninstall JRE and subsequently install JDK


Comments
This issue is duplicate of JDK-8153578
20-04-2016

When you are using JVM in 32-bit mode, the maximum heap size that can be allocated is ~1.2G in Windows. So, if you want to go beyond that, you need to invoke JVM in 64-mode. ---Run "java -d64 -Xms3G -jar [any .jar file]"
10-02-2016