From ca54f4e007ab0f13bec9aaf995d34c0ab3ba6452 Mon Sep 17 00:00:00 2001 From: Gerard Ziemski Date: Sat, 27 May 2023 18:28:49 +0000 Subject: [PATCH] 8306428: RunThese30M.java crashed with assert(early->flag() == current->flag() || early->flag() == mtNone) Reviewed-by: jsjolen, stuefe --- src/hotspot/share/services/memReporter.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/services/memReporter.cpp b/src/hotspot/share/services/memReporter.cpp index 8211e5e300173..7c5f37c69924d 100644 --- a/src/hotspot/share/services/memReporter.cpp +++ b/src/hotspot/share/services/memReporter.cpp @@ -780,6 +780,13 @@ void MemDetailDiffReporter::diff_virtual_memory_sites() const { } else if (compVal > 0) { old_virtual_memory_site(early_site); early_site = early_itr.next(); + } else if (early_site->flag() != current_site->flag()) { + // This site was originally allocated with one flag, then released, + // then re-allocated at the same site (as far as we can tell) with a different flag. + old_virtual_memory_site(early_site); + early_site = early_itr.next(); + new_virtual_memory_site(current_site); + current_site = current_itr.next(); } else { diff_virtual_memory_site(early_site, current_site); early_site = early_itr.next(); @@ -842,8 +849,6 @@ void MemDetailDiffReporter::old_virtual_memory_site(const VirtualMemoryAllocatio void MemDetailDiffReporter::diff_virtual_memory_site(const VirtualMemoryAllocationSite* early, const VirtualMemoryAllocationSite* current) const { - assert(early->flag() == current->flag() || early->flag() == mtNone, - "Expect the same flag, but %s != %s", NMTUtil::flag_to_name(early->flag()),NMTUtil::flag_to_name(current->flag())); diff_virtual_memory_site(current->call_stack(), current->reserved(), current->committed(), early->reserved(), early->committed(), current->flag()); }