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

Performance issue (CodeHeap) with large free blocks

XMLWordPrintable

    • b24

        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).

              lucy Lutz Schmidt (Inactive)
              lucy Lutz Schmidt (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: