
上QQ阅读APP看书,第一时间看更新
Storing interned strings in CDS archives [JEP 250]
The method in which strings are stored and accessed to and from Class Data Sharing (CDS) archives is inefficient, excessively time consuming, and wastes memory. The following diagram illustrates the method in which Java stores interned strings in a CDS archive:

The inefficiency stems from the current storage schema. Especially when the Class Data Sharing tool dumps the classes into the shared archive file, the constant pools containing CONSTANT_String items have a UTF-8 string representation.
UTF-8 is an 8-bit variable-length character encoding standard.