-
Bug
-
Resolution: Fixed
-
P4
-
11, 17, 21, 22
-
b24
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8326508 | 21.0.4-oracle | Calvin Cheung | P4 | Resolved | Fixed | b01 |
JDK-8325933 | 21.0.3 | Aleksey Shipilev | P4 | Resolved | Fixed | b04 |
With >1 mio individual mappings (which may happen, e.g. when using ZGC), NMT detail report becomes unusable slow (I stopped my fastdebug JVM after 90 minutes).
We burn all the time here:
```
- 96,63% 96,16% Attach Listener libjvm.so [.] VirtualMemoryAllocationWalker::do_allocation_site
- VirtualMemoryAllocationWalker::do_allocation_site
- VirtualMemoryAllocationWalker::do_allocation_site
SortedLinkedList<ReservedMemoryRegion, &(compare_virtual_memory_base(ReservedMemoryRegion const&, ReservedMemoryRegion const&)), (AnyObj::allocation_type)2, (MEMFLAGS)12, (AllocFailStrategy::AllocFailEnum)1>::add (inlined)
LinkedListImpl<ReservedMemoryRegion, (AnyObj::allocation_type)2, (MEMFLAGS)12, (AllocFailStrategy::AllocFailEnum)1>::add (inlined)
- SortedLinkedList<ReservedMemoryRegion, &(compare_virtual_memory_base(ReservedMemoryRegion const&, ReservedMemoryRegion const&)), (AnyObj::allocation_type)2, (MEMFLAGS)12, (AllocFailStrategy::AllocFailEnum)1>::add (inlined)
- compare_virtual_memory_base (inlined)
- VirtualMemoryRegion::compare (inlined)
45,79% VirtualMemoryRegion::overlap_region (inlined)
4,32% VirtualMemoryRegion::compare (inlined)
```
.. doing a sorted insert into the target array, which is O(n^2):
```
(gdb) bt
#0 0x00007efc894c13f9 in VirtualMemoryRegion::overlap_region (sz=4096, addr=0x7efb788bf000 "", this=0x7efaae2f6918) at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/nmt/virtualMemoryTracker.hpp:201
#1 VirtualMemoryRegion::compare (rgn=..., this=0x7efaae2f6918) at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/nmt/virtualMemoryTracker.hpp:251
#2 compare_virtual_memory_base (r2=..., r1=...) at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/nmt/memBaseline.cpp:115
#3 SortedLinkedList<ReservedMemoryRegion, &(compare_virtual_memory_base(ReservedMemoryRegion const&, ReservedMemoryRegion const&)), (AnyObj::allocation_type)2, (MEMFLAGS)12, (AllocFailStrategy::AllocFailEnum)1>::add (node=0x7efaae87f700, this=0x7efac9af8f18)
at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/utilities/linkedlist.hpp:394
#4 LinkedListImpl<ReservedMemoryRegion, (AnyObj::allocation_type)2, (MEMFLAGS)12, (AllocFailStrategy::AllocFailEnum)1>::add (e=..., this=0x7efac9af8f18) at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/utilities/linkedlist.hpp:167
#5 SortedLinkedList<ReservedMemoryRegion, &(compare_virtual_memory_base(ReservedMemoryRegion const&, ReservedMemoryRegion const&)), (AnyObj::allocation_type)2, (MEMFLAGS)12, (AllocFailStrategy::AllocFailEnum)1>::add (e=..., this=0x7efac9af8f18)
at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/utilities/linkedlist.hpp:375
#6 VirtualMemoryAllocationWalker::do_allocation_site (rgn=<optimized out>, this=0x7efac9af8f10) at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/nmt/memBaseline.cpp:130
#7 VirtualMemoryAllocationWalker::do_allocation_site (this=0x7efac9af8f10, rgn=<optimized out>) at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/nmt/memBaseline.cpp:128
#8 0x00007efc89adfb86 in VirtualMemoryTracker::walk_virtual_memory (walker=walker@entry=0x7efac9af8f10) at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/nmt/virtualMemoryTracker.cpp:677
```
We burn all the time here:
```
- 96,63% 96,16% Attach Listener libjvm.so [.] VirtualMemoryAllocationWalker::do_allocation_site
- VirtualMemoryAllocationWalker::do_allocation_site
- VirtualMemoryAllocationWalker::do_allocation_site
SortedLinkedList<ReservedMemoryRegion, &(compare_virtual_memory_base(ReservedMemoryRegion const&, ReservedMemoryRegion const&)), (AnyObj::allocation_type)2, (MEMFLAGS)12, (AllocFailStrategy::AllocFailEnum)1>::add (inlined)
LinkedListImpl<ReservedMemoryRegion, (AnyObj::allocation_type)2, (MEMFLAGS)12, (AllocFailStrategy::AllocFailEnum)1>::add (inlined)
- SortedLinkedList<ReservedMemoryRegion, &(compare_virtual_memory_base(ReservedMemoryRegion const&, ReservedMemoryRegion const&)), (AnyObj::allocation_type)2, (MEMFLAGS)12, (AllocFailStrategy::AllocFailEnum)1>::add (inlined)
- compare_virtual_memory_base (inlined)
- VirtualMemoryRegion::compare (inlined)
45,79% VirtualMemoryRegion::overlap_region (inlined)
4,32% VirtualMemoryRegion::compare (inlined)
```
.. doing a sorted insert into the target array, which is O(n^2):
```
(gdb) bt
#0 0x00007efc894c13f9 in VirtualMemoryRegion::overlap_region (sz=4096, addr=0x7efb788bf000 "", this=0x7efaae2f6918) at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/nmt/virtualMemoryTracker.hpp:201
#1 VirtualMemoryRegion::compare (rgn=..., this=0x7efaae2f6918) at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/nmt/virtualMemoryTracker.hpp:251
#2 compare_virtual_memory_base (r2=..., r1=...) at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/nmt/memBaseline.cpp:115
#3 SortedLinkedList<ReservedMemoryRegion, &(compare_virtual_memory_base(ReservedMemoryRegion const&, ReservedMemoryRegion const&)), (AnyObj::allocation_type)2, (MEMFLAGS)12, (AllocFailStrategy::AllocFailEnum)1>::add (node=0x7efaae87f700, this=0x7efac9af8f18)
at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/utilities/linkedlist.hpp:394
#4 LinkedListImpl<ReservedMemoryRegion, (AnyObj::allocation_type)2, (MEMFLAGS)12, (AllocFailStrategy::AllocFailEnum)1>::add (e=..., this=0x7efac9af8f18) at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/utilities/linkedlist.hpp:167
#5 SortedLinkedList<ReservedMemoryRegion, &(compare_virtual_memory_base(ReservedMemoryRegion const&, ReservedMemoryRegion const&)), (AnyObj::allocation_type)2, (MEMFLAGS)12, (AllocFailStrategy::AllocFailEnum)1>::add (e=..., this=0x7efac9af8f18)
at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/utilities/linkedlist.hpp:375
#6 VirtualMemoryAllocationWalker::do_allocation_site (rgn=<optimized out>, this=0x7efac9af8f10) at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/nmt/memBaseline.cpp:130
#7 VirtualMemoryAllocationWalker::do_allocation_site (this=0x7efac9af8f10, rgn=<optimized out>) at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/nmt/memBaseline.cpp:128
#8 0x00007efc89adfb86 in VirtualMemoryTracker::walk_virtual_memory (walker=walker@entry=0x7efac9af8f10) at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/nmt/virtualMemoryTracker.cpp:677
```
- backported by
-
JDK-8325933 NMT detail report slow or hangs for large number of mappings
- Resolved
-
JDK-8326508 NMT detail report slow or hangs for large number of mappings
- Resolved
- links to
-
Commit openjdk/jdk21u-dev/fb19cb3c
-
Commit openjdk/jdk/9938b3f6
-
Review openjdk/jdk21u-dev/263
-
Review openjdk/jdk/16480
(1 links to)