Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8175214

[AOT] OOM compiling jdk.internal.module.SystemModules.descriptors()

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      Description

      AOT compiling java.base with 4gb heap now shows OOM message:

      Error: Failed compilation: jdk.internal.module.SystemModules.descriptors()[Ljava/lang/module/ModuleDescriptor;: java.lang.OutOfMemoryError: Java heap space:

      Even compiling just one this method without profiling code (no --compile-for-tiered) it OOM with 2Gb heap.

      $ cat cmd.txt
      compileOnly jdk.internal.module.SystemModules.descriptors()[Ljava/lang/module/ModuleDescriptor;

      $ $JAVA_HOME/bin/jaotc -J-Xmx2g --info --compile-commands cmd.txt --output a.so --module java.base
      Compiling a...
      5714 classes found (1317 ms)
      54288 methods total, 1 methods to compile (1177 ms)
      Compiling with 4 threads
      .Error: Failed compilation: jdk.internal.module.SystemModules.descriptors()[Ljava/lang/module/ModuleDescriptor;: java.lang.OutOfMemoryError: Java heap space

      0 methods compiled, 1 methods failed (70153 ms)

      Stack trace printed with --verbose shows:

      .Error: Failed compilation: jdk.internal.module.SystemModules.descriptors()[Ljava/lang/module/ModuleDescriptor;: java.lang.OutOfMemoryError: Java heap space
      java.lang.OutOfMemoryError: Java heap space
      at java.base/java.util.BitSet.initWords(BitSet.java:167)
      at java.base/java.util.BitSet.<init>(BitSet.java:162)
      at jdk.internal.vm.compiler/org.graalvm.compiler.lir.alloc.lsra.LinearScanLifetimeAnalysisPhase.computeLocalLiveSets(LinearScanLifetimeAnalysisPhase.java:243)
      at jdk.internal.vm.compiler/org.graalvm.compiler.lir.alloc.lsra.LinearScanLifetimeAnalysisPhase.run(LinearScanLifetimeAnalysisPhase.java:88)
      at jdk.internal.vm.compiler/org.graalvm.compiler.lir.alloc.lsra.LinearScanLifetimeAnalysisPhase.run(LinearScanLifetimeAnalysisPhase.java:73)
      at jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases.LIRPhase.apply(LIRPhase.java:111)
      at jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases.LIRPhase.apply(LIRPhase.java:104)
      at jdk.internal.vm.compiler/org.graalvm.compiler.lir.alloc.lsra.LinearScan.allocate(LinearScan.java:659)
      at jdk.internal.vm.compiler/org.graalvm.compiler.lir.alloc.lsra.LinearScanPhase.run(LinearScanPhase.java:46)
      at jdk.internal.vm.compiler/org.graalvm.compiler.lir.alloc.lsra.LinearScanPhase.run(LinearScanPhase.java:33)
      at jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases.LIRPhase.apply(LIRPhase.java:111)
      at jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases.LIRPhase.apply(LIRPhase.java:104)
      at jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases.LIRPhaseSuite.run(LIRPhaseSuite.java:89)
      at jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases.LIRPhase.apply(LIRPhase.java:111)
      at jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases.LIRPhase.apply(LIRPhase.java:104)
      at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.emitLowLevel(GraalCompiler.java:330)
      at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.emitLIR0(GraalCompiler.java:302)
      at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.emitLIR(GraalCompiler.java:252)
      at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.emitBackEnd(GraalCompiler.java:233)
      at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compile(GraalCompiler.java:179)
      at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compileGraph(GraalCompiler.java:164)
      at jdk.aot/jdk.tools.jaotc.AOTBackend.compileGraph(AOTBackend.java:135)
      at jdk.aot/jdk.tools.jaotc.AOTBackend.compileMethod(AOTBackend.java:103)
      at jdk.aot/jdk.tools.jaotc.AOTCompilationTask.run(AOTCompilationTask.java:117)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1161)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
      at java.base/java.lang.Thread.run(Thread.java:844)

      Igor, can you verify that it is Graal issue and not AOT. And pass to labs to investigate.

        Attachments

          Activity

            People

            • Assignee:
              iveresov Igor Veresov
              Reporter:
              kvn Vladimir Kozlov
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: