Request for reviews (XS): 7017240: C2: native memory leak in nsk/regression/b4675027 on windows-x86 in comp mode with G1

Tom Rodriguez tom.rodriguez at oracle.com
Fri Feb 4 14:24:27 PST 2011


That looks good.

tom

On Feb 4, 2011, at 2:12 PM, Vladimir Kozlov wrote:

> Thank you, Tom, for catching _dom_stk. An other one is _dom_lca_tags(C->comp_arena()). I used arena() set by base class PhaseTransform() to Thread::resource_area.
> 
> Updated webrev:
> 
> http://cr.openjdk.java.net/~kvn/7017240/webrev
> 
> thanks,
> Vladimir
> 
> Tom Rodriguez wrote:
>> On Feb 4, 2011, at 11:48 AM, Vladimir Kozlov wrote:
>>> http://cr.openjdk.java.net/~kvn/7017240/webrev
>>> 
>>> Fixed 7017240: C2: native memory leak in nsk/regression/b4675027 on windows-x86 in comp mode with G1
>>> 
>>> C2 adds additional code for G1 barriers so ideal graph
>>> may become larger then with other collectors.
>>> Also the compiled method itself is huge: 7102 bytes.
>>> Main part of the problem is memory resources usage during
>>> escape analysis and it will be resolved with 7013538 fix.
>>> But I also noticed that PhaseIdealLoop::build_and_optimize()
>>> allocates next arrays without freeing resources on exit
>>> (there is no ResourceMark):
>>> 
>>> _idom      = NEW_RESOURCE_ARRAY( Node*, _idom_size );
>>> _dom_depth = NEW_RESOURCE_ARRAY( uint,  _idom_size );
>>> 
>>> Add ResourceMark.
>>> 
>> That looks good.  Should _dom_stk be resource allocated as well?
>>  if (_dom_stk == NULL) {
>>    uint init_size = C->unique() / 100; // Guess that 1/100 is a reasonable initial size.
>>    if (init_size < 10) init_size = 10;
>>    _dom_stk = new (C->node_arena()) GrowableArray<uint>(C->node_arena(), init_size, 0, 0);
>>  }
>> tom



More information about the hotspot-compiler-dev mailing list