1.1 --- a/src/share/vm/opto/phaseX.cpp Sun Sep 06 05:02:06 2015 -0700 1.2 +++ b/src/share/vm/opto/phaseX.cpp Wed Sep 16 11:09:09 2015 +0200 1.3 @@ -783,7 +783,7 @@ 1.4 //------------------------------PhaseIterGVN----------------------------------- 1.5 // Initialize hash table to fresh and clean for +VerifyOpto 1.6 PhaseIterGVN::PhaseIterGVN( PhaseIterGVN *igvn, const char *dummy ) : PhaseGVN(igvn,dummy), _worklist( ), 1.7 - _stack(C->unique() >> 1), 1.8 + _stack(C->live_nodes() >> 1), 1.9 _delay_transform(false) { 1.10 } 1.11 1.12 @@ -800,7 +800,11 @@ 1.13 // Initialize with previous PhaseGVN info from Parser 1.14 PhaseIterGVN::PhaseIterGVN( PhaseGVN *gvn ) : PhaseGVN(gvn), 1.15 _worklist(*C->for_igvn()), 1.16 - _stack(C->unique() >> 1), 1.17 +// TODO: Before incremental inlining it was allocated only once and it was fine. Now that 1.18 +// the constructor is used in incremental inlining, this consumes too much memory: 1.19 +// _stack(C->live_nodes() >> 1), 1.20 +// So, as a band-aid, we replace this by: 1.21 + _stack(C->comp_arena(), 32), 1.22 _delay_transform(false) 1.23 { 1.24 uint max; 1.25 @@ -1586,7 +1590,7 @@ 1.26 _nodes.map( n->_idx, new_node ); // Flag as having been cloned 1.27 1.28 // Allocate stack of size _nodes.Size()/2 to avoid frequent realloc 1.29 - GrowableArray <Node *> trstack(C->unique() >> 1); 1.30 + GrowableArray <Node *> trstack(C->live_nodes() >> 1); 1.31 1.32 trstack.push(new_node); // Process children of cloned node 1.33 while ( trstack.is_nonempty() ) {