Based on JDK development team’s research 25 percent of Java applications memory is filled up with strings. 13.5 percent of those strings are duplicates. This shows one neat ways that we can optimize the application – eliminate duplicate strings from our app. Since Java 8u20 in order to do so we can use UseStringDeduplication JVM argument, which will instruct the JVM to try to get rid of all the duplicate strings and optimize heap memory as part of garbage collection process. It will reduce duplicate String values to a single global char array. However, keep in mind that it will only work with G1 GC algorithm, if you are using another GC algorithm it will not work unless you will switch to C1.
TODO link loggc
If you have additional comments, interesting experiences or even point of disagreement with this JVM argument description, please leave a comment. Your insights will help the entire 10+ million java developer community to develop one standard source of documentation for all the JVM arguments.