RFR(XXS): 8157271: Avoid extra copy of NativeCallStack

Zhengyu Gu zgu at redhat.com
Thu May 19 12:08:51 UTC 2016


Change looks good to me.

NativeCallStack always starts with a StackObj,  it can be tricky to 
decide where to copy or pass through.

-Zhengyu

On 05/18/2016 06:38 PM, David Holmes wrote:
> Seems like a nice enhancement.
>
> I always find it hard to know/determine when copies of objects will be 
> made. Guess that is why I prefer to work with pointers :)
>
> Thanks,
> David
>
> On 19/05/2016 6:40 AM, Markus Gronlund wrote:
>> Greetings,
>>
>>
>>
>> Minor improvement found when reading up on NMT:
>>
>>
>>
>> Description:
>>
>>
>>
>> Pass through a const NativeCallStack& instead of a copy in:
>>
>>
>> MallocSiteHashtableEntry(const NativeCallStack& stack)
>>
>>
>> and let AllocationSite<MemoryCounter> accomplish the single copy into 
>> the _call_site member.
>>
>>
>>
>> Change:
>>
>>
>>
>> # HG changeset patch
>>
>> # User mgronlun
>>
>> # Date 1463598559 -7200
>>
>> #      Wed May 18 21:09:19 2016 +0200
>>
>> # Node ID c806533e436f7a1e3fac38101b766ea3d5a5405b
>>
>> # Parent  da110ff6c0e271ded14b015ec7de2e2f85d58e73
>>
>> [mq]: MallocSiteHashtableEntry
>>
>>
>>
>> diff --git a/src/share/vm/services/mallocSiteTable.hpp 
>> b/src/share/vm/services/mallocSiteTable.hpp
>>
>> --- a/src/share/vm/services/mallocSiteTable.hpp
>>
>> +++ b/src/share/vm/services/mallocSiteTable.hpp
>>
>> @@ -62,7 +62,7 @@
>>
>>   public:
>>
>>    MallocSiteHashtableEntry() : _next(NULL) { }
>>
>> -  MallocSiteHashtableEntry(NativeCallStack stack):
>>
>> +  MallocSiteHashtableEntry(const NativeCallStack& stack):
>>
>>      _malloc_site(stack), _next(NULL) { }
>>
>>    inline const MallocSiteHashtableEntry* next() const {
>>
>>
>>
>>
>>
>> Bug:
>>
>> https://bugs.openjdk.java.net/browse/JDK-8157271
>>
>>
>>
>> Thanks in advance
>>
>> Markus
>>
>>
>>



More information about the hotspot-runtime-dev mailing list