-
Bug
-
Resolution: Unresolved
-
P3
-
17, 25
C2: String concatenation optimization fails with "Hit MemLimit". If we disable this limit, it hits another error: "assert(req < Compile::current()->max_node_limit() - NodeLimitFudgeFactor) failed: Input limit exceeded"
In product, the test seems to hang.
Code pattern:
[...]
s = new StringBuilder().append(s).append(s).toString();
s = new StringBuilder().append(s).append(s).toString();
s = new StringBuilder().append(s).append(s).toString();
s = new StringBuilder().append(s).append(s).toString();
[..]
===
In TestStackedConcatsMany.java, a string of large size 2^24 is built. But even if half of those concats are removed resulting in a more reasonably sized 2^12 string, there's a later crash:
78 assert(C->live_nodes() <= C->max_node_limit(), "Live Node limit exceeded limit");
#0 src/hotspot/share/opto/node.cpp:78 in Node::verify_construction
[...]
# 7 src/hotspot/share/opto/stringopts.cpp:1558 in PhaseStringOpts::copy_string
# 8 src/hotspot/share/opto/stringopts.cpp:1612 in PhaseStringOpts::replace_string_concat
Less than 1000 live nodes before the call to replace_string_concat turns into 80000+ after.
===
Maybe the optimization needs to be bounded somehow.
In product, the test seems to hang.
Code pattern:
[...]
s = new StringBuilder().append(s).append(s).toString();
s = new StringBuilder().append(s).append(s).toString();
s = new StringBuilder().append(s).append(s).toString();
s = new StringBuilder().append(s).append(s).toString();
[..]
===
In TestStackedConcatsMany.java, a string of large size 2^24 is built. But even if half of those concats are removed resulting in a more reasonably sized 2^12 string, there's a later crash:
78 assert(C->live_nodes() <= C->max_node_limit(), "Live Node limit exceeded limit");
#0 src/hotspot/share/opto/node.cpp:78 in Node::verify_construction
[...]
# 7 src/hotspot/share/opto/stringopts.cpp:1558 in PhaseStringOpts::copy_string
# 8 src/hotspot/share/opto/stringopts.cpp:1612 in PhaseStringOpts::replace_string_concat
Less than 1000 live nodes before the call to replace_string_concat turns into 80000+ after.
===
Maybe the optimization needs to be bounded somehow.
- relates to
-
JDK-8362118 C2: add more debug prints to string concatenation optimizations
-
- Open
-