[8u] 8218558: NMT stack traces in output should show mt component for virtual memory allocations

Zhengyu Gu zgu at redhat.com
Mon Nov 11 21:12:18 UTC 2019


Hi Andrew,

On 11/11/19 12:28 PM, Andrew John Hughes wrote:
> 
> 
> On 22/08/2019 12:40, Zhengyu Gu wrote:
>> Hi,
>>
>> I would like to backport this patch to 8u.
>>
>> It is the counterpart of JDK-8139673, that improves usability of NMT
>> detail tracking, by associating every virtual memory allocation site
>> with its memory type.
>>
>> 11u patch does not apply cleanly, but conflicts are minors. There are a
>> couple of conflicts with copyright years, also a new include file in 11u
>> patch that already added in 8u, and indents.
>>
>> Original bug: https://bugs.openjdk.java.net/browse/JDK-8218558
>> Original code review thread:
>> https://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2019-February/032428.html
>>
>>
>> 8u Webrev:
>> http://cr.openjdk.java.net/~zgu/JDK-8218558-8u/webrev.00/index.html
>>
>>
>> Thanks,
>>
>> -Zhengyu
> 
> There is another conflict you didn't mention, visible when comparing the
> two patches:
> 
>
As I mentioned above, this patch was not brought down from 13, but from 
11u (https://hg.openjdk.java.net/jdk-updates/jdk11u/rev/adb14d5b965e).

I cannot remember the exact reason, probably because the conflicts 
already resolved there.

Thanks,

-Zhengyu


  @@ -160,15 +152,20 @@
> 
>    void MemDetailDiffReporter::diff_malloc_site(const MallocSite* early,
>      const MallocSite* current)  const {
> --  assert(early->flags() == current->flags(), "Must be the same memory
> type");
> -+  assert(early->flag() == current->flag(), "Must be the same memory
> type");
> -   diff_malloc_site(current->call_stack(), current->size(),
> current->count(),
> --    early->size(), early->count(), early->flags());
> -+    early->size(), early->count(), early->flag());
> +-  if (early->flags() != current->flags()) {
> ++  if (early->flag() != current->flag()) {
> +     // If malloc site type changed, treat it as deallocation of old
> type and
> +     // allocation of new type.
> +     old_malloc_site(early);
> +     new_malloc_site(current);
> +   } else {
> +     diff_malloc_site(current->call_stack(), current->size(),
> current->count(),
> +-      early->size(), early->count(), early->flags());
> ++      early->size(), early->count(), early->flag());
> +   }
>    }
> 
> - void MemDetailDiffReporter::diff_malloc_site(const NativeCallStack*
> stack, size_t current_size,
> 
> This is a sequencing issue. 8u already has '8200109: NMT:
> diff_malloc_site assert(early->flags() == current->flags(), "Must be the
> same memory type")', which was applied after 8218558. Once both patches
> are applied to 8u, the function looks the same in both 8u & 13u.
> 
> Reviewed & approved.
> 
> Thanks,
> 



More information about the jdk8u-dev mailing list