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 12:20:39 PST 2011


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