String deduplication in Java
It’s not a secret that String objects in Java consume a lot of memory (just a reminder that each character eats two bytes, yay!). We use strings everywhere, which is kind of natural, sometimes (and often) there are also duplicate strings all over the application. In java several distinct instances of identical strings will be created. This is not ideal and definitely not what we want.