D
Donkey Hottie
First, try it without doing anything special, you might be prematurely
worrying about a problem that isn't really a problem.
Second, if you find it really is a problem, you can try using
intern().
String parsedString = getParsedString();
String s = parsedString.intern();
I used HashMap, and not intern(), as it is a J2EE application, and I choose
not to pollute the specific heap for classes and interned strings with my
possibly huge number of things. A local HashMap is easier to discard and
thus gc.
I read mixed opinions about intern() in web, and chose to be sure.