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

ZGC: String dedups short-lived strings

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • 25
    • 21, 22, 23, 24, 25
    • hotspot
    • gc

      When -XX:+UseStringDeduplication is turned on, ZGC requests that every single String it encounters is deduplicated. The Strings of these requests are saved in weak handles, and then processed by a separate thread. One problematic part with this is that ZGC treats these handles as strong roots for young collections. So, even if the Strings are short-lived they will be artificially kept alive until they get promoted up to the old generation.

      This creates an extreme amount of Strings and weak handles to be processed by the old collection.

      Other GCs have a filter to check for how old the Strings are before they get deduplicated.

      The current idea for a fix is to delay the deduplication until the objects are promoted to the old generation.

            stefank Stefan Karlsson
            stefank Stefan Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: