Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8319314

NMT detail report slow or hangs for large number of mappings

    XMLWordPrintable

Details

    • b24

    Backports

      Description

        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
        ```



        Attachments

          Issue Links

            Activity

              People

                stuefe Thomas Stuefe
                stuefe Thomas Stuefe
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: