hg: jdk7/hotspot-comp/hotspot: 6782260: Memory leak in CodeBuffer::create_patch_overflow

Tom Rodriguez Thomas.Rodriguez at Sun.COM
Tue Feb 23 10:49:00 PST 2010


On Feb 23, 2010, at 10:05 AM, Volker Simonis wrote:

> Hi Tom,
> 
> by incidence I've just found this problem while playing around with
> the Arena memory allocation in HS14. Now that I saw your change I'm
> confident that I've also done the right fix myself :)
> 
> There's just one question I have regarding your solution: isn't
> "CodeBuffer::take_over_code_from()" a problem here, because it copies
> "_overflow_arena" from one CodeBuffer into another one. I think this
> may potentially lead to a double delete of the same Arena. Or isn't
> this possible logically. Perhaps it would be more secure to add
> another line like:

Given the style of usage I don't think it's possible.  The overflow_arena is only shared with blobs that are created by expand and they are freed in a different way than normal new/delete pair.  Setting _overflow_arena to badAddress isn't a bad idea though.

tom

> 
>  DEBUG_ONLY(cb->_overflow_arena = (BufferBlob*)badAddress);
> 
> to "CodeBuffer::take_over_code_from()" or even better set
> "_overflow_arena" to NULL after it was copied?
> 
> What do you think?
> 
> Regards,
> Volker
> 
> 
> On Wed, Feb 4, 2009 at 5:29 AM,  <thomas.rodriguez at sun.com> wrote:
>> Changeset: 5bfdb08ea692
>> Author:    never
>> Date:      2009-02-03 18:05 -0800
>> URL:       http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/5bfdb08ea692
>> 
>> 6782260: Memory leak in CodeBuffer::create_patch_overflow
>> Reviewed-by: phh, kvn
>> 
>> ! src/share/vm/asm/codeBuffer.cpp
>> 
>> 



More information about the hotspot-compiler-dev mailing list