-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P4
-
Affects Version/s: 26
-
Component/s: hotspot
While investigating JDK-8366990, I noticed that when using -XX:+VerifyLoopOptimizations we can end up in cases where Compile::current()->comp_arena() grows indefinitely. This is due to repetitive allocations on the compile arena during loop verification:
- _body(Compile::current()->comp_arena()) in the constructor of PhaseIdealLoopTree
- _loop_or_ctrl(igvn.C->comp_arena()) in the constructor of PhaseIdealLoop
The issue becomes quite obvious with some printing:
--- a/src/hotspot/share/opto/loopnode.hpp
+++ b/src/hotspot/share/opto/loopnode.hpp
@@ -1203,6 +1203,7 @@ class PhaseIdealLoop : public PhaseTransform {
DEBUG_ONLY(C->set_phase_verify_ideal_loop();)
build_and_optimize();
DEBUG_ONLY(C->reset_phase_verify_ideal_loop();)
+ tty->print_cr("size of comp_arena: %lu", igvn.C->comp_arena()->size_in_bytes());
}
java -XX:CompileCommand=compileonly,compiler.loopopts.TestVerifyLoopOptimizationsHitsMemLimit::test -XX:-TieredCompilation -Xcomp -XX:PerMethodTrapLimit=0 -XX:+StressLoopPeeling -XX:+VerifyLoopOptimizations -XX:StressSeed=1870557292 -XX:CompileCommand=compileonly,compiler.loopopts.TestVerifyLoopOptimizationsHitsMemLimit::test open/test/hotspot/jtreg/compiler/loopopts/TestVerifyLoopOptimizationsHitsMemLimit.java
- _body(Compile::current()->comp_arena()) in the constructor of PhaseIdealLoopTree
- _loop_or_ctrl(igvn.C->comp_arena()) in the constructor of PhaseIdealLoop
The issue becomes quite obvious with some printing:
--- a/src/hotspot/share/opto/loopnode.hpp
+++ b/src/hotspot/share/opto/loopnode.hpp
@@ -1203,6 +1203,7 @@ class PhaseIdealLoop : public PhaseTransform {
DEBUG_ONLY(C->set_phase_verify_ideal_loop();)
build_and_optimize();
DEBUG_ONLY(C->reset_phase_verify_ideal_loop();)
+ tty->print_cr("size of comp_arena: %lu", igvn.C->comp_arena()->size_in_bytes());
}
java -XX:CompileCommand=compileonly,compiler.loopopts.TestVerifyLoopOptimizationsHitsMemLimit::test -XX:-TieredCompilation -Xcomp -XX:PerMethodTrapLimit=0 -XX:+StressLoopPeeling -XX:+VerifyLoopOptimizations -XX:StressSeed=1870557292 -XX:CompileCommand=compileonly,compiler.loopopts.TestVerifyLoopOptimizationsHitsMemLimit::test open/test/hotspot/jtreg/compiler/loopopts/TestVerifyLoopOptimizationsHitsMemLimit.java
- relates to
-
JDK-8173709 Fix VerifyLoopOptimizations - step 1 - minimal infrastructure
-
- Resolved
-
-
JDK-8366990 C2: Compilation hits the memory limit when verifying loop opts in Split-If code
-
- Resolved
-