We have started to use a tool called Your Kit
Java Profiler. It shows something that just dumbfounds me, because I would have thought Java was smarter than this. It shows that we have 26 MB of heap devoted to duplicate copies of the empty
string "". Unlike every C compiler that I have ever, used it would appear that if you have multiple strings that are identical, and immutable (you are referencing them as "" in expressions like str = i + ""), each reference produces its own copy of that empty string. The painful solution is to define an empty string in one file:
public final static String s = "";
and then replace all the "" references with s.
Is there really no way to tell the Java compiler to combine immutable constants?