RFR:8060074:Cleanup of unused memory tracking parameters in os::free and its callers.
Max Ockner
max.ockner at oracle.com
Thu Nov 20 19:23:57 UTC 2014
David,
Thomas beat me to it. os::free does not ever use the memtracking
argument that was being passed to it. This does not break memory
tracking though, because this memory tracking parameter is supplied and
saved in a malloc header during memory allocation.
os::free accesses and uses this header through
Memtracker::record_free(memblock).
Let me know if anything else stands out to you. I would love to have the
David Holmes stamp of approval for this fix.
Other notes:
I have fixed the copyrights and made a new webrev, but it hasn't been
copied to openjdk yet. Shouldn't be an issue because there isn't really
anything new to see. Either way, sorry about that.
Updated Webrev: http://oklahoma.us.oracle.com/~mockner/webrev/8060074.1/
Thanks,
Max Ockner
On 11/18/2014 9:47 PM, David Holmes wrote:
> Hi Max,
>
> So I would have assumed memflags were being passed to all the "free"
> routines for NMT purposes. Otherwise how does NMT track this?
>
> Thanks,
> David
>
> On 19/11/2014 7:53 AM, Max Ockner wrote:
>> Hello all,
>> Please review this minor cleanup:
>>
>> Bug ID: 8060074
>> Webrev: http://cr.openjdk.java.net/~coleenp/8060074/
>>
>> Summary:
>> (1) os::free takes two arguments, but never uses the second argument,
>> which is a MEMFLAG. I have removed this argument from every os::free
>> call.
>> (2) The FreeHeap method in src/share/vm/memory/allocation.inline.hpp
>> also takes a MEMFLAG argument, which is only used to call os::free. Now
>> an unused argument, it has been removed from all FreeHeap calls. No
>> other methods which directly call os::free() have this problem.
>> (3) The FREE_C_HEAP_ARRAY macro in src/share/vm/memory/allocation.hpp
>> takes A MEMFLAG argument which is passed to FreeHeap, and nothing else.
>> This argument is now unused, and has been removed. No other methods
>> which call FreeHeap have this problem.
>>
>> No methods or macros which use the FREE_C_HEAP_ARRAY macro needed
>> cleanup. I have also removed the extra argument from the definitions of
>> the above methods.
>>
>> Tests: jtreg hotspot tests with
>> -vmoption:"-XX:NativeMemoryTrackingdetail"
>>
>> Thanks for your help,
>> Max Ockner
More information about the hotspot-dev
mailing list