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

Improve heap dump performance with class metadata caching

    XMLWordPrintable

Details

    • svc
    • b24

    Backports

      Description

        Heap dumping performance is something our users frequently complain about. Modern JDKs already implement parallel heap dumps from diagnostic commands, which is nice. But there are single-threaded improvements that we can easily do.

        If you profile current heap dumping code, then you would see that walking the class data looking for fields takes the overwhelming majority of execution time. It got much worse in JDK 21 with JDK-8292818, where looking for field data involves re-parsing the class metadata stream all the time. See `jdk21-heapdump-png` for sample profile for sample reproducer (`HeapDump.java`) on JDK 21.

        Since heap dumping code runs sporadically, we can cache some class metadata that heap dumping code needs on hot paths.

        Attachments

          Issue Links

            Activity

              People

                shade Aleksey Shipilev
                shade Aleksey Shipilev
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: