- Java 9:Building Robust Modular Applications
- Dr. Edward Lavieri Peter Verhas Jason Lee
- 80字
- 2025-04-04 17:08:33
The problem
With the current use of UTF-8, the strings must be converted to string objects, instances of the java.lang.String class. This conversion takes place on-demand which can result in slower systems and unnecessary memory usage. The processing time is extremely short, but the memory usage cannot be overlooked. Every character in an interned string requires at least 3 bytes of memory and potentially more.
A related problem is that the stored strings are not accessible to all JVM processes.