After reading this old article measuring the memory consumption of several object types, I was amazed to see how much memory String
s use in Java:
The UseCompressedStrings compiler option seems like the easiest route to take. If you're using strings only for storage, and not doing any equals/substring/split operations, then something like this CompactCharSequence class could work:
http://www.javamex.com/tutorials/memory/ascii_charsequence.shtml