Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 846464

Summary: dev-util/bazel-5.0.0: The system is out of resources: OutOfMemoryError: Java heap space
Product: Gentoo Linux Reporter: John L. Poole <jlpoole56>
Component: Current packagesAssignee: Jason Zaman <perfinion>
Status: UNCONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: ARM64   
OS: Linux   
Package list:
Runtime testing required: ---
Attachments: Emerge info
Emerge pqv
Build log
Build Log Bazel
Emerge pqv Bazel
Emerge info Bazel
Environment Bazel
Eclass debug Bazel

Description John L. Poole 2022-05-19 14:50:30 UTC
I'm on the Google Coral Dev Board which has a 500GB NVMe attached via the USB-C connector.

The Dev Board has 1 GB of RAM, I've provided 48 GBs of swap in the Mendel environment, and 49GBs of swap in the Gentoo chroot (probably not referenced).

Top running in the Mendel enviornment shows:

top - 07:48:01 up 2 days, 11:38,  3 users,  load average: 0.08, 0.06, 0.01
Tasks: 146 total,   1 running, 145 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.1 us,  0.4 sy,  0.0 ni, 99.3 id,  0.0 wa,  0.1 hi,  0.2 si,  0.0 st
MiB Mem :    986.0 total,    385.8 free,    239.3 used,    360.9 buff/cache
MiB Swap:  99328.0 total,  99207.5 free,    120.5 used.    660.1 avail Mem

The Dev board runs Mendel which is a watered-down version of Debian v.10 ("Buster") (and Google could not use the trademark "Debian," so they use "Mendel").  Google's demo software that detects objects in videos utilizes an out-of-date version of gstreamer and sometimes does not work.  I finally decided I would try to build gstreamer's current high watermark in a chroot environment on the Dev Board (which I have succeeded in doing) as a first step test towards re-imaging the Coral Dev Board with Gentoo replacing Mendel (which development of Mendel has been halted per Coral Team member).

I have created a Gentoo chroot environment and see below for results of my emerge attempt.

After the first failure, I tried altering my Gentoo chroot environment with:

      export _JAVA_OPTIONS="-Xmx2g"

I was hoping that the heap needs would be met with swap, but I guess not?

What can I do to overcome the memory limitation I'm hitting?     

Reproducible: Always

Steps to Reproduce:
1. emerge dev-util/bazel

Actual Results:  
The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError: Java heap space
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.initCEN(
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.<init>(
        at jdk.zipfs/jdk.nio.zipfs.JarFileSystem.<init>(
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.newFileSystem(
        at jdk.compiler/$ArchiveContainer.<init>(
        at jdk.compiler/
        at jdk.compiler/
        at jdk.compiler/
        at jdk.compiler/
        at jdk.compiler/
        at jdk.compiler/
        at jdk.compiler/$$Lambda$44/0x00000001000cd840.complete(Unknown Source)
        at jdk.compiler/
        at jdk.compiler/$PackageSymbol.members(
        at jdk.compiler/
        at jdk.compiler/
        at jdk.compiler/$JCCompilationUnit.accept(
        at jdk.compiler/
        at jdk.compiler/
        at jdk.compiler/
        at jdk.compiler/
        at jdk.compiler/
        at jdk.compiler/
        at jdk.compiler/
        at jdk.compiler/
        at jdk.compiler/
        at jdk.compiler/
 * ERROR: dev-util/bazel-5.0.0::gentoo failed (compile phase):
 *   Failed compiling bazel
 * Call stack:
 *, line 127:  Called src_compile
 *   environment, line 2969:  Called die
 * The specific snippet of code:
 *       VERBOSE=yes ./ || die "Failed compiling bazel";
 * If you need support, post the output of `emerge --info '=dev-util/bazel-5.0.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-util/bazel-5.0.0::gentoo'`.
!!! When you file a bug report, please include the following information:
GENTOO_VM=openjdk-bin-11  CLASSPATH="" JAVA_HOME="/opt/openjdk-bin-11.0.14_p9"
JAVACFLAGS="-source 11 -target 11" COMPILER=""
and of course, the output of emerge --info =bazel-5.0.0
 * The complete build log is located at '/var/tmp/portage/dev-util/bazel-5.0.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-util/bazel-5.0.0/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-util/bazel-5.0.0/work'
 * S: '/var/tmp/portage/dev-util/bazel-5.0.0/work'

Expected Results:  
successful installation.

Requested files forthcoming:

Comment 1 John L. Poole 2022-05-19 14:50:54 UTC
Created attachment 779540 [details]
Emerge info
Comment 2 John L. Poole 2022-05-19 14:51:15 UTC
Created attachment 779543 [details]
Emerge pqv
Comment 3 John L. Poole 2022-05-19 14:51:31 UTC
Created attachment 779546 [details]
Build log
Comment 4 John L. Poole 2022-05-19 14:53:37 UTC
Created attachment 779549 [details]
Build Log Bazel
Comment 5 John L. Poole 2022-05-19 14:54:05 UTC
Created attachment 779552 [details]
Emerge pqv Bazel
Comment 6 John L. Poole 2022-05-19 14:54:30 UTC
Created attachment 779555 [details]
Emerge info Bazel
Comment 7 John L. Poole 2022-05-19 14:54:55 UTC
Created attachment 779558 [details]
Environment Bazel
Comment 8 John L. Poole 2022-05-19 14:55:33 UTC
Created attachment 779561 [details]
Eclass debug Bazel