Closed deepj closed 4 years ago
Thank you for the bug report.
Both the 1st and 3rd logs seem to be OutOfMemoryError
.
I would think because of some leak or using excessive memory for representing some of the data Bundler uses.
The OutOfMemoryError seems to happen for libv8 which is a very large gem: 190MB on macOS for the version you're using: https://rubygems.org/gems/libv8/versions.
Could you try bundle install
without the libv8
gem?
We'll try to reproduce the OutOfMemoryError.
The second error is a compilation error:
[truffle] opt fail Truffle::RegexpOperations.last_match resource:/truffleruby/core/truffle/regexp_operations.rb:24 <split-2c0d7f5>|Reason org.graalvm.compiler.graph.GraalGraphError: org.graalvm.compiler.debug.GraalError: should not reach here: node is not LIRLowerable: 32|NewFrame
at node: 32|NewFrame
org.graalvm.compiler.graph.GraalGraphError: org.graalvm.compiler.debug.GraalError: should not reach here: node is not LIRLowerable: 32|NewFrame
at node: 32|NewFrame
at org.graalvm.compiler.core.gen.NodeLIRBuilder.doBlock(NodeLIRBuilder.java:378)
at org.graalvm.compiler.core.LIRGenerationPhase.emitBlock(LIRGenerationPhase.java:85)
at org.graalvm.compiler.core.LIRGenerationPhase.run(LIRGenerationPhase.java:75)
at org.graalvm.compiler.core.LIRGenerationPhase.run(LIRGenerationPhase.java:46)
at org.graalvm.compiler.lir.phases.LIRPhase.apply(LIRPhase.java:117)
at org.graalvm.compiler.lir.phases.LIRPhase.apply(LIRPhase.java:109)
at org.graalvm.compiler.core.gen.LIRCompilerBackend.emitLIR0(LIRCompilerBackend.java:155)
at org.graalvm.compiler.core.gen.LIRCompilerBackend.emitLIR(LIRCompilerBackend.java:113)
at org.graalvm.compiler.core.gen.LIRCompilerBackend.emitBackEnd(LIRCompilerBackend.java:83)
at org.graalvm.compiler.core.target.Backend.emitBackEnd(Backend.java:279)
at org.graalvm.compiler.core.GraalCompiler.compile(GraalCompiler.java:145)
at org.graalvm.compiler.core.GraalCompiler.compileGraph(GraalCompiler.java:129)
at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl.compilePEGraph(TruffleCompilerImpl.java:528)
at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl.compileAST(TruffleCompilerImpl.java:470)
at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl$TruffleCompilationWrapper.performCompilation(TruffleCompilerImpl.java:644)
at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl$TruffleCompilationWrapper.performCompilation(TruffleCompilerImpl.java:586)
at org.graalvm.compiler.core.CompilationWrapper.run(CompilationWrapper.java:179)
at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl.actuallyCompile(TruffleCompilerImpl.java:299)
at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl.doCompile(TruffleCompilerImpl.java:267)
at org.graalvm.compiler.truffle.runtime.GraalTruffleRuntime.compileImpl(GraalTruffleRuntime.java:710)
at org.graalvm.compiler.truffle.runtime.GraalTruffleRuntime.doCompile(GraalTruffleRuntime.java:691)
at org.graalvm.compiler.truffle.runtime.BackgroundCompileQueue$Request.run(BackgroundCompileQueue.java:83)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at org.graalvm.compiler.truffle.runtime.BackgroundCompileQueue$TruffleCompilerThreadFactory$1.run(BackgroundCompileQueue.java:176)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:479)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
Caused by: org.graalvm.compiler.debug.GraalError: should not reach here: node is not LIRLowerable: 32|NewFrame
at org.graalvm.compiler.core.gen.NodeLIRBuilder.emitNode(NodeLIRBuilder.java:484)
at org.graalvm.compiler.core.gen.NodeLIRBuilder.doRoot(NodeLIRBuilder.java:473)
at org.graalvm.compiler.core.gen.NodeLIRBuilder.doBlock(NodeLIRBuilder.java:376)
... 29 more
That should let the process continue, although it might be quite a bit slower.
I split the compilation error in a separate issue: #1825
It seems libv8
caused the OutOfMemoryError
error. It was a dependency of mini_racer
.
But the whole bundle install
is extremely slow and I can't use my machine during installation due to throttling.
@deepj To get an idea, how much RAM do you have available (free -m
)?
@eregon unfortunately, there is no such command on macOS. Any way, bundle install is significant slower with TruffleRuby 19.3.0 on my machine
What's the available memory in Activity Monitor then?
and I can't use my machine during installation due to throttling.
Maybe it's swapping memory, or do you mean something else?
@eregon I tried truffleruby 20.1.0-dev-a575d7bc, like ruby 2.6.5, GraalVM CE Native [x86_64-darwin]
And I got it again:
Fetching rails-html-sanitizer 1.3.0
Installing rails-html-sanitizer 1.3.0
Fetching actionview 6.0.2.1
Installing actionview 6.0.2.1
Fetching rack 2.1.2
Installing rack 2.1.2
Fetching rack-test 1.1.0
[truffle] opt fail Gem::Package::TarHeader.from ~/.rubies/truffleruby-20.1.0-dev/lib/mri/rubygems/package/tar_header.rb:102|ASTSize 252 |Reason java.lang.OutOfMemoryError: Garbage-collected heap size exceeded.
java.lang.OutOfMemoryError: Garbage-collected heap size exceeded.
Installing rack-test 1.1.0
Fetching actionpack 6.0.2.1
Installing actionpack 6.0.2.1
Fetching nio4r 2.5.2
Installing nio4r 2.5.2 with native extensions
This happens mostly when there is 150+ gems to be installed and all it's installed from the scratch
@deepj Could you run with --vm.XX:+PrintGCSummary
, for instance:
ruby --vm.XX:+PrintGCSummary -S bundle install
That should show the heap sizes chosen by Native Image.
@eregon here is the result. I tried it during the last two days but the problem didn't occur again (I always remove all previous gems).
PrintGCSummary: YoungGenerationSize: 1073741824
PrintGCSummary: MinimumHeapSize: 2147483648
PrintGCSummary: MaximumHeapSize: 6871947600
PrintGCSummary: AlignedChunkSize: 1048576
PrintGCSummary: CollectedTotalChunkBytes: 105803262600
PrintGCSummary: CollectedTotalObjectBytes: 105079597760
PrintGCSummary: AllocatedNormalChunkBytes: 110604650616
PrintGCSummary: AllocatedNormalObjectBytes: 109841922176
PrintGCSummary: IncrementalGCCount: 88
PrintGCSummary: IncrementalGCNanos: 167289109886
PrintGCSummary: CompleteGCCount: 14
PrintGCSummary: CompleteGCNanos: 195090777187
PrintGCSummary: GCNanos: 362379887073
PrintGCSummary: TotalNanos: 1611073956986
PrintGCSummary: GCLoadPercent: 22
My laptop has only 8 GB RAM (+ something is reserved for iGPU)
This happened when I installed dependencies of https://github.com/chatwoot/chatwoot
Installing rack 2.1.2
Fetching rack-test 1.1.0
Installing rack-test 1.1.0
Fetching actionpack 6.0.2.1
[truffle] opt fail Gem::Package::TarHeader.from ~/.rubies/truffleruby-20.1.0-dev/lib/mri/rubygems/package/tar_header.rb:102|ASTSize 252 |Reason org.graalvm.compiler.core.common.PermanentBailoutException: Out-of-memory during live set allocation of size 88735
org.graalvm.compiler.core.common.PermanentBailoutException: Out-of-memory during live set allocation of size 88735
at org.graalvm.compiler.lir.alloc.lsra.LinearScanLifetimeAnalysisPhase.computeLocalLiveSets(LinearScanLifetimeAnalysisPhase.java:262)
at org.graalvm.compiler.lir.alloc.lsra.LinearScanLifetimeAnalysisPhase.run(LinearScanLifetimeAnalysisPhase.java:93)
at org.graalvm.compiler.lir.alloc.lsra.LinearScanAllocationPhase.apply(LinearScanAllocationPhase.java:53)
at org.graalvm.compiler.lir.alloc.lsra.LinearScanAllocationPhase.apply(LinearScanAllocationPhase.java:46)
at org.graalvm.compiler.lir.alloc.lsra.LinearScan.allocate(LinearScan.java:691)
at org.graalvm.compiler.lir.alloc.lsra.LinearScanPhase.run(LinearScanPhase.java:42)
Installing actionpack 6.0.2.1
at org.graalvm.compiler.lir.alloc.lsra.LinearScanPhase.run(LinearScanPhase.java:35)
at org.graalvm.compiler.lir.phases.LIRPhase.apply(LIRPhase.java:117)
at org.graalvm.compiler.lir.phases.LIRPhase.apply(LIRPhase.java:109)
at org.graalvm.compiler.lir.phases.LIRPhaseSuite.run(LIRPhaseSuite.java:98)
at org.graalvm.compiler.lir.phases.LIRPhase.apply(LIRPhase.java:117)
at org.graalvm.compiler.lir.phases.LIRPhase.apply(LIRPhase.java:109)
at org.graalvm.compiler.core.gen.LIRCompilerBackend.emitLowLevel(LIRCompilerBackend.java:180)
at org.graalvm.compiler.core.gen.LIRCompilerBackend.emitLIR0(LIRCompilerBackend.java:160)
at org.graalvm.compiler.core.gen.LIRCompilerBackend.emitLIR(LIRCompilerBackend.java:113)
at org.graalvm.compiler.core.gen.LIRCompilerBackend.emitBackEnd(LIRCompilerBackend.java:83)
at org.graalvm.compiler.core.target.Backend.emitBackEnd(Backend.java:279)
at org.graalvm.compiler.core.GraalCompiler.compile(GraalCompiler.java:145)
Fetching nio4r 2.5.2
at org.graalvm.compiler.core.GraalCompiler.compileGraph(GraalCompiler.java:129)
at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl.compilePEGraph(TruffleCompilerImpl.java:539)
at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl.compileAST(TruffleCompilerImpl.java:481)
at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl$TruffleCompilationWrapper.performCompilation(TruffleCompilerImpl.java:660)
at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl$TruffleCompilationWrapper.performCompilation(TruffleCompilerImpl.java:598)
at org.graalvm.compiler.core.CompilationWrapper.run(CompilationWrapper.java:179)
at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl.actuallyCompile(TruffleCompilerImpl.java:308)
at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl.doCompile(TruffleCompilerImpl.java:259)
at org.graalvm.compiler.truffle.runtime.GraalTruffleRuntime.compileImpl(GraalTruffleRuntime.java:721)
at org.graalvm.compiler.truffle.runtime.GraalTruffleRuntime.doCompile(GraalTruffleRuntime.java:702)
at org.graalvm.compiler.truffle.runtime.GraalTruffleRuntime$1.execute(GraalTruffleRuntime.java:777)
at org.graalvm.compiler.truffle.runtime.BackgroundCompileQueue$RequestImpl.call(BackgroundCompileQueue.java:195)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at org.graalvm.compiler.truffle.runtime.BackgroundCompileQueue$TruffleCompilerThreadFactory$1.run(BackgroundCompileQueue.java:238)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:527)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
Caused by: java.lang.OutOfMemoryError: Garbage-collected heap size exceeded.
Installing nio4r 2.5.2 with native extensions
Fetching websocket-extensions 0.1.4
PrintGCSummary: YoungGenerationSize: 1073741824
PrintGCSummary: MinimumHeapSize: 2147483648
PrintGCSummary: MaximumHeapSize: 6871947600
PrintGCSummary: AlignedChunkSize: 1048576
PrintGCSummary: CollectedTotalChunkBytes: 99840136016
PrintGCSummary: CollectedTotalObjectBytes: 99173061584
PrintGCSummary: AllocatedNormalChunkBytes: 101859271536
PrintGCSummary: AllocatedNormalObjectBytes: 101175348136
PrintGCSummary: IncrementalGCCount: 81
PrintGCSummary: IncrementalGCNanos: 48363886437
PrintGCSummary: CompleteGCCount: 13
PrintGCSummary: CompleteGCNanos: 101418291795
PrintGCSummary: GCNanos: 149782178232
PrintGCSummary: TotalNanos: 841578348840
PrintGCSummary: GCLoadPercent: 18
Are you using TruffleRuby 19.3 or the nightly builds (which one?) for the above output? I'd guess the nightly build since the young generation is 1GB. That last output is the same issue as https://github.com/oracle/truffleruby/issues/1893#issuecomment-582490912.
Ah, it's indeed the nightly, https://github.com/oracle/truffleruby/issues/1824#issuecomment-582004165 sorry, I missed that.
@eregon truffleruby 20.1.0-dev-a575d7bc, like ruby 2.6.5, GraalVM CE Native [x86_64-darwin]
Another fault
Fetching yard 0.9.24
Installing yard 0.9.24
[truffle] opt fail IO#fsync resource:/truffleruby/core/io.rb:1660 |ASTSize 48 |Reason java.lang.OutOfMemoryError: Garbage-collected heap size exceeded.
java.lang.OutOfMemoryError: Garbage-collected heap size exceeded.
Fetching yard-junk 0.0.7
Installing yard-junk 0.0.7
@eregon maybe close this? Since using nighly builds I've never met with this. At least with last changes around Bundler
Right, the root cause seems to be the same as https://github.com/oracle/truffleruby/issues/1893
I wanted to try one old project to run on TruffleRuby but I was stopped while bundle install when I faced to multiple fails. At least on my machine this happens always when one of the following errors is occured.
Unfortunately, I can't share the
Gemfile
andGemfile.lock
publicly, but I can share it privately.Errors: