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

Ensure String Deduplication works optimally with Shared Interned Strings


    • Type: Enhancement
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 12
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:


      In JDK9, the CDS shared archive can contain interned strings. The bodies of these strings will never be garbage collected. They are also shareable across different JVM processes that map the same CDS archive.

      The String Deduplication framework maintains a hashtable of the bodies of all the unique strings.

      String Deduplication and Shared Interned Strings should work together in the following ways to minimize memory footprint:

      [1] The CDS archive could potentially contain a large number of Strings (hundred of thousands Strings for some server applications). They are guaranteed to be unique. Therefore, we can save space if we do not enter the bodies of these Strings into the deduplication hashtable.

      [2] If a dynamically created string has the same content as a shared interned string, after deduplication, the dynamic string should use the body of the shared interned string.

      [3] We need to ensure that String deduplication does not modify the String objects stored in the CDS archive.

      NOTE: [1] may cause more overhead when doing a lookup, since now you have to search both the shared interned string table, and the dedup hash table.




            • Assignee:
              iklam Ioi Lam
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: