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   
Whiteboard:
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. https://coral.ai/products/dev-board/#tech-specs

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"
      export I_WANT_GLOBAL_JAVA_OPTIONS=1

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(ZipFileSystem.java:1079)
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.<init>(ZipFileSystem.java:135)
        at jdk.zipfs/jdk.nio.zipfs.JarFileSystem.<init>(JarFileSystem.java:62)
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:134)
        at jdk.compiler/com.sun.tools.javac.file.JavacFileManager$ArchiveContainer.<init>(JavacFileManager.java:514)
        at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.getContainer(JavacFileManager.java:316)
        at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.list(JavacFileManager.java:712)
        at jdk.compiler/com.sun.tools.javac.code.ClassFinder.list(ClassFinder.java:737)
        at jdk.compiler/com.sun.tools.javac.code.ClassFinder.scanUserPaths(ClassFinder.java:681)
        at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:551)
        at jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:299)
        at jdk.compiler/com.sun.tools.javac.code.ClassFinder$$Lambda$44/0x00000001000cd840.complete(Unknown Source)
        at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:642)
        at jdk.compiler/com.sun.tools.javac.code.Symbol$PackageSymbol.members(Symbol.java:1131)
        at jdk.compiler/com.sun.tools.javac.code.Symtab.listPackageModules(Symtab.java:837)
        at jdk.compiler/com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:345)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:529)
        at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:286)
        at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:301)
        at jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:576)
        at jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:560)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1066)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:937)
        at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:311)
        at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170)
        at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
        at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)
 * ERROR: dev-util/bazel-5.0.0::gentoo failed (compile phase):
 *   Failed compiling bazel
 *
 * Call stack:
 *     ebuild.sh, line 127:  Called src_compile
 *   environment, line 2969:  Called die
 * The specific snippet of code:
 *       VERBOSE=yes ./compile.sh || 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:

build.log
eclass-debug.log
emerge_info.txt
emerge_pqv.txt
environment.zip
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