Aleksey Shipilëv:

In almost every project we were taking care of, removing String.intern from the hotpaths was the very profitable performance optimization. Do not use it without thinking, okay?

I’ve worked on projects where .intern() is called on almost every String and found it baffling (and never got a good answer out of anyone as to why it was used, beside that it was already their convention). In the past I’ve seen crazy StackOverflow posts like this where answers have long comment threads contradicting each other.

This series of tests designed and run by someone who really understands the JVM internals sheds much-needed light on the side-effects of a large String Table. Seeing GC pauses in the range of 13ms is enough to make heavy use of this a non-starter for anything involving real time graphics.