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

Performance issue (CodeHeap) with large free blocks

    XMLWordPrintable

Details

    • b24

    Backports

      Description

        The issue can be observed with large CodeHeaps (> 1GB) and tests which create a somewhat pathological pattern in the CodeHeap. One example would be test/hotspot/jtreg/compiler/codecache/OverflowCodeCacheTest.java

        This tests fills the CodeHeap with approx. 10**5 code blobs until a "CodeHeap full" condition is reached. All previously created code blobs are then freed again. As there are no other code blobs in the heap, the freeing process creates an ever growing single free block.

        The performance issue has two components:
        non-PRODUCT only: CodeHeap::invalidate() is called in merge_right() after joining the currently freed block with the previously existing one. This is an O(n*n) effort, and it's useless. The contents of the previously existing free block has already been invalidated.

        CodeHeap::mark_segmap_as_used() updates the segment map after the two free blocks have been joined. This is an O(n*n) effort as well, and it can't be saved. It should be optimized as good as possible to prevent the non-linear effect from kicking in (too early).

        Attachments

          1. CodeHeap_mark_segmap_as_used_PPC.txt
            4 kB
            Lucy Schmidt
          2. CodeHeap_mark_segmap_as_used_S390.txt
            4 kB
            Lucy Schmidt
          3. OverflowCodeCache-add_to_freelist-timing.txt
            5 kB
            Lucy Schmidt
          4. OverflowCodeCache-mark_segmap_as_used-timing.txt
            7 kB
            Lucy Schmidt
          5. Renaissance_CodeHeap_timing.txt
            4 kB
            Lucy Schmidt
          6. StressCodeCache-add_to_freelist-timing.txt
            7 kB
            Lucy Schmidt
          7. StressCodeCache-mark_segmap_as_used-timing.txt
            7 kB
            Lucy Schmidt

          Issue Links

            Activity

              People

                lucy Lucy Schmidt
                lucy Lucy Schmidt
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: