Java maximum heap size too small on OpenJDK8 on x86


Topic author
iblowmymind
Contributor
Posts: 17
Joined: Sun Apr 09, 2023 1:54 pm
Reputation: 0
Status: Offline

Java maximum heap size too small on OpenJDK8 on x86

Post by iblowmymind » Tue Sep 12, 2023 3:17 pm

Hello,
Just tried installing the first release for OpenJDK8 for x86 on my V9.2-1 VM.
I have I18N, the recently released ECO update for V9.2-1 and OpenJDK8 installed successfully on the VM. I have 8 GB's allocated.
However, running java -XshowSettings:all reports:

Code: Select all

VM settings:
    Max. Heap Size (Estimated): 135.50M
Which is a far cry from the 8 GB's I've allocated! Trying to run a Minecraft server (1.16.5 is the latest that will support Java 8) will result in it crashing because it runs out-of-memory:

Code: Select all

$ java -Xmx512M -jar server.jar
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 32505856 bytes for PSYoungGen::resize_generation
# Can not save log file, dump to screen..
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 32505856 bytes for PSYoungGen::resize_generation
# Possible reasons:
#   The system is out of physical RAM or swap space
#   The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
#  %SYSTEM-S-NORMAL (0xe0000001) at pc=0x0000000000000000, pid=1093, tid=0x0000000000feb280
#
# JRE version: OpenJDK Runtime Environment (8.0_372-b07) (build 1.8.0_372-b07)
# Java VM: OpenJDK 64-Bit Server VM (25.372-b07 mixed mode OpenVMS-amd64 compressed oops)
#
#

---------------  T H R E A D  ---------------

Current thread (0x0000000083804000):  VMThread [stack: 0x0000000000ee6000,0x0000000000fe9f00] [id=16691840]

Stack: [0x0000000000ee6000,0x0000000000fe9f00]
VM_Operation (0x0000000000a05638): CollectForMetadataAllocation, mode: safepoint, requested by thread 0x0000000082245000


---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x0000000083a0c000 JavaThread "Service Thread" daemon [_thread_blocked, id=26735232, stack(0x00000000018da000,0x000000000197df00)]
  0x0000000083869800 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=26047104, stack(0x00000000016d2000,0x00000000018d5f00)]
  0x0000000083866000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=23917184, stack(0x00000000014ca000,0x00000000016cdf00)]
  0x0000000083862800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=21787264, stack(0x00000000012c2000,0x00000000014c5f00)]
  0x000000008385f800 JavaThread "Attach Listener" daemon [_thread_blocked, id=19518080, stack(0x00000000011f8000,0x000000000129bf00)]
  0x000000008385d800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=18821760, stack(0x000000000114e000,0x00000000011f1f00)]
  0x000000008381b000 JavaThread "Finalizer" daemon [_thread_blocked, id=18068096, stack(0x0000000001096000,0x0000000001139f00)]
  0x000000008380f800 JavaThread "Reference Handler" daemon [_thread_blocked, id=17379968, stack(0x0000000000fee000,0x0000000001091f00)]
  0x0000000082245000 JavaThread "main" [_thread_blocked, id=10539648, stack(0x0000000000968000,0x0000000000a0bf00)]

Other Threads:
=>0x0000000083804000 VMThread [stack: 0x0000000000ee6000,0x0000000000fe9f00] [id=16691840]
  0x0000000083a0f800 WatcherThread [stack: 0x0000000001982000,0x0000000001a85f00] [id=27816576]

VM state:at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread:  ([mutex/lock_event])
[0x0000000082243b20] Threads_lock - owner thread: 0x0000000083804000
[0x0000000082244160] Heap_lock - owner thread: 0x0000000082245000

heap address: 0x00007fffd0800000, size: 512 MB, Compressed Oops mode: Non-zero based:0x00007fffd07fe000, Oop shift amount: 3
Narrow klass base: 0x00007fff8f03e000, Narrow klass shift: 0
Compressed class space size: 1073741824 Address: 0x00007fff8f03e000

Heap:
 PSYoungGen      total 36864K, used 3019K [0x00007fffe5d80000, 0x00007fffe8680000, 0x00007ffff0800000)
  eden space 31744K, 0% used [0x00007fffe5d80000,0x00007fffe5d80000,0x00007fffe7c80000)
  from space 5120K, 58% used [0x00007fffe8180000,0x00007fffe8472e30,0x00007fffe8680000)
  to   space 5120K, 0% used [0x00007fffe7c80000,0x00007fffe7c80000,0x00007fffe8180000)
 ParOldGen       total 84992K, used 838K [0x00007fffd0800000, 0x00007fffd5b00000, 0x00007fffe5d80000)
  object space 84992K, 0% used [0x00007fffd0800000,0x00007fffd08d1bb0,0x00007fffd5b00000)
 Metaspace       used 12935K, capacity 13114K, committed 13184K, reserved 1064960K
  class space    used 1556K, capacity 1656K, committed 1664K, reserved 1048576K

Card table byte_map: [0x00007fffd01f4000,0x00007fffd02f6000] byte_map_base: 0x00007fbfd0370000

Marking Bits: (ParMarkBitMap*) 0x0000000000376308
 Begin Bits: [0x00007fffcf148000, 0x00007fffcf948000)
 End Bits:   [0x00007fffcf948000, 0x00007fffd0148000)

Polling page: 0x000000008223e000

CodeCache: size=245760Kb used=3203Kb max_used=3203Kb free=242557Kb
 bounds [0x00007ffff0eb6000, 0x00007ffff11e6000, 0x00007fffffeb6000]
 total_blobs=1212 nmethods=826 adapters=301
 compilation: enabled

Compilation events (10 events):
Event: 9.740 Thread 0x0000000083869800 nmethod 832 0x00007ffff11d47d0 code [0x00007ffff11d4940, 0x00007ffff11d4ad8]
Event: 9.740 Thread 0x0000000083869800  833       1       java.lang.invoke.MethodHandles$Lookup::lookupClass (5 bytes)
Event: 9.740 Thread 0x0000000083869800 nmethod 833 0x00007ffff11d4b50 code [0x00007ffff11d4ca0, 0x00007ffff11d4dd8]
Event: 9.740 Thread 0x0000000083869800  834       3       java.lang.Integer::stringSize (51 bytes)
Event: 9.740 Thread 0x0000000083869800 nmethod 834 0x00007ffff11d4e50 code [0x00007ffff11d4fc0, 0x00007ffff11d5278]
Event: 9.740 Thread 0x0000000083869800  835       3       java.lang.Integer::getChars (137 bytes)
Event: 9.750 Thread 0x0000000083869800 nmethod 835 0x00007ffff11d5350 code [0x00007ffff11d54e0, 0x00007ffff11d5938]
Event: 9.780 Thread 0x0000000083869800  837       3       jdk.internal.org.objectweb.asm.MethodWriter::visitVarInsn (292 bytes)
Event: 9.790 Thread 0x0000000083869800 nmethod 837 0x00007ffff11d6b90 code [0x00007ffff11d6dc0, 0x00007ffff11d7890]
Event: 9.790 Thread 0x0000000083869800  840       3       jdk.internal.org.objectweb.asm.Item::<init> (5 bytes)

GC Heap History (3 events):
Event: 9.520 GC heap before
{Heap before GC invocations=1 (full 0):
 PSYoungGen      total 36864K, used 31744K [0x00007fffe5d80000, 0x00007fffe8680000, 0x00007ffff0800000)
  eden space 31744K, 100% used [0x00007fffe5d80000,0x00007fffe7c80000,0x00007fffe7c80000)
  from space 5120K, 0% used [0x00007fffe8180000,0x00007fffe8180000,0x00007fffe8680000)
  to   space 5120K, 0% used [0x00007fffe7c80000,0x00007fffe7c80000,0x00007fffe8180000)
 ParOldGen       total 84992K, used 0K [0x00007fffd0800000, 0x00007fffd5b00000, 0x00007fffe5d80000)
  object space 84992K, 0% used [0x00007fffd0800000,0x00007fffd0800000,0x00007fffd5b00000)
 Metaspace       used 12560K, capacity 12742K, committed 12928K, reserved 1060864K
  class space    used 1505K, capacity 1570K, committed 1664K, reserved 1048576K
Event: 9.560 GC heap after
Heap after GC invocations=1 (full 0):
 PSYoungGen      total 36864K, used 5088K [0x00007fffe5d80000, 0x00007fffe8680000, 0x00007ffff0800000)
  eden space 31744K, 0% used [0x00007fffe5d80000,0x00007fffe5d80000,0x00007fffe7c80000)
  from space 5120K, 99% used [0x00007fffe7c80000,0x00007fffe8178258,0x00007fffe8180000)
  to   space 5120K, 0% used [0x00007fffe8180000,0x00007fffe8180000,0x00007fffe8680000)
 ParOldGen       total 84992K, used 830K [0x00007fffd0800000, 0x00007fffd5b00000, 0x00007fffe5d80000)
  object space 84992K, 0% used [0x00007fffd0800000,0x00007fffd08cfbb0,0x00007fffd5b00000)
 Metaspace       used 12560K, capacity 12742K, committed 12928K, reserved 1060864K
  class space    used 1505K, capacity 1570K, committed 1664K, reserved 1048576K
}
Event: 9.790 GC heap before
{Heap before GC invocations=2 (full 0):
 PSYoungGen      total 36864K, used 7945K [0x00007fffe5d80000, 0x00007fffe8680000, 0x00007ffff0800000)
  eden space 31744K, 8% used [0x00007fffe5d80000,0x00007fffe604a398,0x00007fffe7c80000)
  from space 5120K, 99% used [0x00007fffe7c80000,0x00007fffe8178258,0x00007fffe8180000)
  to   space 5120K, 0% used [0x00007fffe8180000,0x00007fffe8180000,0x00007fffe8680000)
 ParOldGen       total 84992K, used 830K [0x00007fffd0800000, 0x00007fffd5b00000, 0x00007fffe5d80000)
  object space 84992K, 0% used [0x00007fffd0800000,0x00007fffd08cfbb0,0x00007fffd5b00000)
 Metaspace       used 12935K, capacity 13114K, committed 13184K, reserved 1064960K
  class space    used 1556K, capacity 1656K, committed 1664K, reserved 1048576K

Deoptimization events (9 events):
Event: 7.650 Thread 0x0000000082245000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007ffff10ddde8 method=java.util.zip.ZipInputStream.readLOC()
Ljava/util/zip/ZipEntry; @ 29
Event: 7.650 Thread 0x0000000082245000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007ffff10e5c08 method=java.util.zip.ZipInputStream.getNextEn
try()Ljava/util/zip/ZipEntry; @ 38
Event: 7.700 Thread 0x0000000082245000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007ffff10b2378 method=java.util.HashMap.getNode(ILjava/lang/
Object;)Ljava/util/HashMap$Node; @ 134
Event: 7.700 Thread 0x0000000082245000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007ffff1092778 method=java.util.HashMap.getNode(ILjava/lang/
Object;)Ljava/util/HashMap$Node; @ 134
Event: 7.710 Thread 0x0000000082245000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007ffff106eb24 method=sun.reflect.generics.parser.SignatureP
arser.current()C @ 39
Event: 8.310 Thread 0x0000000082245000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007ffff1137d8c method=java.lang.String.indexOf([CII[CIII)I @
 3
Event: 8.480 Thread 0x0000000082245000 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00007ffff114af98 method=java.util.HashMap.putVal(ILjava/la
ng/Object;Ljava/lang/Object;ZZ)Ljava/lang/Object; @ 203
Event: 8.590 Thread 0x0000000082245000 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00007ffff114af98 method=java.util.HashMap.putVal(ILjava/la
ng/Object;Ljava/lang/Object;ZZ)Ljava/lang/Object; @ 203
Event: 8.820 Thread 0x0000000082245000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007ffff1030d80 method=java.lang.String.replace(CC)Ljava/lang
/String; @ 26

Classes redefined (0 events):
No events

Internal exceptions (10 events):
Event: 9.570 Thread 0x0000000082245000 Exception <a 'java/lang/NoSuchMethodError': java.lang.Object.lambda$unit$0(Ljava/lang/Object;)Ljava/lang/Object;> (0x000
07fffe5d8fa00) thrown at [JDK80$ROOT:[HOTSPOT.SRC.SHARE.VM.INTERPRETER]LINKRESOLVER.CPP, line 620]
Event: 9.730 Thread 0x0000000082245000 Exception <a 'java/lang/UnsatisfiedLinkError'> (0x00007fffe5fc96a0) thrown at [JDK80$ROOT:[HOTSPOT.SRC.SHARE.VM.PRIMS]JV
M.CPP, line 4232]
Event: 9.730 Thread 0x0000000082245000 Exception <a 'java/lang/UnsatisfiedLinkError'> (0x00007fffe5fc96a0) thrown at [JDK80$ROOT:[HOTSPOT.SRC.SHARE.VM.PRIMS]JN
I.CPP, line 724]
Event: 9.730 Thread 0x0000000082245000 Exception <a 'java/lang/UnsatisfiedLinkError'> (0x00007fffe5fc96a0) thrown at [JDK80$ROOT:[HOTSPOT.SRC.SHARE.VM.OOPS]INS
TANCEKLASS.CPP, line 1031]
Event: 9.730 Thread 0x0000000082245000 Exception <a 'java/lang/reflect/InvocationTargetException'> (0x00007fffe5fc9a90) thrown at [JDK80$ROOT:[HOTSPOT.SRC.SHAR
E.VM.RUNTIME]REFLECTION.CPP, line 1096]
Event: 9.730 Thread 0x0000000082245000 Exception <a 'java/lang/UnsatisfiedLinkError'> (0x00007fffe5fc96a0) thrown at [JDK80$ROOT:[HOTSPOT.SRC.SHARE.VM.PRIMS]JN
I.CPP, line 724]
Event: 9.730 Thread 0x0000000082245000 Exception <a 'java/lang/UnsatisfiedLinkError'> (0x00007fffe5fc96a0) thrown at [JDK80$ROOT:[HOTSPOT.SRC.SHARE.VM.PRIMS]JV
M.CPP, line 1614]
Event: 9.730 Thread 0x0000000082245000 Exception <a 'java/lang/UnsatisfiedLinkError'> (0x00007fffe5fc96a0) thrown at [JDK80$ROOT:[HOTSPOT.SRC.SHARE.VM.OOPS]INS
TANCEKLASS.CPP, line 1031]
Event: 9.730 Thread 0x0000000082245000 Exception <a 'java/lang/UnsatisfiedLinkError'> (0x00007fffe5fc96a0) thrown at [JDK80$ROOT:[HOTSPOT.SRC.SHARE.VM.OOPS]INS
TANCEKLASS.CPP, line 1031]
Event: 9.740 Thread 0x0000000082245000 Exception <a 'java/lang/NoClassDefFoundError': Could not initialize class q> (0x00007fffe5fce328) thrown at [JDK80$ROOT:
[HOTSPOT.SRC.SHARE.VM.OOPS]INSTANCEKLASS.CPP, line 933]

Events (10 events):
Event: 9.770 loading class x$1
Event: 9.770 loading class x$1 done
Event: 9.770 loading class x$6
Event: 9.770 loading class x$6 done
Event: 9.770 loading class afm
Event: 9.770 loading class afm done
Event: 9.780 loading class java/util/function/Consumer
Event: 9.780 loading class java/util/function/Consumer done
Event: 9.790 loading class java/lang/StrictMath
Event: 9.790 Executing VM operation: CollectForMetadataAllocation



VM Arguments:
jvm_args: -Xmx512M
java_command: server.jar
java_class_path (initial): server.jar
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=SYS$SYSDEVICE:[USERS.BLW.mc]

Signal Handlers:
SIGSEGV: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGBUS: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGFPE: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGPIPE: SIG_IGN, sa_mask[0]=0x00a0b920, sa_flags=0x00000000
SIGILL: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGUSR2: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGHUP: [java$jvm_shr+0x0], sa_mask[0]=0xffffffff, sa_flags=0xfffffffd
SIGINT: [java$jvm_shr+0x0], sa_mask[0]=0xffffffff, sa_flags=0xfffffffd
SIGQUIT: [java$jvm_shr+0x0], sa_mask[0]=0xffffffff, sa_flags=0xfffffffd
SIGTERM: [java$jvm_shr+0x0], sa_mask[0]=0xffffffff, sa_flags=0xfffffffd


---------------  S Y S T E M  ---------------

OS:iVMS

CPU:total 4 (initial active 4) (4 cores per cpu, 1 threads per core) family 6 model 158 stepping 10, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4
.2, popcnt, avx, avx2, aes, clmul, erms, 3dnowpref, lzcnt, tsc, tscinvbit, bmi1, bmi2, adx

Memory: 8k page, physical 8123184k (2513912k free)

vm_info: OpenJDK 64-Bit Server VM (25.372-b07) for OpenVMS-amd64 JRE (1.8.0_372-vms), built on Jul  6 2023 06:49:17 by "VSI" with vclang

time: Tue Sep 12 22:09:57 2023
timezone: +03
elapsed time: 10.069899 seconds (0d 0h 0m 10s)
Would anyone be able to help?
Thanks!

User avatar

imiller
Master
Posts: 147
Joined: Fri Jun 28, 2019 8:45 am
Reputation: 0
Location: South Tyneside, UK
Status: Offline
Contact:

Re: Java maximum heap size too small on OpenJDK8 on x86

Post by imiller » Thu Sep 14, 2023 4:49 am

Look at SYS$SYSTEM:AGEN$PARAMS.REPORT to see what AUTOGEN did and any informational messages reported.
AUTOGEN bases some of its calculations on data collected when the system is running and is very conservative in its calculations.
@SYS$SYSTEM:AUTOGEN SAVPARAMS TESTFILES
will run AUTOGEN to produce the report but not change anything. See what it says.
Ian Miller
[ personal opinion only. usual disclaimers apply. Do not taunt happy fun ball ].


Topic author
iblowmymind
Contributor
Posts: 17
Joined: Sun Apr 09, 2023 1:54 pm
Reputation: 0
Status: Offline

Re: Java maximum heap size too small on OpenJDK8 on x86

Post by iblowmymind » Thu Sep 14, 2023 1:30 pm

Done, and resized the pagefile to the suggested amount:

Code: Select all

Enter new size for paging file: 16254600
%SYSGEN-I-EXTENDED, SYS$SPECIFIC:[SYSEXE]PAGEFILE.SYS;1 extended
Enter new size for system dump file: 16246458
%SYSGEN-I-EXTENDED, SYS$SPECIFIC:[SYSEXE]SYSDUMP.DMP;1 extended
Swapfiles are not supported on X86, skipping.

************************************************************************
*  Please reboot in order for the new files to be used by the system.  *
*  After rebooting, purge obsolete copies of the files.                *
*  DO NOT delete the old files until after the reboot.                 *
************************************************************************
Odd that it only suggested 4 KB's on the first setup, though. E9.2-1 flake?

User avatar

arne_v
Master
Posts: 347
Joined: Fri Apr 17, 2020 7:31 pm
Reputation: 0
Location: Rhode Island, USA
Status: Offline
Contact:

Re: Java maximum heap size too small on OpenJDK8 on x86

Post by arne_v » Thu Sep 14, 2023 1:55 pm

So does it run now?

Added in 8 minutes 17 seconds:
(after reboot)]
Arne
arne@vajhoej.dk
VMS user since 1986


Topic author
iblowmymind
Contributor
Posts: 17
Joined: Sun Apr 09, 2023 1:54 pm
Reputation: 0
Status: Offline

Re: Java maximum heap size too small on OpenJDK8 on x86

Post by iblowmymind » Thu Sep 14, 2023 2:41 pm

Yup, all good now.
Thank you!

Post Reply