8201495: [Zero] Reduce limits of max heap size for boot JDK on s390

Severin Gehwolf sgehwolf at redhat.com
Mon Apr 16 09:30:11 UTC 2018


Hi Andrew,

On Mon, 2018-04-16 at 09:47 +0100, Andrew Haley wrote:
> On 04/13/2018 02:40 PM, Severin Gehwolf wrote:
> > ++ /usr/bin/tee /builddir/build/BUILD/java-9-openjdk-9.0.4.12-5.openjdk9.el7.s390/openjdk/build/jdk/modules/java.base/_the.java.base_batch.log
> > ++ /usr/bin/tee /builddir/build/BUILD/java-9-openjdk-9.0.4.12-5.openjdk9.el7.s390/openjdk/build/jdk/modules/java.base/_the.java.base_batch.log
> > Error occurred during initialization of VM
> > Could not reserve enough space for 1048576KB object heap
> 
> What is the root cause of this?  Is it that the system on which the build runs
> cannot allocate all that memory?  Does not have that much memory?

The configure code in JDK 9+ has this:

  JVM_HEAP_LIMIT_32="1024"
  # Running a 64 bit JVM allows for and requires a bigger heap
  JVM_HEAP_LIMIT_64="1600"
  STACK_SIZE_32=768
  STACK_SIZE_64=1536
  JVM_HEAP_LIMIT_GLOBAL=`expr $MEMORY_SIZE / 2`
  if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "$JVM_HEAP_LIMIT_32"; then
    JVM_HEAP_LIMIT_32=$JVM_HEAP_LIMIT_GLOBAL
  fi
  if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "$JVM_HEAP_LIMIT_64"; then
    JVM_HEAP_LIMIT_64=$JVM_HEAP_LIMIT_GLOBAL
  fi
  if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "512"; then
    JVM_HEAP_LIMIT_32=512
    JVM_HEAP_LIMIT_64=512
  fi

  if test "x$BOOT_JDK_BITS" = "x32"; then
    STACK_SIZE=$STACK_SIZE_32
    JVM_MAX_HEAP=$JVM_HEAP_LIMIT_32
  else
    STACK_SIZE=$STACK_SIZE_64
    JVM_MAX_HEAP=$JVM_HEAP_LIMIT_64
  fi


Here's my reasoning:

If I read this right then -Xmx will be bound above by 1/2 the hardware
memory size. The set heap limit for that build was 1024M. It then
follows that 1024M was less than 1/2 the hardware memory. Yet, it still
failed to allocate required memory. So to answer your question: It
looks like it was that the system wasn't able to allocate that much
memory at the time.

Those builds run on systems I don't have access to, though. What's
more, I don't have access to the build logs of that failed build any
longer. From a successful s390 build with that patch I see:

$ grep 'Memory limit' build.log 
* Memory limit:   5906 MB

This seems suspiciously high for 32 bit (or 31 bit in this case). Maybe
it gets the hardware memory size of the 64bit host system? We know this
runs in mock chroots on s390x boxes.

Thanks,
Severin


More information about the build-dev mailing list